Skip to content

Commit 2b946da

Browse files
authored
SWIFT-724 Use --enable-test-discovery to auto-discover tests on Linux (#692)
1 parent 7466a67 commit 2b946da

File tree

7 files changed

+3
-482
lines changed

7 files changed

+3
-482
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,6 @@ functions:
415415
${PREPARE_SHELL}
416416
SWIFT_VERSION=${SWIFT_VERSION} \
417417
bash ${PROJECT_DIRECTORY}/.evergreen/install-tools.sh sourcery
418-
make linuxmain SOURCERY=${PROJECT_DIRECTORY}/opt/sourcery/bin/sourcery
419-
# use regex to ignore lines starting with a /
420-
git diff -G "^[^\/].*\n" --exit-code Tests/LinuxMain.swift
421418
make exports SOURCERY=${PROJECT_DIRECTORY}/opt/sourcery/bin/sourcery
422419
git diff -G "^[^\/].*\n" --exit-code Sources/MongoSwiftSync/Exports.swift
423420

.evergreen/run-ocsp-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ swift build
3636
set +o errexit # even if tests fail we want to parse the results, so disable errexit
3737
set -o pipefail # propagate error codes in the following pipes
3838

39-
swift test --filter=OCSP
39+
swift test --enable-test-discovery --filter=OCSP

.evergreen/run-serverless-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ MONGODB_TOPOLOGY="load_balanced" \
3131
MONGODB_SCRAM_PASSWORD=${SERVERLESS_ATLAS_PASSWORD} \
3232
AUTH="auth" \
3333
SSL="ssl" \
34-
swift test --filter="(Crud|Retryable|Transactions|Versioned|Session|LoadBalancer|MongoCursor)"
34+
swift test --enable-test-discovery --filter="(Crud|Retryable|Transactions|Versioned|Session|LoadBalancer|MongoCursor)"

.evergreen/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fi
5454

5555
MONGODB_TOPOLOGY=${TOPOLOGY} MONGODB_URI=$MONGODB_URI SINGLE_MONGOS_LB_URI=$SINGLE_MONGOS_LB_URI \
5656
MULTI_MONGOS_LB_URI=$MULTI_MONGOS_LB_URI MONGODB_API_VERSION=$MONGODB_API_VERSION \
57-
swift test $FILTER_STATEMENT $SANITIZE_STATEMENT 2>&1 | tee ${RAW_TEST_RESULTS}
57+
swift test --enable-test-discovery $FILTER_STATEMENT $SANITIZE_STATEMENT 2>&1 | tee ${RAW_TEST_RESULTS}
5858

5959
# save tests exit code
6060
EXIT_CODE=$?

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ project:
2828
@$(call check_for_gem,xcodeproj)
2929
ruby etc/add_json_files.rb
3030

31-
linuxmain:
32-
$(SOURCERY) --sources Tests/ --exclude-sources Tests/DisabledTests/ --templates Tests/LinuxMain.stencil --output Tests/LinuxMain.swift
33-
3431
exports:
3532
$(SOURCERY) --sources Sources/MongoSwift/ --templates Sources/MongoSwiftSync/Exports.stencil --output Sources/MongoSwiftSync/Exports.swift
3633

Tests/LinuxMain.stencil

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)