elasticsearch/server
Jack Conradson f7a7f0b923
Generate a test dependencies file to support unit tests in entitlements (#127486)
Generates a test file with the following information and format:

{
    "component": "<component name>",
    "locations": [
        {
            "representative_class": <class name with package>,
            "module": "<module name>"
        },
        ...
    ]
}

For painless:

{
    "component": "lang-painless",
    "locations": [
        {
            "representative_class": "org/objectweb/asm/tree/analysis/Analyzer.class",
            "module": "org.objectweb.asm.tree.analysis"
        },
        ...
    ]
}

Then it copies the following files into the jar for consumption by unit tests:

* META-INF/plugin-test-build-info.json
* META-INF/es-plugins/<plugin name>/plugin-descriptor.properties
* META-INF/es-plugins/<plugin name>/entitlement-policy.yaml

For server, the files in the jar become the following:

* META-INF/server-test-build-info.json

This should provide enough information for BootstrapForTesting to be 
able to build a mapping of caller class to policy file using the class file 
to look up the jar or directory within the class path and then associating 
that with it's specified module and finally using the specified module to 
look up the appropriate entitlement policy. 

caller class -> specified module -> entitlement policy


---------

Co-authored-by: Patrick Doyle <patrick.doyle@elastic.co>
2025-05-21 16:21:28 -07:00
..
licenses Remove JNA from server dependencies (#110809) 2024-07-16 11:28:58 +03:00
src transport: pass network channel exceptions to close listeners (#127895) 2025-05-21 12:04:45 -07:00
build.gradle Generate a test dependencies file to support unit tests in entitlements (#127486) 2025-05-21 16:21:28 -07:00