From f36e4747c66dfa7991275eb07446ac10ee39ce33 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Fri, 15 May 2020 15:16:55 +0100 Subject: [PATCH] Run tests with TSAN where available, add macOS CI for Swift 5.2 Motivation: We should run TSAN in tests. Modifications: - run TSAN by default; don't run TSAN for Swift 5.0 on Linux - add Xcode 11.4 to add CI for Swift 5.2 on macOS Result: Resolves #757 --- .travis-script.sh | 11 +++++++++-- .travis.yml | 10 +++++++++- Makefile | 5 +++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.travis-script.sh b/.travis-script.sh index 87ecb43c9..d8ac47d3e 100755 --- a/.travis-script.sh +++ b/.travis-script.sh @@ -46,8 +46,15 @@ make_all() { make_test() { echo -en 'travis_fold:start:make.test\\r' - info "Running Swift tests" - make test + + if [[ ${NO_TSAN} == "true" ]]; then + info "Running Swift tests" + make test + else + info "Running Swift tests with TSAN" + make test-tsan + fi + success "Swift tests passed" echo -en 'travis_fold:end:make.test\\r' } diff --git a/.travis.yml b/.travis.yml index 4c725ec10..aba804481 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,11 @@ jobs: env: RUN_INTEROP_TESTS=false SWIFT_VERSION=5.1.5 - <<: *tests name: "Unit Tests: Ubuntu 18.04 (Swift 5.0)" - env: RUN_INTEROP_TESTS=false SWIFT_VERSION=5.0.3 + env: RUN_INTEROP_TESTS=false SWIFT_VERSION=5.0.3 NO_TSAN=true + - <<: *tests + name: "Unit Tests: Xcode 11.4 (Swift 5.2)" + os: osx + osx_image: xcode11.4 - <<: *tests name: "Unit Tests: Xcode 11.3 (Swift 5.1)" os: osx @@ -55,6 +59,10 @@ jobs: - <<: *interop_tests name: "Interoperability Tests: Ubuntu 18.04 (Swift 5.0)" env: RUN_INTEROP_TESTS=true SWIFT_VERSION=5.0.3 + - <<: *interop_tests + name: "Interoperability Tests: Xcode 11.4 (Swift 5.2)" + os: osx + osx_image: xcode11.4 - <<: *interop_tests name: "Interoperability Tests: Xcode 11.3 (Swift 5.1)" os: osx diff --git a/Makefile b/Makefile index fda757db7..616cd1a30 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,11 @@ generate-route-guide: ${ROUTE_GUIDE_PB} ${ROUTE_GUIDE_GRPC} test: ${SWIFT_TEST} +# Normal test suite with TSAN enabled. +.PHONY: +test-tsan: + ${SWIFT_TEST} --sanitize=thread + # Checks that linuxmain has been updated: requires macOS. .PHONY: test-generate-linuxmain: generate-linuxmain