From eb240aa0670d022810426ce5d977ebbb1ceb0e4b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 20 Aug 2026 20:04:32 +0100 Subject: [PATCH] tests: Consistently Use the "no plan" style for TAP tests Instead of announcing ahead of time how many tests will be run, just log 1..32 or similar at the end, from the done_testing function. This should go some way towards preventing unnecessary cherry-pick conflicts when tests added to this script get backported. Resolves: https://github.com/flatpak/flatpak/issues/6793 Signed-off-by: Simon McVittie --- tests/test-auth.sh | 2 -- tests/test-basic.sh | 2 -- tests/test-build-update-repo.sh | 2 -- tests/test-bundle.sh | 2 -- tests/test-completion.sh | 2 -- tests/test-config.sh | 2 -- tests/test-default-remotes.sh | 2 -- tests/test-extension-branch-follow.sh | 2 -- tests/test-extensions.sh | 2 -- tests/test-extra-data.sh | 2 -- tests/test-history.sh | 2 -- tests/test-http-utils.sh | 2 -- tests/test-info.sh | 2 -- tests/test-metadata-validation.sh | 2 -- tests/test-metainfo-export.sh | 2 -- tests/test-oci-auth.sh | 2 -- tests/test-oci-registry.sh | 2 -- tests/test-oci.sh | 2 -- tests/test-override.sh | 2 -- tests/test-preinstall.sh | 2 -- tests/test-prune.sh | 2 -- tests/test-repair.sh | 2 -- tests/test-repo.sh | 2 -- tests/test-run-custom.sh | 2 -- tests/test-run.sh | 2 -- tests/test-seccomp.sh | 2 -- tests/test-sideload.sh | 2 -- tests/test-subset.sh | 2 -- tests/test-summaries.sh | 2 -- tests/test-unused.sh | 2 -- tests/test-update-portal.sh | 2 -- tests/test-update-remote-configuration.sh | 2 -- tests/test-upgrade-from-header.sh | 2 -- 33 files changed, 66 deletions(-) diff --git a/tests/test-auth.sh b/tests/test-auth.sh index 65a321417..2ad2030cf 100755 --- a/tests/test-auth.sh +++ b/tests/test-auth.sh @@ -22,8 +22,6 @@ set -euo pipefail . $(dirname $0)/libtest.sh -plan_tests 4 - setup_repo commit_to_obj () { diff --git a/tests/test-basic.sh b/tests/test-basic.sh index a1ef79fd4..8f2cbf9b8 100755 --- a/tests/test-basic.sh +++ b/tests/test-basic.sh @@ -24,8 +24,6 @@ set -euo pipefail # This test looks for specific localized strings. export LC_ALL=C -plan_tests 11 - ${FLATPAK} --version > version_out VERSION=`cat "$test_builddir/package_version.txt"` diff --git a/tests/test-build-update-repo.sh b/tests/test-build-update-repo.sh index 6c96969cc..dc4eddf9a 100755 --- a/tests/test-build-update-repo.sh +++ b/tests/test-build-update-repo.sh @@ -27,8 +27,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 5 - # Configure a repository, then set a collection ID on it and check that the ID # is saved in the config file. setup_repo diff --git a/tests/test-bundle.sh b/tests/test-bundle.sh index 160d4cb3b..99b069273 100755 --- a/tests/test-bundle.sh +++ b/tests/test-bundle.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 9 - mkdir bundles setup_repo diff --git a/tests/test-completion.sh b/tests/test-completion.sh index 72e677e86..bc49489d8 100755 --- a/tests/test-completion.sh +++ b/tests/test-completion.sh @@ -27,8 +27,6 @@ skip_revokefs_without_fuse # This test looks for specific localized strings. export LC_ALL=C -plan_tests 17 - setup_repo install_repo diff --git a/tests/test-config.sh b/tests/test-config.sh index e6d99e352..cf317ad69 100755 --- a/tests/test-config.sh +++ b/tests/test-config.sh @@ -24,8 +24,6 @@ set -euo pipefail # This test looks for specific localized strings. export LC_ALL=C -plan_tests 5 - ${FLATPAK} config --list > list_out assert_file_has_content list_out "^languages:" diff --git a/tests/test-default-remotes.sh b/tests/test-default-remotes.sh index cb18e9fd0..5c61f71de 100755 --- a/tests/test-default-remotes.sh +++ b/tests/test-default-remotes.sh @@ -38,8 +38,6 @@ Homepage=https://the.homepage/ Icon=https://the.icon/ EOF -plan_tests 5 - mkdir -p $FLATPAK_CONFIG_DIR/remotes.d ${FLATPAK} -vv --system remotes > remotes diff --git a/tests/test-extension-branch-follow.sh b/tests/test-extension-branch-follow.sh index 3def3c4c5..1659cc9ad 100755 --- a/tests/test-extension-branch-follow.sh +++ b/tests/test-extension-branch-follow.sh @@ -8,8 +8,6 @@ set -euo pipefail skip_without_bwrap -plan_tests 1 - setup_repo () { mkdir -p repos ostree init --repo=repos/test --mode=archive-z2 diff --git a/tests/test-extensions.sh b/tests/test-extensions.sh index edbca59e7..f0ebced16 100755 --- a/tests/test-extensions.sh +++ b/tests/test-extensions.sh @@ -23,8 +23,6 @@ set -euo pipefail skip_without_bwrap -plan_tests 2 - make_extension () { local ID=$1 local VERSION=$2 diff --git a/tests/test-extra-data.sh b/tests/test-extra-data.sh index 40bcee2fa..7095a72a6 100755 --- a/tests/test-extra-data.sh +++ b/tests/test-extra-data.sh @@ -45,8 +45,6 @@ curl "${EXTRA_DATA_URL}" -o "${DOWNLOADED_EXTRA_DATA}" EXTRA_DATA_SIZE=$(stat --printf="%s" "${DOWNLOADED_EXTRA_DATA}") EXTRA_DATA_SHA256=$(sha256sum "${DOWNLOADED_EXTRA_DATA}" | cut -f1 -d' ') -plan_tests 3 - # build the app with the extra data EXTRA_DATA="--extra-data=test:${EXTRA_DATA_SHA256}:${EXTRA_DATA_SIZE}:${EXTRA_DATA_SIZE}:${EXTRA_DATA_URL}" BUILD_FINISH_ARGS=${EXTRA_DATA} make_updated_app ${REPONAME} ${COLLECTION_ID} ${BRANCH} UPDATE1 diff --git a/tests/test-history.sh b/tests/test-history.sh index 0e06fe9d7..77a7afad7 100755 --- a/tests/test-history.sh +++ b/tests/test-history.sh @@ -24,8 +24,6 @@ if ! journalctl --user --since="${HISTORY_START_TIME}" | grep -q "${MESSAGE}"; t skip "Cannot read back from Journal with journalctl" fi -plan_tests 1 - mkdir -p ${TEST_DATA_DIR}/system-history-installation mkdir -p ${FLATPAK_CONFIG_DIR}/installations.d cat << EOF > ${FLATPAK_CONFIG_DIR}/installations.d/history-installation.conf diff --git a/tests/test-http-utils.sh b/tests/test-http-utils.sh index 76ee6d378..e2eda7206 100755 --- a/tests/test-http-utils.sh +++ b/tests/test-http-utils.sh @@ -65,8 +65,6 @@ have_xattrs() { setfattr -n user.testvalue -v somevalue $1/test-xattrs > /dev/null 2>&1 } -plan_tests 6 - # Without anything else, cached for 30 minutes assert_ok "/" $test_tmpdir/output assert_cached "/" $test_tmpdir/output diff --git a/tests/test-info.sh b/tests/test-info.sh index c5e6e6395..35b8cee6d 100644 --- a/tests/test-info.sh +++ b/tests/test-info.sh @@ -6,8 +6,6 @@ set -euo pipefail skip_revokefs_without_fuse -plan_tests 9 - INCLUDE_SPECIAL_CHARACTER=1 setup_repo install_repo diff --git a/tests/test-metadata-validation.sh b/tests/test-metadata-validation.sh index 2e9f11dc0..95ecf4f66 100755 --- a/tests/test-metadata-validation.sh +++ b/tests/test-metadata-validation.sh @@ -8,8 +8,6 @@ set -euo pipefail . $(dirname $0)/libtest.sh -plan_tests 7 - setup_repo COUNTER=1 diff --git a/tests/test-metainfo-export.sh b/tests/test-metainfo-export.sh index b7e0b3de7..1ea2cb042 100755 --- a/tests/test-metainfo-export.sh +++ b/tests/test-metainfo-export.sh @@ -21,8 +21,6 @@ set -euo pipefail source "$(dirname "$0")/libtest.sh" -plan_tests 2 - setup_repo install_repo diff --git a/tests/test-oci-auth.sh b/tests/test-oci-auth.sh index 7b72dd42d..d78adaa87 100755 --- a/tests/test-oci-auth.sh +++ b/tests/test-oci-auth.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap -plan_tests 1 - # Start the fake OCI registry server httpd oci-registry-server.py --dir=. diff --git a/tests/test-oci-registry.sh b/tests/test-oci-registry.sh index b56951c7f..3805e90bf 100755 --- a/tests/test-oci-registry.sh +++ b/tests/test-oci-registry.sh @@ -23,8 +23,6 @@ set -euo pipefail skip_without_bwrap -plan_tests 18 - # Start the fake registry server if [ x${USE_HTTPS} = xyes ] ; then diff --git a/tests/test-oci.sh b/tests/test-oci.sh index 1e82875c9..30fbf1db8 100755 --- a/tests/test-oci.sh +++ b/tests/test-oci.sh @@ -23,8 +23,6 @@ set -euo pipefail skip_without_bwrap -plan_tests 4 - setup_repo_no_add oci mkdir -p oci diff --git a/tests/test-override.sh b/tests/test-override.sh index 34a9a9f08..554cfb903 100755 --- a/tests/test-override.sh +++ b/tests/test-override.sh @@ -17,8 +17,6 @@ reset_overrides () { assert_file_empty info } -plan_tests 20 - setup_repo install_repo diff --git a/tests/test-preinstall.sh b/tests/test-preinstall.sh index c97da4579..161394331 100755 --- a/tests/test-preinstall.sh +++ b/tests/test-preinstall.sh @@ -82,8 +82,6 @@ setup_repo test2 make_updated_app test2 org.test.Collection.test2 master HELLO2_MASTER_C2 org.test.Hello2 make_updated_app test2 org.test.Collection.test2 master HELLO2_MASTER_C3 org.test.Hello3 -plan_tests 12 - # just checking that the test remote got added port=$(cat httpd-port) assert_remote_has_config test-repo url "http://127.0.0.1:${port}/test" diff --git a/tests/test-prune.sh b/tests/test-prune.sh index 0b3bf23b2..304bfe7b3 100755 --- a/tests/test-prune.sh +++ b/tests/test-prune.sh @@ -21,8 +21,6 @@ set -euo pipefail . $(dirname $0)/libtest.sh -plan_tests 5 - create_commit() { # Wrap this to avoid set -x showing the commands { { local BASH_XTRACEFD=3; } 2> /dev/null diff --git a/tests/test-repair.sh b/tests/test-repair.sh index 7f5b961cf..3d8fca590 100755 --- a/tests/test-repair.sh +++ b/tests/test-repair.sh @@ -8,8 +8,6 @@ set -euo pipefail . $(dirname $0)/libtest.sh -plan_tests 2 - setup_repo ${FLATPAK} ${U} install -y test-repo org.test.Hello >&2 diff --git a/tests/test-repo.sh b/tests/test-repo.sh index 1487387cd..bdb1b78ce 100644 --- a/tests/test-repo.sh +++ b/tests/test-repo.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 47 - #Regular repo setup_repo diff --git a/tests/test-run-custom.sh b/tests/test-run-custom.sh index 4077b96c8..a6d726cf2 100755 --- a/tests/test-run-custom.sh +++ b/tests/test-run-custom.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 12 - # Use stable rather than master as the branch so we can test that the run # command automatically finds the branch correctly setup_repo "" "" stable diff --git a/tests/test-run.sh b/tests/test-run.sh index e24a6d434..705329ebc 100644 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 32 - # Use stable rather than master as the branch so we can test that the run # command automatically finds the branch correctly setup_repo "" "" stable diff --git a/tests/test-seccomp.sh b/tests/test-seccomp.sh index 32e792b3c..68d4d2e19 100755 --- a/tests/test-seccomp.sh +++ b/tests/test-seccomp.sh @@ -9,8 +9,6 @@ set -euo pipefail skip_without_seccomp skip_without_bwrap -plan_tests 18 - setup_repo install_repo diff --git a/tests/test-sideload.sh b/tests/test-sideload.sh index 6ca6968f4..2f03512b0 100644 --- a/tests/test-sideload.sh +++ b/tests/test-sideload.sh @@ -27,8 +27,6 @@ USE_COLLECTIONS_IN_CLIENT=yes skip_without_bwrap skip_revokefs_without_fuse -plan_tests 9 - #Regular repo setup_repo diff --git a/tests/test-subset.sh b/tests/test-subset.sh index cb375d6cd..4f3b2f2cf 100644 --- a/tests/test-subset.sh +++ b/tests/test-subset.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 3 - EXPORT_ARGS="--subset=subset1 --subset=subset2" setup_repo $FLATPAK repo repos/test > repo-info.txt diff --git a/tests/test-summaries.sh b/tests/test-summaries.sh index cdfab31f7..93f9e904a 100755 --- a/tests/test-summaries.sh +++ b/tests/test-summaries.sh @@ -21,8 +21,6 @@ set -euo pipefail . $(dirname $0)/libtest.sh -plan_tests 2 - setup_repo sha256() { diff --git a/tests/test-unused.sh b/tests/test-unused.sh index 28c41b1f9..39ce12240 100755 --- a/tests/test-unused.sh +++ b/tests/test-unused.sh @@ -27,8 +27,6 @@ export USE_SYSTEMDIR=yes skip_without_bwrap skip_revokefs_without_fuse -plan_tests 3 - setup_empty_repo &> /dev/null # Manually add the user remote too diff --git a/tests/test-update-portal.sh b/tests/test-update-portal.sh index 86f8e1ab8..9c747541f 100755 --- a/tests/test-update-portal.sh +++ b/tests/test-update-portal.sh @@ -24,8 +24,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 6 - setup_repo install_repo diff --git a/tests/test-update-remote-configuration.sh b/tests/test-update-remote-configuration.sh index b476dcd23..c9f72607f 100755 --- a/tests/test-update-remote-configuration.sh +++ b/tests/test-update-remote-configuration.sh @@ -27,8 +27,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 3 - # Configure a repository without a collection ID and pull it locally. setup_repo install_repo diff --git a/tests/test-upgrade-from-header.sh b/tests/test-upgrade-from-header.sh index 91256cdf9..67834fd22 100755 --- a/tests/test-upgrade-from-header.sh +++ b/tests/test-upgrade-from-header.sh @@ -7,8 +7,6 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -plan_tests 6 - # Override the httpd function to enable header logging before setup_repo calls # it. The web-server.py will log Flatpak-Ref and Flatpak-Upgrade-From headers # to httpd-headers-log.