Skip to content
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

Use testclusters when testing with security #1414

Merged
merged 12 commits into from
Mar 18, 2025

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Feb 4, 2025

Description

This PR changes the Test with Security workflow to use testclusters instead of the docker image. The integTest task in OpenSearch is meant to be run against an opensearch testcluster (example from ISM) and the current workflow ends up spinning up 2 clusters (one testcluster and 1 cluster w/ docker) unnecessarily.

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • 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.

Sorry, something went wrong.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@opensearch-trigger-bot opensearch-trigger-bot bot added infra Changes to infrastructure, testing, CI/CD, pipelines, etc. backport 2.x labels Feb 4, 2025
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.61%. Comparing base (41db8c0) to head (101f702).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1414      +/-   ##
============================================
- Coverage     81.62%   81.61%   -0.01%     
+ Complexity     5870     5864       -6     
============================================
  Files           533      533              
  Lines         23669    23669              
  Branches       2374     2374              
============================================
- Hits          19319    19317       -2     
- Misses         3190     3193       +3     
+ Partials       1160     1159       -1     
Flag Coverage Δ
plugin 81.61% <ø> (∅)

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

see 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@amitgalitz
Copy link
Member

amitgalitz commented Mar 17, 2025

Thanks for adding this, it can be done in a follow up PR as well but could you also add a link in our developer guide (https://github.com/opensearch-project/anomaly-detection/blob/main/DEVELOPER_GUIDE.md) that we a can now run integTest with -Dsecurity.enabled=true I assume we can also now run ./gradlew run -Dsecurity.enabled=true to run the cluster with security enabled locally?

cwperks added 2 commits March 18, 2025 09:56
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks
Copy link
Member Author

cwperks commented Mar 18, 2025

Added a new entry to the developer guide on how to run integ tests with security.

I assume we can also now run ./gradlew run -Dsecurity.enabled=true to run the cluster with security enabled locally?

Not with this change. This is only for setting up a testcluster for the integTest task. It should be possible to get this to work, but not with the changes in this PR.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@kaituo kaituo merged commit 03637f1 into opensearch-project:main Mar 18, 2025
25 checks passed
@opensearch-trigger-bot
Copy link

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/anomaly-detection/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/anomaly-detection/backport-2.x
# Create a new branch
git switch --create backport/backport-1414-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 03637f1534cea3fa2a6f665fb35cf7b7e52c0e32
# Push it to GitHub
git push --set-upstream origin backport/backport-1414-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/anomaly-detection/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1414-to-2.x.

amitgalitz pushed a commit to amitgalitz/anomaly-detection-1 that referenced this pull request Mar 20, 2025
* Use testclusters when testing with security

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add download plugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Get js and security plugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add opensearchPlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove duplicate

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Wait for yellow

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix bwc test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add prepareBwcTests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to developer guide

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport-failed infra Changes to infrastructure, testing, CI/CD, pipelines, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants