Skip to content

Commit 3fa2acc

Browse files
committed
Travis build / unit test / coverage
Coverage will be sad, I know. Ironic.
1 parent 0e48af1 commit 3fa2acc

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.travis.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
language: minimal
2+
3+
os: linux
4+
5+
services:
6+
- docker
7+
8+
env:
9+
- container_image="intersystemsdc/iris-community:2019.4.0.383.0-zpm"
10+
instance="iris"
11+
package="testcoverage"
12+
build_flags="-verbose"
13+
>
14+
test_flags="-verbose -DUnitTest.ManagerClass=TestCoverage.Manager -DUnitTest.JUnitOutput=/source/junit.xml
15+
-DUnitTest.FailuresAreFatal=1 -DUnitTest.Manager=TestCoverage.Manager
16+
-DUnitTest.UserParam.CoverageReportClass=TestCoverage.Report.Cobertura.ReportGenerator
17+
-DUnitTest.UserParam.CoverageReportFile=/source/coverage.xml"
18+
19+
install:
20+
# Run InterSystems IRIS instance
21+
- docker pull $container_image
22+
- docker run -d -h $instance --name $instance -v $TRAVIS_BUILD_DIR:/source --init $container_image
23+
- echo halt > wait
24+
- until docker exec --interactive $instance iris session $instance < wait; do sleep 1; done # Wait for instance to be ready
25+
# Workaround for permissions issues in TestCoverage (creating directory for source export)
26+
- chmod 777 $TRAVIS_BUILD_DIR
27+
28+
script:
29+
# Run build
30+
- >
31+
echo
32+
"set good = ##class(%ZPM.PackageManager).Shell(\"load /source $build_flags\")
33+
write !
34+
if good<1 { do \$System.Process.Terminate(\$job,1) }
35+
halt" > build
36+
# Run tests (with workaround for https://github.com/intersystems-community/zpm/pull/30 - test result will always be index 1)
37+
- >
38+
echo
39+
"set ^||%UnitTest.Manager.LastResult = 1
40+
set good = ##class(%ZPM.PackageManager).Shell(\"$package test -only $test_flags\")
41+
write !
42+
if good<1 { do \$System.Process.Terminate(\$job,1) }
43+
halt" > test
44+
- docker exec --interactive $instance iris session $instance -B < build && docker exec --interactive $instance iris session $instance -B < test
45+
46+
after_success:
47+
# Publish to codecov
48+
- bash <(curl -s https://codecov.io/bash)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TestCoverage.PKG
2+
-TestCoverage.UI.PKG

0 commit comments

Comments
 (0)