Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test smp server with postgres backend #1463

Merged
merged 12 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ jobs:
build:
name: build-${{ matrix.os }}-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}

services:
postgres:
image: postgres:15
env:
POSTGRES_HOST_AUTH_METHOD: trust # Allows passwordless access
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -52,6 +67,8 @@ jobs:
timeout-minutes: 40
shell: bash
run: cabal test --test-show-details=direct
env:
PGHOST: localhost

- name: Prepare binaries
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
2 changes: 1 addition & 1 deletion tests/ServerTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import Util (removeFileIfExists)
serverTests :: SpecWith (ATransport, AStoreType)
serverTests = do
describe "SMP queues" $ do
describe "NEW and KEY commands, SEND messages" testCreateSecure
fdescribe "NEW and KEY commands, SEND messages" testCreateSecure
describe "NEW and SKEY commands" $ do
testCreateSndSecure
testSndSecureProhibited
Expand Down
13 changes: 6 additions & 7 deletions tests/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import qualified GHC.IO.Exception as IOException
import NtfServerTests (ntfServerTests)
import RemoteControl (remoteControlTests)
import SMPClient (skipOnCI, testServerDBConnectInfo)

Check warning on line 26 in tests/Test.hs

View workflow job for this annotation

GitHub Actions / build-ubuntu-20.04-9.6.3

The import of ‘skipOnCI’ from module ‘SMPClient’ is redundant

Check warning on line 26 in tests/Test.hs

View workflow job for this annotation

GitHub Actions / build-ubuntu-22.04-9.6.3

The import of ‘skipOnCI’ from module ‘SMPClient’ is redundant
import SMPProxyTests (smpProxyTests)
import ServerTests
import Simplex.Messaging.Agent.Store.Postgres.Util (createDBAndUserIfNotExists, dropDatabaseAndUser)
Expand Down Expand Up @@ -78,13 +78,12 @@
describe "Store log tests" storeLogTests
describe "TRcvQueues tests" tRcvQueuesTests
describe "Util tests" utilTests
skipOnCI $
beforeAll_ (dropDatabaseAndUser testServerDBConnectInfo >> createDBAndUserIfNotExists testServerDBConnectInfo)
$ afterAll_ (dropDatabaseAndUser testServerDBConnectInfo)
-- TODO [postgres] fix store log tests
$ xdescribe "SMP server via TLS, postgres+jornal message store" $ do
describe "SMP syntax" $ serverSyntaxTests (transport @TLS)
before (pure (transport @TLS, ASType SQSPostgres SMSJournal)) serverTests
beforeAll_ (dropDatabaseAndUser testServerDBConnectInfo >> createDBAndUserIfNotExists testServerDBConnectInfo)
$ afterAll_ (dropDatabaseAndUser testServerDBConnectInfo)
-- TODO [postgres] fix store log tests
$ describe "SMP server via TLS, postgres+jornal message store" $ do
describe "SMP syntax" $ serverSyntaxTests (transport @TLS)
before (pure (transport @TLS, ASType SQSPostgres SMSJournal)) serverTests
describe "SMP server via TLS, jornal message store" $ do
describe "SMP syntax" $ serverSyntaxTests (transport @TLS)
before (pure (transport @TLS, ASType SQSMemory SMSJournal)) serverTests
Expand Down
Loading