From 0267c453e2e0d474f742efa1da3ce698ea4af97d Mon Sep 17 00:00:00 2001 From: Alexander Færøy Date: Mon, 18 Mar 2019 15:27:14 +0100 Subject: Run `make reset-gcov` after the script target in Travis CI is done. This should ensure that GCDA files are never entering the cache of Travis CI. See: https://bugs.torproject.org/29036 --- .travis.yml | 8 +++++--- changes/bug29036 | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 changes/bug29036 diff --git a/.travis.yml b/.travis.yml index 939f4f4e90..5319bbb896 100644 --- a/.travis.yml +++ b/.travis.yml @@ -155,6 +155,8 @@ script: ## We run `make check` because that's what https://jenkins.torproject.org does. - if [[ "$DISTCHECK" == "" ]]; then make check; fi - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; fi + ## If this build was one that produced coverage, upload it. + - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi after_failure: ## configure will leave a log file with more details of config failures. @@ -165,9 +167,9 @@ after_failure: ## `make distcheck` puts it somewhere different. - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog || echo "make failed"; fi -after_success: - ## If this build was one that produced coverage, upload it. - - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi +before_cache: + # Delete all .gcda files. + - if [[ "$COVERAGE_OPTIONS" != "" ]]; then make reset-gcov; fi notifications: irc: diff --git a/changes/bug29036 b/changes/bug29036 new file mode 100644 index 0000000000..4de02adfe3 --- /dev/null +++ b/changes/bug29036 @@ -0,0 +1,5 @@ + o Minor bugfix (continuous integration): + - Reset coverage state on disk after Travis CI has finished. This is being + done to prevent future gcda file merge errors which causes the test suite + for the process subsystem to fail. Fixes bug 29036; bugfix on 0.4.0.1-alpha. + -- cgit v1.2.3-54-g00ecf From fbb1c7adfcfbda2f7ed6877beb137c382ecb6b50 Mon Sep 17 00:00:00 2001 From: Alexander Færøy Date: Wed, 20 Mar 2019 15:44:06 +0100 Subject: Handle errors from coveralls more gracefully. Since we have moved coveralls to the script target the entire build will now fail if coveralls fail. We handle it more gracefully by echo'ing the failure instead of doing a hard-failure. See: https://bugs.torproject.org/29036 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5319bbb896..336b67d299 100644 --- a/.travis.yml +++ b/.travis.yml @@ -156,7 +156,7 @@ script: - if [[ "$DISTCHECK" == "" ]]; then make check; fi - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; fi ## If this build was one that produced coverage, upload it. - - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi + - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p' || echo "Coverage failed"; fi after_failure: ## configure will leave a log file with more details of config failures. -- cgit v1.2.3-54-g00ecf From eb0bd18d6e344c574614d6d53e2f7cead92c3178 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 1 Apr 2019 13:40:16 +1000 Subject: changes: Use the first Tor version with CI coverage for the 29036 changes file Otherwise, "make check-changes" will complain when we backport the change. --- changes/bug29036 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changes/bug29036 b/changes/bug29036 index 4de02adfe3..8b96c5c8fa 100644 --- a/changes/bug29036 +++ b/changes/bug29036 @@ -1,5 +1,5 @@ o Minor bugfix (continuous integration): - Reset coverage state on disk after Travis CI has finished. This is being done to prevent future gcda file merge errors which causes the test suite - for the process subsystem to fail. Fixes bug 29036; bugfix on 0.4.0.1-alpha. - + for the process subsystem to fail. The process subsystem was introduced + in 0.4.0.1-alpha. Fixes bug 29036; bugfix on 0.2.9.15. -- cgit v1.2.3-54-g00ecf From 57e9fe2bbaa66ee907d68cdf7ebcf2111bd71ac9 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 1 Apr 2019 13:49:27 +1000 Subject: Makefile: delete all the gcov-related files in reset-gcov And fix a comment. See: https://gcc.gnu.org/onlinedocs/gcc/Gcov-Data-Files.html#Gcov-Data-Files --- .travis.yml | 2 +- Makefile.am | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 336b67d299..456b5abc56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -168,7 +168,7 @@ after_failure: - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog || echo "make failed"; fi before_cache: - # Delete all .gcda files. + ## Delete all gcov files. - if [[ "$COVERAGE_OPTIONS" != "" ]]; then make reset-gcov; fi notifications: diff --git a/Makefile.am b/Makefile.am index e4be3f26f9..4b1687f921 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,7 +149,9 @@ test-full: need-stem-path need-chutney-path check test-network test-stem test-full-online: need-stem-path need-chutney-path check test-network test-stem-full reset-gcov: - rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda + rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda \ + $(top_builddir)/src/*/*.gcno $(top_builddir)/src/*/*/*.gcno \ + $(top_builddir)/src/*/*.gcov $(top_builddir)/src/*/*/*.gcov HTML_COVER_DIR=$(top_builddir)/coverage_html coverage-html: all -- cgit v1.2.3-54-g00ecf From f0cd8f804f8152355993acf0493b22b668f500b2 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 5 Apr 2019 12:56:29 +1000 Subject: Makefile: actually, don't delete the gcno files We need to keep the gcno files, because they are created at compile time. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 4b1687f921..48d3df2654 100644 --- a/Makefile.am +++ b/Makefile.am @@ -148,9 +148,9 @@ test-full: need-stem-path need-chutney-path check test-network test-stem test-full-online: need-stem-path need-chutney-path check test-network test-stem-full +# We can't delete the gcno files, because they are created when tor is compiled reset-gcov: rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda \ - $(top_builddir)/src/*/*.gcno $(top_builddir)/src/*/*/*.gcno \ $(top_builddir)/src/*/*.gcov $(top_builddir)/src/*/*/*.gcov HTML_COVER_DIR=$(top_builddir)/coverage_html -- cgit v1.2.3-54-g00ecf