Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test: #322: disable integration tests by default #323

Merged
merged 1 commit into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sudo: enabled
before_install:
- /bin/bash rubix_setup_build.sh
install: true
script: chmod a+x docker_build_rubix.sh && /bin/bash rubix_run_build.sh mvn integration-test -rf :rubix-tests
script: chmod a+x docker_build_rubix.sh && /bin/bash rubix_run_build.sh mvn integration-test -Pintegration-tests -rf :rubix-tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-rf :rubix-tests will only start rubix-tests module. So, Cobertura is not reporting coverage for all the other unit-tests. I think you should remove -rf :rubix-tests

Copy link
Contributor Author

@jordanw-bq jordanw-bq Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cobertura coverage gets reported as a separate step, since running tests with coverage interferes with the integration tests:

if [[ -n "${TRAVIS}" ]]; then
upload-coverage-results
fi

upload-coverage-results() {
echo "=== Running tests with coverage ==="
# "cobertura-integration-test" goal needed for shading JARs
# if run on CI, integration tests will have been run before this
mvn cobertura:cobertura-integration-test -Pno-integration-tests
echo "=== Uploading code coverage results to Codecov ==="
bash <(curl -s https://codecov.io/bash)
}

We start from this module to avoid running the unit tests multiple times, which would increase the build time by 1:30-2min.

env:
global:
- TRAVIS_ENV=`bash <(curl -s https://codecov.io/env)`
Expand Down
2 changes: 1 addition & 1 deletion docker_build_rubix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ upload-coverage-results() {
echo "=== Running tests with coverage ==="
# "cobertura-integration-test" goal needed for shading JARs
# if run on CI, integration tests will have been run before this
mvn cobertura:cobertura-integration-test -Pno-integration-tests
mvn cobertura:cobertura-integration-test
echo "=== Uploading code coverage results to Codecov ==="
bash <(curl -s https://codecov.io/bash)
}
Expand Down
4 changes: 2 additions & 2 deletions mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

MAVEN_CMD="mvn $@"

if [[ "$*" == *-DrunITs* ]]
if [[ "$*" == *-Pintegration-tests* ]]
then
export RUBIX_DOCKER_NETWORK_NAME=network-rubix-build
source ./rubix_setup_build.sh
source ./rubix_run_build.sh "${MAVEN_CMD}"
else
exec ${MAVEN_CMD} -Pno-integration-tests
exec ${MAVEN_CMD}
fi
5 changes: 3 additions & 2 deletions rubix-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@

<profiles>
<profile>
<id>no-integration-tests</id>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
<skipTests>false</skipTests>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -128,6 +128,7 @@
</execution>
</executions>
<configuration>
<skipTests>true</skipTests>
<name>Integration</name>
<testCasesDirectory>${project.basedir}/src/test/robotframework</testCasesDirectory>
<extraPathDirectories>
Expand Down