Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bats tests - parallelize #5552

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
path: ./bin/*


unit_task:

Check warning on line 151 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L151

task "Unit tests w/ vfs" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 151 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L151

task "Unit tests w/ vfs" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 151 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L151

task "Unit tests w/ overlay" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 151 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L151

task "Unit tests w/ overlay" depends on task "Cross Compile", but their only_if conditions are different
name: 'Unit tests w/ $STORAGE_DRIVER'
alias: unit
only_if: &not_build_docs >-
Expand All @@ -175,7 +175,7 @@
path: ./bin/*


conformance_task:

Check warning on line 178 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L178

task "Debian Conformance w/ vfs" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 178 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L178

task "Debian Conformance w/ vfs" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 178 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L178

task "Debian Conformance w/ overlay" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 178 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L178

task "Debian Conformance w/ overlay" depends on task "Cross Compile", but their only_if conditions are different
name: 'Debian Conformance w/ $STORAGE_DRIVER'
alias: conformance
only_if: *not_build_docs
Expand All @@ -197,7 +197,7 @@
conformance_test_script: '${SCRIPT_BASE}/test.sh conformance |& ${_TIMESTAMP}'


integration_task:

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration fedora-41 w/ vfs" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration fedora-41 w/ vfs" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration debian-13 w/ vfs" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration debian-13 w/ vfs" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration fedora-41 w/ overlay" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration fedora-41 w/ overlay" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration debian-13 w/ overlay" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 200 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L200

task "Integration debian-13 w/ overlay" depends on task "Cross Compile", but their only_if conditions are different
name: "Integration $DISTRO_NV w/ $STORAGE_DRIVER"
alias: integration
only_if: *not_build_docs
Expand Down Expand Up @@ -235,6 +235,7 @@

gce_instance:
image_name: "$IMAGE_NAME"
cpu: 4

# Separate scripts for separate outputs, makes debugging easier.
setup_script: '${SCRIPT_BASE}/setup.sh |& ${_TIMESTAMP}'
Expand All @@ -254,7 +255,7 @@
package_versions_script: '$GOSRC/$SCRIPT_BASE/logcollector.sh packages'
golang_version_script: '$GOSRC/$SCRIPT_BASE/logcollector.sh golang'

integration_rootless_task:

Check warning on line 258 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L258

task "Integration rootless fedora-41 w/ overlay" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 258 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L258

task "Integration rootless fedora-41 w/ overlay" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 258 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L258

task "Integration rootless debian-13 w/ overlay" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 258 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L258

task "Integration rootless debian-13 w/ overlay" depends on task "Cross Compile", but their only_if conditions are different
name: "Integration rootless $DISTRO_NV w/ $STORAGE_DRIVER"
alias: integration_rootless
only_if: *not_build_docs
Expand Down Expand Up @@ -282,6 +283,7 @@

gce_instance:
image_name: "$IMAGE_NAME"
cpu: 4

# Separate scripts for separate outputs, makes debugging easier.
setup_script: '${SCRIPT_BASE}/setup.sh |& ${_TIMESTAMP}'
Expand All @@ -294,7 +296,7 @@
always:
<<: *standardlogs

in_podman_task:

Check warning on line 299 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L299

task "Containerized Integration" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 299 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L299

task "Containerized Integration" depends on task "Cross Compile", but their only_if conditions are different
name: "Containerized Integration"
alias: in_podman
only_if: *not_build_docs
Expand All @@ -321,7 +323,7 @@
# Status aggregator for all tests. This task simply ensures a defined
# set of tasks all passed, and allows confirming that based on the status
# of this task.
success_task:

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Smoke Test", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Cross Compile", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Unit tests w/ vfs", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Unit tests w/ overlay", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Debian Conformance w/ vfs", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Debian Conformance w/ overlay", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Integration fedora-41 w/ vfs", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Integration debian-13 w/ vfs", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Integration fedora-41 w/ overlay", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Integration debian-13 w/ overlay", but their only_if conditions are different

Check warning on line 326 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L326

task "Total Success" depends on task "Containerized Integration", but their only_if conditions are different
# N/B: The prow merge-bot (tide) is sensitized to this exact name, DO NOT CHANGE IT.
# Ref: https://github.com/openshift/release/pull/48909
name: "Total Success"
Expand Down
6 changes: 6 additions & 0 deletions tests/blobcache.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions tests/bud.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXME! Remove this. It is only present in order to debug the zstd flake.

$WITH_POLICY_JSON \
--authfile ${TEST_SCRATCH_DIR}/test.auth \
--tls-verify=false \
Expand Down
1 change: 1 addition & 0 deletions tests/mkcw.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed either.

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
Expand Down
2 changes: 0 additions & 2 deletions tests/source.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion tests/test_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ function execute() {
}

# Run the tests.
execute time bats --tap "${@:-.}"
execute time bats -j $(nproc) --tap "${@:-.}"
Loading