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

Run Rest Integ Tests with the Security plugin installed #645

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jun 27, 2024

Description

Opening up a Draft PR to start soliciting feedback. The goal of this PR is to run integ tests in this repo with the security plugin installed. This PR is a step towards being able to add tests for #347.

With the change in this PR you can run the sample-extension-plugin with security using ./gradlew :opensearch-job-scheduler-sample-extension:run -Dsecurity=true -Dhttps=true -Dtests.opensearch.username=admin -Dtests.opensearch.password=admin -x integTest

And run integTest with security like:

./gradlew :opensearch-job-scheduler-sample-extension:integTest -Dsecurity=true -Dhttps=true -Dtests.opensearch.username=admin -Dtests.opensearch.password=admin -Duser=admin -Dpassword=admin -Dtests.opensearch.secure=true -i --tests "*RestIT"

Example response to CAT plugins

> curl -XGET https://admin:admin@localhost:9200/_cat/plugins -k
integTest-0 opensearch-job-scheduler                  3.0.0.0-SNAPSHOT
integTest-0 opensearch-job-scheduler-sample-extension 3.0.0.0-SNAPSHOT
integTest-0 opensearch-security                       3.0.0.0-SNAPSHOT

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

@cwperks
Copy link
Member Author

cwperks commented Aug 23, 2024

@prudhvigodithi I switched this to ready for review to start soliciting feedback, but I am still working on a change to remove duplication between the SPI and the sample-extension-plugin which both perform integ tests and have some classes in common. I was able to create a separate sourceSet with common test classes, but had some trouble bundling the resources like the certificates.

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.67%. Comparing base (6e3e68a) to head (461b8c7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #645   +/-   ##
=========================================
  Coverage     37.67%   37.67%           
  Complexity      135      135           
=========================================
  Files            22       22           
  Lines          1189     1189           
  Branches        109      109           
=========================================
  Hits            448      448           
  Misses          704      704           
  Partials         37       37           

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant