chore: allow devs to run locally a subset of e2e tests (#25514)

Signed-off-by: Patroklos Papapetrou <ppapapetrou76@gmail.com>
This commit is contained in:
Papapetrou Patroklos 2025-12-08 10:00:38 +02:00 committed by GitHub
parent 3bf3d8a212
commit a48b381d3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View file

@ -72,7 +72,10 @@ The final step is running the End-to-End testsuite, which ensures that your Kube
* First, start the End-to-End server: `make start-e2e` or `make start-e2e-local`. This will spawn a number of processes and services on your system.
* When all components have started, run `make test-e2e` or `make test-e2e-local` to run the end-to-end tests against your local services.
To run a single test with a local toolchain, you can use `TEST_FLAGS="-run TestName" make test-e2e-local`.
Below you can find a few examples of how to run specific tests.
- To run a single test with a local toolchain, you can use `TEST_FLAGS="-run TestName" make test-e2e-local`.
- To run a specific package, you can use `make TEST_MODULE=./test/e2e/<TEST_FILE>.go test-e2e-local`
- Finally, you can also try `make TEST_FLAGS="-run <TEST_METHOD_NAME_REGEXP>" test-e2e-local` if you want a more fine-grained control.
For more information about End-to-End tests, refer to the [End-to-End test documentation](test-e2e.md).

View file

@ -55,6 +55,14 @@ Some effort has been made to balance test isolation with speed. Tests are isolat
* A namespace `argocd-e2e-ns-${id}`.
* A primary name for the app `argocd-e2e-${id}`.
## Run only a subset of tests
Running all tests locally is a time-consuming process. To run only a subset of tests, you can set the `TEST_MODULE` environment variable.
For example, to run only the OCI tests, you can set the variable as follows: `make TEST_MODULE=./test/e2e/oci_test.go test-e2e-local`
If you want to get a more fine-grained control over which tests to run, you can also try `make TEST_FLAGS="-run <TEST_METHOD_NAME_REGEXP>" test-e2e-local`
For individual tests you can run them using the IDE run test feature
## Troubleshooting
**Tests fails to delete `argocd-e2e-ns-*` namespaces.**

View file

@ -24,4 +24,4 @@ mkdir -p "$TEST_RESULTS"
# shellcheck disable=SC2086
GODEBUG="tarinsecurepath=0,zipinsecurepath=0" \
gotestsum --rerun-fails-report=rerunreport.txt --junitfile="$TEST_RESULTS/junit.xml" --format=testname \
--rerun-fails="$RERUN_FAILS" --packages="$PACKAGES" -- -cover $TEST_FLAGS "$@"
--rerun-fails="$RERUN_FAILS" --packages="${TEST_MODULE:-$PACKAGES}" -- -cover $TEST_FLAGS "$@"