From dec373595eb3ff4ec875c58c8318752efc1bbfa2 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:12:46 -0400 Subject: [PATCH] Adjusting TESTING.md for a single test run (#14441) (#14490) * Adjusting TESTING.md for a single test run * Adjusting TESTING.md for a single test run * Update TESTING.md * Adjusting TESTING.md for a single test run * Adjusting TESTING.md for a single test run --------- (cherry picked from commit 3106ea5d83eff5f7f6ee9565147eba0bd4cad34c) Signed-off-by: Daniil Roman Signed-off-by: Daniil Roman Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Andriy Redko Signed-off-by: kkewwei --- TESTING.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/TESTING.md b/TESTING.md index 7d4c0ee60adb2..44fcaaf660838 100644 --- a/TESTING.md +++ b/TESTING.md @@ -90,21 +90,23 @@ This will instruct all JVMs (including any that run cli tools such as creating t ## Test case filtering -- `tests.class` is a class-filtering shell-like glob pattern -- `tests.method` is a method-filtering glob pattern. +To be able to run a single test you need to specify the module where you're running the tests from. + +Example: `./gradlew server:test --tests "*.ReplicaShardBatchAllocatorTests.testNoAsyncFetchData"` Run a single test case (variants) - ./gradlew test -Dtests.class=org.opensearch.package.ClassName - ./gradlew test "-Dtests.class=*.ClassName" + ./gradlew module:test --tests org.opensearch.package.ClassName + ./gradlew module:test --tests org.opensearch.package.ClassName.testName + ./gradlew module:test --tests "*.ClassName" Run all tests in a package and its sub-packages - ./gradlew test "-Dtests.class=org.opensearch.package.*" + ./gradlew module:test --tests "org.opensearch.package.*" Run any test methods that contain *esi* (e.g.: .r*esi*ze.) - ./gradlew test "-Dtests.method=*esi*" + ./gradlew module:test --tests "*esi*" Run all tests that are waiting for a bugfix (disabled by default)