Skip to content

Commit

Permalink
Run tests with TSAN where available, add macOS CI for Swift 5.2
Browse files Browse the repository at this point in the history
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 grpc#757
  • Loading branch information
glbrntt committed May 21, 2020
1 parent e6fa863 commit f36e474
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .travis-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f36e474

Please sign in to comment.