Skip to content

Conversation

@jdconrad
Copy link
Contributor

@jdconrad jdconrad commented May 29, 2025

This loads the appropriate information required for entitlements in unit tests and then creates a function that can take in a Class<?> and return a PolicyScope.

This is still a WIP and needs the following:

  1. Load the server policy
  2. Look at the plugin descriptor file to see if we are modular or should use unnamed
  3. Instantiate the entitlement agent with the appropriate arguments
  4. Annotation or setting to disable entitlements in unit tests

Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing is already done in ttps://github.com/elastic/elasticsearch/blob/main/test/framework/src/main/java/org/elasticsearch/bootstrap/TestBuildInfoParser.java. See #127719

I would suggest to keep parsing separate, in TestEntitlementInitialization, like in #127814, and call that in BootstrapForTesting.

My idea was then to use it in TestEntitlementInitialization, and call that from BootstrapForTesting. See #127814. I'm open to moving that to BootstrapForTesting (which likely means getting rid of TestEntitlementInitialization), but having a separate class parallel to EntitlementInitialization makes it cleaner IMO.

@jdconrad
Copy link
Contributor Author

jdconrad commented May 29, 2025

I will close this based on @ldematte's feedback.

@jdconrad jdconrad closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants