jakartaee / platform-tck

Jakartaee-tck
Other
124 stars 103 forks source link

The tckrefactor branch needs to include the test deployment descriptors in the test artifacts #1336

Open starksm64 opened 1 week ago

starksm64 commented 1 week ago

Is your feature request related to a problem? Please describe. The tckrefactor branch build artifacts for the tests do not include the deployment descriptors. For example, if I grep the jakarta.tck:ejb30 artifact for any ejb-jar.xml files, none are found, but the source tree contains over 200:

[starksm@scottryzen ejb30]$ jar -tf target/ejb30-11.0.0-SNAPSHOT.jar | grep ejb.jar.xml
[starksm@scottryzen ejb30]$ find . -name '*ejb-jar.xml'  | wc
    224     224   26585

Describe the solution you'd like We need to include the various descriptors included in the test artifacts into the over jakarta.tck artifact as they are needed by the generated Arquillian/Junit5 subclasses in the @Deployment methods. This can be done either by including them with a custom resource plugin configuration or moving them to a standard src/main/resources location. I think the former is easier, but have to verify the configuration.

Additional context The current work to automate the generation of the Arquillian/Junit5 rewrite needs access to the deployment descriptors in the deployment method.

scottmarlow commented 1 week ago

In my local rewritejpa branch (based on tckrefactor), in the platformtck/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/packaging/ejb/descriptor folder, I do see a jpa_ee_packaging_ejb_descriptor_ejb.jar.sun-ejb-jar.xml that isn't in the related EE 10 Platform TCK test archives as described in this issue.

We need to include the various descriptors included in the test artifacts into the over jakarta.tck artifact as they are needed by the generated Arquillian/Junit5 subclasses in the @deployment methods. This can be done either by including them with a custom resource plugin configuration or moving them to a standard src/main/resources location. I think the former is easier, but have to verify the configuration.

Since the ejb-jar.xml files are included in the EE 11 tckrefactor branch, I wonder how we should map them to the EE 11 platform tck shrinkwrap code exactly. I can imagine that we can scan for the ejb-jar.xml files but we need to know which parts of the ear/war test deployments to add them to.

scottmarlow commented 1 week ago

Perhaps we could use the build.xml scanning to determine the mapping of the *ejb-jar.xml files.

scottmarlow commented 1 week ago

Perhaps we could use the build.xml scanning to determine the mapping of the *ejb-jar.xml files.

I can also add a change to https://github.com/eclipse-ee4j/jakartaee-tck-tools/pull/36 that adds a // TODO: https://github.com/jakartaee/platform-tck/issues/1336 need to add *ejb-jar.xml to different parts of deployment ... comment to generated EEClient.java files for any scanned *ejb-jar.xml file that we notice in the (main) test class source folder that we are processing.

Then we can handle this issue with a different Open Rewrite recipe that either scans the ant build.xml scripts or perhaps running the involved (200+) tests with instrumentation that shows (or saves) the actual contents of the run test archives and uses the output to update the EE 11 EEClient tests to add the *ejb-jar.xml files to right parts of the ear/wars.