Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d34c9a6

Browse files
committed
Updated test script to capture failed tests and return non-zero exit code.
Fixed sonar properties. Moved new tests to the end of the build process.
1 parent fdc2513 commit d34c9a6

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ before_script:
8585
script:
8686
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi
8787
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi
88-
- if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi
8988
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/create_additional_grants_for_old_tests.sh; fi
9089
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples.sh; fi
9190
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi
91+
- if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi
9292
- if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then sonar-scanner; fi
9393
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi
9494
- bash .travis/build_docs.sh

sonar-project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ sonar.projectVersion=v3.0.2
99
# If not set, SonarQube starts looking for source code from the directory containing
1010
# the sonar-project.properties file.
1111
sonar.sources=./source
12-
sonar.coverageReportPaths=./tests/coverage.xml,coverage.xml
12+
sonar.coverageReportPaths=./test/coverage.xml,coverage.xml
1313
sonar.tests=./test
14-
sonar.testExecutionReportPaths=test_results.xml
14+
sonar.testExecutionReportPaths=./test/test_results.xml
1515
sonar.links.issue=https://github.com/utPLSQL/utPLSQL/issues
1616
sonar.links.ci=https://travis-ci.org/utPLSQL/utPLSQL
1717
sonar.links.homepage=https://github.com/utPLSQL/utPLSQL

test/install_and_run_tests.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
#!/bin/bash
22
set -ev
33

4-
cd test
4+
#cd test
5+
#
6+
#"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql
7+
#
8+
#cd ..
9+
#
10+
#utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \
11+
#-source_path=source -test_path=tests \
12+
#-f=ut_documentation_reporter -c -o=test_results.log -s \
13+
#-f=ut_coverage_sonar_reporter -o=coverage.xml \
14+
#-f=ut_sonar_test_reporter -o=test_results.xml
515

6-
"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql
16+
status_line_regex="^[0-9]+ tests, ([0-9]+) failed, ([0-9]+) errored.*"
717

8-
cd ..
18+
RC=$(cat test_results.log | grep -E "${status_line_regex}" | sed -re "s/${status_line_regex}/\1\2/")
919

10-
utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \
11-
-source_path=source -test_path=tests \
12-
-f=ut_documentation_reporter -c \
13-
-f=ut_coverage_sonar_reporter -o=coverage.xml \
14-
-f=ut_sonar_test_reporter -o=test_results.xml
20+
exit $RC

0 commit comments

Comments
 (0)