mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-28 02:20:18 -04:00
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 <smcv@collabora.com>
This commit is contained in:
1 parent
f7a88aca00
commit
eb240aa067
33 files changed
-66
No files matched your search
@@ -22,8 +22,6 @@ set -euo pipefail
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
|
||||
plan_tests 4
|
||||
|
||||
setup_repo
|
||||
|
||||
commit_to_obj () {
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,8 +24,6 @@ set -euo pipefail
|
||||
skip_without_bwrap
|
||||
skip_revokefs_without_fuse
|
||||
|
||||
plan_tests 9
|
||||
|
||||
mkdir bundles
|
||||
|
||||
setup_repo
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,8 +23,6 @@ set -euo pipefail
|
||||
|
||||
skip_without_bwrap
|
||||
|
||||
plan_tests 2
|
||||
|
||||
make_extension () {
|
||||
local ID=$1
|
||||
local VERSION=$2
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,8 +6,6 @@ set -euo pipefail
|
||||
|
||||
skip_revokefs_without_fuse
|
||||
|
||||
plan_tests 9
|
||||
|
||||
INCLUDE_SPECIAL_CHARACTER=1 setup_repo
|
||||
install_repo
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ set -euo pipefail
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
plan_tests 7
|
||||
|
||||
setup_repo
|
||||
|
||||
COUNTER=1
|
||||
|
||||
@@ -21,8 +21,6 @@ set -euo pipefail
|
||||
|
||||
source "$(dirname "$0")/libtest.sh"
|
||||
|
||||
plan_tests 2
|
||||
|
||||
setup_repo
|
||||
install_repo
|
||||
|
||||
|
||||
@@ -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=.
|
||||
|
||||
@@ -23,8 +23,6 @@ set -euo pipefail
|
||||
|
||||
skip_without_bwrap
|
||||
|
||||
plan_tests 18
|
||||
|
||||
# Start the fake registry server
|
||||
|
||||
if [ x${USE_HTTPS} = xyes ] ; then
|
||||
|
||||
@@ -23,8 +23,6 @@ set -euo pipefail
|
||||
|
||||
skip_without_bwrap
|
||||
|
||||
plan_tests 4
|
||||
|
||||
setup_repo_no_add oci
|
||||
|
||||
mkdir -p oci
|
||||
|
||||
@@ -17,8 +17,6 @@ reset_overrides () {
|
||||
assert_file_empty info
|
||||
}
|
||||
|
||||
plan_tests 20
|
||||
|
||||
setup_repo
|
||||
install_repo
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ set -euo pipefail
|
||||
skip_without_bwrap
|
||||
skip_revokefs_without_fuse
|
||||
|
||||
plan_tests 47
|
||||
|
||||
#Regular repo
|
||||
setup_repo
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,8 +9,6 @@ set -euo pipefail
|
||||
skip_without_seccomp
|
||||
skip_without_bwrap
|
||||
|
||||
plan_tests 18
|
||||
|
||||
setup_repo
|
||||
install_repo
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ USE_COLLECTIONS_IN_CLIENT=yes
|
||||
skip_without_bwrap
|
||||
skip_revokefs_without_fuse
|
||||
|
||||
plan_tests 9
|
||||
|
||||
#Regular repo
|
||||
setup_repo
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -21,8 +21,6 @@ set -euo pipefail
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
plan_tests 2
|
||||
|
||||
setup_repo
|
||||
|
||||
sha256() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,8 +24,6 @@ set -euo pipefail
|
||||
skip_without_bwrap
|
||||
skip_revokefs_without_fuse
|
||||
|
||||
plan_tests 6
|
||||
|
||||
setup_repo
|
||||
install_repo
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user