-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Rule based auto-tagging] Add autotagging rule integration tests #18550
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18550 +/- ##
============================================
+ Coverage 72.88% 72.91% +0.03%
+ Complexity 69841 69824 -17
============================================
Files 5673 5673
Lines 320756 320754 -2
Branches 46370 46367 -3
============================================
+ Hits 233796 233893 +97
+ Misses 68102 67918 -184
- Partials 18858 18943 +85 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks @Lindsay-00 for the tests! For this feature we need integration tests (IT) to verify the end-to-end behavior across the system. However, the current code seems more on the UT side. Quick recap: Unit Test (UT) vs. Integration Test (IT) That being said, the current test class is extending a unit test base class ( Ideally each test should include
Let me know if you have any questions. Thanks! |
|
❌ Gradle check result for 99d3554: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
|
❌ Gradle check result for 17a3568: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
|
❌ Gradle check result for f331044: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
|
❌ Gradle check result for 650ea46: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add tests to verify the actual 'tagging' part? As mentioned before, IT is end-to-end testing, so we should have tests that include the complete flow: from creating the rule, to running the query, to verifying whether the query has been tagged with the group ID.
...load-management/src/internalClusterTest/java/org/opensearch/plugin/wlm/WlmAutoTaggingIT.java
Outdated
Show resolved
Hide resolved
...load-management/src/internalClusterTest/java/org/opensearch/plugin/wlm/WlmAutoTaggingIT.java
Outdated
Show resolved
Hide resolved
...load-management/src/internalClusterTest/java/org/opensearch/plugin/wlm/WlmAutoTaggingIT.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
|
❌ Gradle check result for f09deac: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
|
❌ Gradle check result for b46987f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Lingxi Chen <lingxich@amazon.com>
|
❌ Gradle check result for 5f5ee47: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Gradle failure looks unrelated: have retried the gradle check |
|
❌ Gradle check result for 5f5ee47: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Same test still failing: @Lindsay-00 - can you try merging from |
…nsearch-project#18550) --------- Signed-off-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Lindsay-00 <54655271+Lindsay-00@users.noreply.github.com> Co-authored-by: Lingxi Chen <lingxich@amazon.com>
…nsearch-project#18550) --------- Signed-off-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Lindsay-00 <54655271+Lindsay-00@users.noreply.github.com> Co-authored-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Ankit Jain <jainankitk@apache.org>
…nsearch-project#18550) --------- Signed-off-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Lindsay-00 <54655271+Lindsay-00@users.noreply.github.com> Co-authored-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Ankit Jain <jainankitk@apache.org>
…nsearch-project#18550) --------- Signed-off-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Lindsay-00 <54655271+Lindsay-00@users.noreply.github.com> Co-authored-by: Lingxi Chen <lingxich@amazon.com>
…nsearch-project#18550) --------- Signed-off-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Lindsay-00 <54655271+Lindsay-00@users.noreply.github.com> Co-authored-by: Lingxi Chen <lingxich@amazon.com>
| createRule(ruleId, "initial non-matching rule", "random", featureType, workloadGroupId); | ||
|
|
||
| // Wait for rule to be available | ||
| Thread.sleep(5500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please try to avoid using Thread.sleep at all costs? Wait for a condition to be met and proceed otherwise fail the test after some timeout if the condition is not met.
…sts (opensearch-project#18550)" This reverts commit 4b9aa27.
…sts (opensearch-project#18550)" This reverts commit 4b9aa27. Signed-off-by: Andrew Ross <andrross@amazon.com>
…sts (opensearch-project#18550)" This reverts commit 4b9aa27. Signed-off-by: Andrew Ross <andrross@amazon.com>
…nsearch-project#18550) --------- Signed-off-by: Lingxi Chen <lingxich@amazon.com> Signed-off-by: Lindsay-00 <54655271+Lindsay-00@users.noreply.github.com> Co-authored-by: Lingxi Chen <lingxich@amazon.com>
Description
Add Integration Tests for workload management rule based autotagging.
This IT can be run using
./gradlew :plugins:workload-management:internalClusterTest --tests "org.opensearch.plugin.wlm.WlmAutoTaggingIT"Tests include:
testExactIndexMatchTriggersTagging
Verifies that a rule with an exact index match correctly triggers tagging when a search query is run on that index.
testWildcardBasedAttributesAreTagged
Ensures that rules using wildcard index patterns (e.g., logs-*) successfully apply tagging when matching queries are executed.
testMultipleRulesDoNotInterfereWithEachOther
Confirms isolation between multiple auto-tagging rules and workload groups, ensuring that only the matching rule's completions increase.
testTaggingTriggeredAfterRuleUpdate
Verifies that tagging is correctly triggered after updating an existing rule to match a target index (transition from non-matching to matching).
Nonexistent Workload Group ID
Validates that creating a rule with a nonexistent workload group ID throws a validation exception.
Too Many Index Patterns
Ensures that a rule is rejected if more than 10 index patterns are provided for an attribute.
Empty Index Pattern Value
Confirms that an index pattern with an empty string is invalid.
Index Pattern Exceeding Max Length
Checks that index pattern values longer than 100 characters are not allowed.
Delete Rule with Nonexistent Rule ID
Verifies that trying to delete a rule that doesn’t exist fails with an appropriate error.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.