From 3fd7acc6e5a8c316c366827956d7c06affdc9685 Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Fri, 7 Oct 2022 15:20:37 -0400 Subject: [PATCH] test/unitTest: Seperate pure tests from integration tests So we can now do `make check` in a reproducible way. To enable integration tests `./configure --enable-integration-tests`. Change-Id: Iaa68c77abade9fe78bae881abc25e034bcb6a067 --- With file names adjusted for the source tarball. configure.ac | 5 ++++ test/unitTest/Makefile.am | 52 +++++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/configure.ac b/configure.ac index 27215d044..aaeef1c1b 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -40,6 +40,11 @@ AS_IF([test "x$enable_debug" = "xyes"], [DAEMONCFLAGS+=" -DNDEBUG=1 -O3" DAEMONCXXFLAGS+=" -DNDEBUG=1 -O3 -Wno-deprecated"]) +AC_ARG_ENABLE([enable_integration_tests], + AS_HELP_STRING([--enable-integration-tests], + [Also run integration tests with check target])) +AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$enable_integration_tests" = "xyes"]) + AC_ARG_ENABLE([fuzzing], AS_HELP_STRING([--enable-fuzzing], [Build fuzzing tools])) diff --git a/test/unitTest/Makefile.am b/test/unitTest/Makefile.am index f2b0fd994..ab232ddb7 100644 --- a/daemon/test/unitTest/Makefile.am +++ b/daemon/test/unitTest/Makefile.am @@ -13,30 +13,6 @@ check_PROGRAMS = ####### Unit Test ######## -# -# account_factory -# -check_PROGRAMS += ut_account_factory -ut_account_factory_SOURCES = account_factory/testAccount_factory.cpp common.cpp - -# -# account_archive -# -check_PROGRAMS += ut_account_archive -ut_account_archive_SOURCES = account_archive/account_archive.cpp common.cpp - -# -# migration -# -check_PROGRAMS += ut_migration -ut_migration_SOURCES = account_archive/migration.cpp common.cpp - -# -# certstore -# -check_PROGRAMS += ut_certstore -ut_certstore_SOURCES = certstore.cpp common.cpp - # # scheduler # @@ -127,6 +103,32 @@ ut_video_scaler_SOURCES = media/video/test_video_scaler.cpp common.cpp check_PROGRAMS += ut_audio_frame_resizer ut_audio_frame_resizer_SOURCES = media/audio/test_audio_frame_resizer.cpp common.cpp +if ENABLE_INTEGRATION_TESTS + +# +# account_factory +# +check_PROGRAMS += ut_account_factory +ut_account_factory_SOURCES = account_factory/testAccount_factory.cpp common.cpp + +# +# account_archive +# +check_PROGRAMS += ut_account_archive +ut_account_archive_SOURCES = account_archive/account_archive.cpp common.cpp + +# +# migration +# +check_PROGRAMS += ut_migration +ut_migration_SOURCES = account_archive/migration.cpp common.cpp + +# +# certstore +# +check_PROGRAMS += ut_certstore +ut_certstore_SOURCES = certstore.cpp common.cpp + # # call # @@ -237,4 +239,6 @@ ut_sip_srtp_SOURCES = sip_account/sip_srtp.cpp check_PROGRAMS += ut_plugins ut_plugins_SOURCES = plugins/plugins.cpp common.cpp +endif # ENABLE_INTEGRATION_TESTS + TESTS = $(check_PROGRAMS) -- 2.37.3 ailure. * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment-container.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Eric Bavier .scm ("substitute, previous partial download around"): New test. Ludovic Courtès 2023-05-30substitute: If a server's nar URL is 404, try the next one(s)....If a substitute server advertises in its narinfo, for example, both a /zstd and a /lzip URL but the /zstd URL is unreachable, try the /lzip URL. Fixes <https://issues.guix.gnu.org/63634>. * guix/narinfo.scm (narinfo-preferred-uris): New procedure. (narinfo-best-uri): Rebase on top of it. * guix/scripts/substitute.scm (download-nar)[try-fetch]: New procedure. Use 'narinfo-preferred-uris' and 'try-fetch' to attempt all the URLs of NARINFO. * tests/substitute.scm (request-substitution): Remove 'parameterize'. Delete DESTINATION. ("substitute, preferred nar URL is 404, other is 200"): New test. Ludovic Courtès 2022-09-28substitute: Retry downloading when a nar is unavailable....Fixes <https://issues.guix.gnu.org/57978> Reported by Attila Lendvai <attila@lendvai.name>. Previously, if a narinfo was available but its corresponding nar was missing (for instance because the narinfo was cached and the server became unreachable in the meantime), 'guix substitute --substitute' would try to download the nar from its preferred location and abort when that fails. This change forces one retry with each of the URLs. * guix/scripts/substitute.scm (download-nar): Do not catch 'http-get-error?' exceptions. (system-error?, network-error?, process-substitution/fallback): New procedures. (process-substitution): Call 'process-substitution/fallback' upon 'network-error?'. * tests/substitute.scm ("substitute, first URL has narinfo but lacks nar, second URL unauthorized") ("substitute, first URL has narinfo but nar is 404, both URLs authorized") ("substitute, first URL has narinfo but nar is 404, one URL authorized") ("substitute, narinfo is available but nar is missing"): New tests. Ludovic Courtès 2022-09-24substitute: Test behavior with unroutable substitute server addresses....* tests/substitute.scm (%unroutable-substitute-url): New variable. ("query narinfo signed with authorized key, unroutable URL first") ("substitute, authorized key, first substitute URL is unroutable"): New tests. Ludovic Courtès 2022-02-14publish: Do not sign the URL/Compression/FileSize narinfo fields....This will allow mirror operators to alter these non-normative bits of a narinfo without having to resign narinfos. * guix/scripts/publish.scm (narinfo-string): Remove URL/Compression/FileSize from BASE-INFO. Move them after "Signature". * tests/publish.scm ("/*.narinfo") ("/*.narinfo with properly encoded '+' sign") ("/*.narinfo with lzip + gzip") ("with cache, lzip + gzip"): Adjust accordingly. * tests/substitute.scm ("query narinfo with signature over relevant subset"): New test. Ludovic Courtès