Skip to content

fix(tests): Exclude VM scanning tests from general e2e test target#20746

Merged
vikin91 merged 1 commit into
masterfrom
piotr/ROX-29577-dont-run-vm-tests-on-nongroovy
May 21, 2026
Merged

fix(tests): Exclude VM scanning tests from general e2e test target#20746
vikin91 merged 1 commit into
masterfrom
piotr/ROX-29577-dont-run-vm-tests-on-nongroovy

Conversation

@vikin91

@vikin91 vikin91 commented May 21, 2026

Copy link
Copy Markdown
Contributor

Description

VM scanning tests had a //go:build test_e2e || test_e2e_vm constraint, which caused them to compile and execute under the general test_e2e tag used by gke-nongroovy-e2e-tests. That was not intended or planned.

Changed the build constraint on all 6 VM-scanning-specific test files to //go:build test_e2e_vm, so they are only compiled and run by the dedicated make vm-scanning-tests target.

Shared files (common.go, common_test.go, common_matchers.go) were left unchanged - they use a broader multi-tag constraint and serve non-VM tests.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Ran nongroovy tests in CI and made sure that no VM-related tests are executed:

  1. VM scanning tests - 55 tests passing
  2. Nongroovy e2e - No VM e2e tests executed. Only github.com/stackrox/rox/tests/vmhelpers: TestPlaceholder which is a unit test that covers the helpers of the vm e2e tests. Currently, there is only a placeholder, but more will be added in ROX-29577: Add VM scanning scan and rescan pipeline validation #20128, ROX-29577: Add VM scanning pipeline metrics assertions #20129, and ROX-29577: Preflight vmhelper unit tests #20402

Ergo: only the unit-test github.com/stackrox/rox/tests/vmhelpers: TestPlaceholder (duration 0s) is executed in both targets. I will tackle that issue and make it run only once in a followup (provided the green CI).

@vikin91 vikin91 requested review from a team and davdhacs May 21, 2026 09:16
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 9b92acc. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-1102-g9b92accd27

@vikin91

vikin91 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

/test ocp-4-21-vm-scanning-e2e-tests

The test_e2e build tag caused VM scanning tests to compile and run
in gke-nongroovy-e2e-tests, which was not intended or planned.
Restrict to test_e2e_vm so only the dedicated vm-scanning-tests
Makefile target picks them up.
@vikin91

vikin91 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

@vikin91 vikin91 force-pushed the piotr/ROX-29577-dont-run-vm-tests-on-nongroovy branch from 38ec455 to 3bebb24 Compare May 21, 2026 09:56
@vikin91

vikin91 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

/test ocp-4-21-nongroovy-e2e-tests

@vikin91

vikin91 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

/test ocp-4-21-vm-scanning-e2e-tests

@vikin91 vikin91 merged commit 9b92acc into master May 21, 2026
158 of 182 checks passed
@vikin91 vikin91 deleted the piotr/ROX-29577-dont-run-vm-tests-on-nongroovy branch May 21, 2026 14:16
@vikin91 vikin91 added the backport release-4.11 Create a PR to backport this PR to release-4.11 label May 21, 2026
@rhacs-bot

Copy link
Copy Markdown
Contributor

The backport to release-4.11 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-4.11 release-4.11
# Navigate to the new working tree
cd .worktrees/backport-release-4.11
# Create a new branch
git switch --create backport-20746-to-release-4.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9b92accd2782a9fa4f35c86f2ba297aa20997d88
# Push it to GitHub
git push --set-upstream origin backport-20746-to-release-4.11
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-4.11

Then, create a pull request where the base branch is release-4.11 and the compare/head branch is backport-20746-to-release-4.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release-4.11 Create a PR to backport this PR to release-4.11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants