Skip to content

Commit

Permalink
tests: Run tests on Linux CI
Browse files Browse the repository at this point in the history
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are conditionally compiled only on Linux, so we must skip
them in CI.

Fixes swiftlang#45
  • Loading branch information
euanh committed Nov 8, 2024
1 parent bde8791 commit 7e463a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions Tests/SwiftSDKGeneratorTests/EndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 1 addition & 5 deletions Utilities/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@

set -ex

if [ "$(uname)" = Darwin ]; then
swift test $@
else
swift build --build-tests $@
fi
swift test $@

0 comments on commit 7e463a4

Please sign in to comment.