From f45cd4c2e4976032a43f1f3bdee6513215a63782 Mon Sep 17 00:00:00 2001 From: Euan Harris Date: Fri, 8 Nov 2024 09:27:47 +0000 Subject: [PATCH] tests: Run tests on Linux CI The EndToEnd tests cannot currently be run: * they deadlock when run under `swift test` (#143) * the CI requires the use of an HTTP proxy to download from the Internet, but SDK generator does not support proxies (#145) The tests are conditionally compiled only on Linux, so we must skip them in CI. --- Docker/docker-compose.yaml | 2 +- Tests/SwiftSDKGeneratorTests/EndToEndTests.swift | 1 + Utilities/test.sh | 6 +----- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Docker/docker-compose.yaml b/Docker/docker-compose.yaml index 88af3c9..0ee1dfd 100644 --- a/Docker/docker-compose.yaml +++ b/Docker/docker-compose.yaml @@ -25,7 +25,7 @@ services: test: <<: *common - command: /bin/bash -xcl "./Utilities/test.sh $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-}" + command: /bin/bash -xcl "./Utilities/test.sh $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} --skip EndToEndTests" # util diff --git a/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift b/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift index 513ac98..fd96ab5 100644 --- a/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift +++ b/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift @@ -48,6 +48,7 @@ final class EndToEndTests: XCTestCase { // Do multiple runs with different sets of arguments. // Test with no arguments by default: var possibleArguments = [""] + do { try await Shell.run("docker ps") possibleArguments.append("--with-docker --linux-distribution-name rhel --linux-distribution-version ubi9") diff --git a/Utilities/test.sh b/Utilities/test.sh index 0c34e4d..ddfcee1 100755 --- a/Utilities/test.sh +++ b/Utilities/test.sh @@ -13,8 +13,4 @@ set -ex -if [ "$(uname)" = Darwin ]; then - swift test $@ -else - swift build --build-tests $@ -fi +swift test $@