Skip to content

Commit

Permalink
Run Kitura tests in travis CI (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pushkar N Kulkarni authored and djones6 committed Feb 7, 2019
1 parent f5aba72 commit 8ddc7ea
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .kitura-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Run Kitura-net tests
travis_start "swift_test"
echo ">> Executing Kitura-net tests"
swift test
SWIFT_TEST_STATUS=$?
travis_end
if [ $SWIFT_TEST_STATUS -ne 0 ]; then
echo ">> swift test command exited with $SWIFT_TEST_STATUS"
# Return a non-zero status so that Package-Builder will generate a backtrace
return $SWIFT_TEST_STATUS
fi

# Clone Kitura
set -e
echo ">> Building Kitura"
travis_start "swift_build_kitura"
cd .. && git clone https://github.com/IBM-Swift/Kitura && cd Kitura

# Build once
swift build

# Edit package Kitura-net to point to the current branch
echo ">> Editing Kitura package to use latest Kitura-net"
swift package edit Kitura-net --path ../Kitura-net
travis_end
set +e

# Run Kitura tests
travis_start "swift_test_kitura"
echo ">> Executing Kitura tests"
swift test
SWIFT_TEST_STATUS=$?
travis_end
if [ $SWIFT_TEST_STATUS -ne 0 ]; then
echo ">> swift test command exited with $SWIFT_TEST_STATUS"
# Return a non-zero status so that Package-Builder will generate a backtrace
return $SWIFT_TEST_STATUS
fi

# Move back to the original build directory. This is needed on macOS builds for the subsequent swiftlint step.
cd ../Kitura-net
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ matrix:
dist: trusty
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:16.04 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
env: DOCKER_IMAGE=ubuntu:16.04 SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT CUSTOM_TEST_SCRIPT=.kitura-test.sh DOCKER_ENVIRONMENT=CUSTOM_TEST_SCRIPT
# Test GCD_ASYNCH codepath on Linux
- os: linux
dist: trusty
Expand All @@ -57,7 +57,7 @@ matrix:
- os: osx
osx_image: xcode10.1
sudo: required
env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT CUSTOM_TEST_SCRIPT=.kitura-test.sh

before_install:
- git clone https://github.com/IBM-Swift/Package-Builder.git
Expand Down

0 comments on commit 8ddc7ea

Please sign in to comment.