opensearch-project / job-scheduler

Run periodic jobs on the cluster from your plugin
Apache License 2.0
21 stars 73 forks source link

Run Rest Integ Tests with the Security plugin installed #645

Open cwperks opened 2 months ago

cwperks commented 2 months ago

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 https://github.com/opensearch-project/job-scheduler/pull/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

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 commented 2 weeks ago

@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.