From 656eba1eb38544dfc63a845be3789332823c2783 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 29 May 2024 08:07:16 -0600 Subject: [PATCH 1/4] bats tests - parallelize All bats tests run with custom root/runroot, so it should be possible to parallelize them. Signed-off-by: Ed Santiago --- tests/source.bats | 2 -- tests/test_runner.sh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/source.bats b/tests/source.bats index 6d120578387..3ae945d1992 100644 --- a/tests/source.bats +++ b/tests/source.bats @@ -152,6 +152,4 @@ load helpers run diff -r $srcdir $pulldir # FIXME: if there's a nonzero chance of this failing, include actual diffs assert "$status" -eq 0 "status from diff of srcdir vs pulldir" - - stop_registry } diff --git a/tests/test_runner.sh b/tests/test_runner.sh index 8f89e73c716..12b8242bc44 100755 --- a/tests/test_runner.sh +++ b/tests/test_runner.sh @@ -13,4 +13,4 @@ function execute() { } # Run the tests. -execute time bats --tap "${@:-.}" +execute time bats -j 4 --tap "${@:-.}" From d4c48a95715f7ac1420d0e26134063814b94ffb2 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 19 Jun 2024 08:20:33 -0600 Subject: [PATCH 2/4] cleanup, debug, and disable parallel in blobcache tests Signed-off-by: Ed Santiago --- tests/blobcache.bats | 6 ++++++ tests/mkcw.bats | 1 + 2 files changed, 7 insertions(+) diff --git a/tests/blobcache.bats b/tests/blobcache.bats index 8db640b28f4..a5f08a227bc 100644 --- a/tests/blobcache.bats +++ b/tests/blobcache.bats @@ -2,6 +2,12 @@ load helpers +# The 'rm cachefile' in the "blobs must be reused" test +# causes flakes when parallelizing +function setup_file() { + export BATS_NO_PARALLELIZE_WITHIN_FILE=true +} + @test "blobcache-pull" { blobcachedir=${TEST_SCRATCH_DIR}/cache mkdir -p ${blobcachedir} diff --git a/tests/mkcw.bats b/tests/mkcw.bats index ed2b47a2cba..5fdd660f7e7 100644 --- a/tests/mkcw.bats +++ b/tests/mkcw.bats @@ -22,6 +22,7 @@ function mkcw_check_image() { # Decrypt, mount, and take a look around. uuid=$(cryptsetup luksUUID "$mountpoint"/disk.img) + echo "# uuid=$uuid" >&3 cryptsetup luksOpen --key-file "$TEST_SCRATCH_DIR"/key "$mountpoint"/disk.img "$uuid" mkdir -p "$TEST_SCRATCH_DIR"/mount mount /dev/mapper/"$uuid" "$TEST_SCRATCH_DIR"/mount From 62547554d31ed7dac6a9f6e04527d52aaa434a24 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 28 Oct 2024 10:25:07 -0600 Subject: [PATCH 3/4] bump CI VMs to 4 CPUs (was: 2) for integration tests Signed-off-by: Ed Santiago --- .cirrus.yml | 2 ++ tests/test_runner.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5ac4bd8b717..19dfa3a46d0 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -235,6 +235,7 @@ integration_task: gce_instance: image_name: "$IMAGE_NAME" + cpu: 4 # Separate scripts for separate outputs, makes debugging easier. setup_script: '${SCRIPT_BASE}/setup.sh |& ${_TIMESTAMP}' @@ -282,6 +283,7 @@ integration_rootless_task: gce_instance: image_name: "$IMAGE_NAME" + cpu: 4 # Separate scripts for separate outputs, makes debugging easier. setup_script: '${SCRIPT_BASE}/setup.sh |& ${_TIMESTAMP}' diff --git a/tests/test_runner.sh b/tests/test_runner.sh index 12b8242bc44..76de466e0c3 100755 --- a/tests/test_runner.sh +++ b/tests/test_runner.sh @@ -13,4 +13,4 @@ function execute() { } # Run the tests. -execute time bats -j 4 --tap "${@:-.}" +execute time bats -j $(nproc) --tap "${@:-.}" From b380e9aea691941521898d35070e48faa5db17f6 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 7 Nov 2024 06:24:34 -0700 Subject: [PATCH 4/4] TEMPORARY: push zstd with log-level=debug Signed-off-by: Ed Santiago --- tests/bud.bats | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bud.bats b/tests/bud.bats index c9671fc8efd..f01a6e2fd81 100644 --- a/tests/bud.bats +++ b/tests/bud.bats @@ -165,6 +165,7 @@ _EOF # Helper function. push our image with the given options, and run skopeo inspect function _test_buildah_push() { run_buildah push \ + --log-level=debug \ $WITH_POLICY_JSON \ --authfile ${TEST_SCRATCH_DIR}/test.auth \ --tls-verify=false \