Skip to content

test(integ-test): gate time-bounds pruning ITs to the OpenSearch route and security plugin - #5785

Merged
mengweieric merged 1 commit into
opensearch-project:mainfrom
mengweieric:menwe/gate-time-bounds-pruning-its
Sep 18, 2026
Merged

mengweieric merged 1 commit into
opensearch-project:mainfrom
mengweieric:menwe/gate-time-bounds-pruning-its

Conversation

@mengweieric

@mengweieric mengweieric commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

CalciteTimeBoundsPruningIT and TimeBoundsPruningSecurityIT (added in #5766) run on every integTestRemote target today, but they are meant for specific clusters: the pruning is observable on the OpenSearch route only, and the security IT drives the security plugin's REST API. Against a remote cluster they were never meant for, both fail rather than skip:

Remote cluster CalciteTimeBoundsPruningIT TimeBoundsPruningSecurityIT
OpenSearch, no security plugin passes fails: PUT /_plugins/_security/api/roles/... has no handler (400)
OpenSearch + security plugin passes passes
analytics engine fails: the Field [...] not found. rejections are never raised fails (same setup failure as above)
analytics engine + security plugin fails (same) fails

This change gates both classes with the two mechanisms the suite already uses for exactly these two situations:

  • A new Capability.TIME_BOUNDS_PRUNING, with @RequiresCapability(TIME_BOUNDS_PRUNING) on both classes, so CapabilityRule skips them on the analytics-engine route. The javadoc records the observed gap: on that route a field mapped only in an out-of-range index still resolves and an index that does not map the time field is not dropped.
  • ClusterPlugins.requirePluginOrAssume(SECURITY_PLUGIN, ...) at the top of TimeBoundsPruningSecurityIT.init(), the same assumption PPLPermissionsIT, PartialResultSecurityIT and SQLCursorPermissionsIT carry, so the class skips where the security plugin is not installed.

Test-only change; no production code is touched.

Verification (integTestRemote --tests for the two classes, 15 test methods, against four remote 5-shard clusters running the plugin built from main at 12c26dccd):

Remote cluster Result
OpenSearch + security plugin 15 passed
OpenSearch, no security plugin 10 passed, 5 skipped (opensearch-security plugin not installed on test cluster)
analytics engine 15 skipped (TIME_BOUNDS_PRUNING: ...)
analytics engine + security plugin 15 skipped (TIME_BOUNDS_PRUNING: ...)

CalciteTimeBoundsPruningIT is also a member of the CalciteNoPushdownIT suite; the class-level annotation is read by the same CapabilityRule, as for the other gated members of that suite, but the suite run was not repeated separately for this change.

Related Issues

Follow-up to #5766. No linked issue: the failures were observed in remote-cluster runs that CI does not execute.

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

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.

…route and the security plugin

CalciteTimeBoundsPruningIT and TimeBoundsPruningSecurityIT (added in opensearch-project#5766) carried no gates, so integTestRemote failed them on clusters the tests were never meant for: the analytics-engine route does not observe the request-level pruning, and the security IT drives the security REST API, which does not exist without the plugin.

Add the TIME_BOUNDS_PRUNING capability and annotate both classes with @RequiresCapability so they skip on the analytics-engine route, and assume the security plugin in TimeBoundsPruningSecurityIT.init() exactly like the sibling security ITs. Verified against four remote clusters: OpenSearch + security passes both classes (15/15), OpenSearch without security passes the Calcite class and skips the security one, and both analytics-engine clusters skip both classes.

Signed-off-by: menwe <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Update skip message to match test purpose

The error message mentions "FGAC tests" but this test class is about time bounds
pruning with security. Update the message to accurately reflect the test's purpose
for better debugging clarity.

integ-test/src/test/java/org/opensearch/sql/security/TimeBoundsPruningSecurityIT.java [55-58]

 ClusterPlugins.requirePluginOrAssume(
     client(),
     ClusterPlugins.SECURITY_PLUGIN,
-    "opensearch-security plugin not installed on test cluster; skipping FGAC tests");
+    "opensearch-security plugin not installed on test cluster; skipping time bounds pruning security tests");
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that the error message "skipping FGAC tests" is misleading for a test class named TimeBoundsPruningSecurityIT. The improved message better reflects the actual test purpose, enhancing code clarity and maintainability.

Low

@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.24%. Comparing base (12c26dc) to head (38f9a9e).
⚠️ Report is 1 commits behind head on main.

❌ Your project check has failed because the head coverage (63.24%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5785   +/-   ##
=========================================
  Coverage     63.24%   63.24%           
  Complexity     8820     8820           
=========================================
  Files           938      938           
  Lines         40209    40209           
  Branches       4530     4530           
=========================================
  Hits          25432    25432           
  Misses        13955    13955           
  Partials        822      822           
Flag Coverage Δ
sql-engine 63.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mengweieric
mengweieric merged commit b9d8994 into opensearch-project:main Sep 18, 2026
65 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to improving software testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants