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: disable 2 tests on linux only, switch to ubuntu 20 and 22 #705

Merged
merged 11 commits into from
Apr 4, 2023
Merged
23 changes: 12 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
- os: ubuntu-20.04
platform_name: 20_04-x86-64
- os: ubuntu-22.04
platform_name: 22_04-x86-64
steps:
- name: Clone project
uses: actions/checkout@v2
Expand All @@ -42,19 +44,18 @@ jobs:
run: cabal build --enable-tests

- name: Test
if: matrix.os == 'ubuntu-18.04'
timeout-minutes: 30
shell: bash
run: cabal test --test-show-details=direct

- name: Prepare binaries
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-20.04'
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
mv $(cabal list-bin smp-server) smp-server-ubuntu-20_04-x86-64
mv $(cabal list-bin ntf-server) ntf-server-ubuntu-20_04-x86-64
mv $(cabal list-bin xftp-server) xftp-server-ubuntu-20_04-x86-64
mv $(cabal list-bin xftp) xftp-ubuntu-20_04-x86-64
mv $(cabal list-bin smp-server) smp-server-ubuntu-$platform_name
mv $(cabal list-bin ntf-server) ntf-server-ubuntu--$platform_name
mv $(cabal list-bin xftp-server) xftp-server-ubuntu--$platform_name
mv $(cabal list-bin xftp) xftp-ubuntu--$platform_name

- name: Build changelog
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-20.04'
Expand All @@ -80,10 +81,10 @@ jobs:
prerelease: true
epoberezkin marked this conversation as resolved.
Show resolved Hide resolved
files: |
LICENSE
smp-server-ubuntu-20_04-x86-64
ntf-server-ubuntu-20_04-x86-64
xftp-server-ubuntu-20_04-x86-64
xftp-ubuntu-20_04-x86-64
smp-server-ubuntu--$platform_name
ntf-server-ubuntu--$platform_name
xftp-server-ubuntu--$platform_name
xftp-ubuntu--$platform_name
epoberezkin marked this conversation as resolved.
Show resolved Hide resolved
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion tests/AgentTests/NotificationTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ notificationTests t =
withAPNSMockServer $ \apns ->
testNtfTokenServerRestart t apns
describe "Managing notification subscriptions" $ do
it "should create notification subscription for existing connection" $ \_ ->
-- fails on Ubuntu 20/22
xit' "should create notification subscription for existing connection" $ \_ ->
withSmpServer t $
withAPNSMockServer $ \apns ->
withNtfServer t $ testNotificationSubscriptionExistingConnection apns
Expand Down
4 changes: 4 additions & 0 deletions tests/NtfClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import Simplex.Messaging.Transport
import Simplex.Messaging.Transport.Client
import Simplex.Messaging.Transport.HTTP2 (HTTP2Body (..), http2TLSParams)
import Simplex.Messaging.Transport.HTTP2.Server
import System.Info (os)
import Test.Hspec
import UnliftIO.Async
import UnliftIO.Concurrent
Expand Down Expand Up @@ -73,6 +74,9 @@ testNtfClient client = do
Right th -> client th
Left e -> error $ show e

xit' :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)
xit' = if os == "linux" then xit else it

ntfServerCfg :: NtfServerConfig
ntfServerCfg =
NtfServerConfig
Expand Down
3 changes: 2 additions & 1 deletion tests/NtfServerTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ v .-> key =

testNotificationSubscription :: ATransport -> Spec
testNotificationSubscription (ATransport t) =
it "should create notification subscription and notify when message is received" $ do
-- hangs on Ubuntu 20/22
xit' "should create notification subscription and notify when message is received" $ do
(sPub, sKey) <- C.generateSignatureKeyPair C.SEd25519
(nPub, nKey) <- C.generateSignatureKeyPair C.SEd25519
(tknPub, tknKey) <- C.generateSignatureKeyPair C.SEd25519
Expand Down