-
Notifications
You must be signed in to change notification settings - Fork 109
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
Standalone Persistence TCK runner inside Glassfish #1319
base: main
Are you sure you want to change the base?
Standalone Persistence TCK runner inside Glassfish #1319
Conversation
Still just the SE tests. Preparation for running tests in JakartaEE mode. Signed-off-by:Ondro Mihalyi <[email protected]>
Signed-off-by:Ondro Mihalyi <[email protected]>
- fixed CleanupArchiveProcessor to avoid ConcurrentModificationException - adjusted SigTest to include JDK classpath and impl classpath - fixed reference to moved class in a service loader file - added Junit reporter to log reported messages to server.log in GlassFish Signed-off-by:Ondro Mihalyi <[email protected]>
Signed-off-by:Ondro Mihalyi <[email protected]>
Signed-off-by:Ondro Mihalyi <[email protected]>
Sorting of modules is required by project
The build really wants the JDK to be explicitly set
try with 2048mb memory
Try 2048m for GF itself
4096 for gf
https://gist.github.com/scottmarlow/e06a0d0e3269464784926df90518785c shows the current output of the Open Rewrite conversion (using the EE 10 Platform TCK zip as a model of what to include in each deployment). We also need to take care to not update any Persistence Component TCK Client.java source that is already balloted for EE 11 so we don't have to repeat the Persistence 3.2 ballot (via a new release). We also need to figure out where we want to keep the EE 10 Platform TCK test sources due to ^ concern. We just added some initial code to read the test vehicles from the EE 10 Platform TCK src/vehicle.properties but a bit more is needed for that. We also need to generate code to deal with each vehicle from each test where there likely will be some common code for each vehicle. |
@OndroMih @scottmarlow Something is out of memory, but I'm not exactly sure what that something is and how to give it more memory. Any ideas? |
Just updating randomly, but doesn't seem to work
8GB client side
Running it locally, and it looks like the OOM happens on the junit/client side:
|
Hi @scottmarlow,
I think that this is exactly what the current OpenRewrite conversion does in this gist: https://gist.github.com/scottmarlow/e06a0d0e3269464784926df90518785c - it modifies the Client.java source. In this PR, I used a combination of Arquillian and JUnit extensions to deploy the test in a Jakarta EE container without modifying anything in the test sources. I think it's a better approach. The test stays agnostic to how it's executed, and different Jakarta EE implementations can modify the Arquillian deployment as they want, even use something else than Arquillian. |
We had a great conversation with @scottmarlow on Slack today, I copy it here: Ondro: I think that vehicles can be implemented as Arquillian protocols, so that Arquillian invokes the application deployed to the server in different ways, e.g. once through a servlet that injects @PersistenceContext, another time using a servlet that injects @PersistenceUnit, and another time even through a remote EJB. Scott Marlow: Ondro: Scott Marlow: Ondro: The best thing about it is that the whole solution is just an example. Any implementation can modify it or replace with their own solution. And there's no need to maintain anything in the TCK itself, just plain Java SE tests. Scott Marlow: For the open rewrite generated code approach, there would be less impact on the EE impls but that isn't entirely clear yet Ondro: In Batch TCK, we provide an example project that I think uses GlassFish as an example. It's just a matter of changing Arquillian configuration to deploy to another container. So, the runner is not part of the TCK itself, it's not required to use it, but we still provide an example so that implementors can take it and modify to their liking. In most cases, it's just configuring Arquillian to use a different container. Scott Marlow: Ondro: Scott Marlow: Ondro: Scott Marlow: Ondro: Scott Marlow: https://gist.githubusercontent.com/scottmarlow/e06a0d0e3269464784926df90518785c/raw/60d5cc20d3f948eedfea9061c9ea6b36eb1c2878/gistfile1.txt contains a sample of the generated shrinkwrap code |
@OndroMih What about merging this work anyway? Maybe changing the folder / artefact to "-se-in-ee" or something like that? This is still very valuable as a kind of smoke test to assert GF can run the basic Persistence tests. We do need to exclude the bean validation test though. |
Thanks for pasting the With the EE 10 Platform TCK, for each specific JPA SE TCK test (and some EE only tests), we run that test multiple times against the different test vehicles mentioned in https://github.com/jakartaee/platform-tck/blob/10.0.x/install/jakartaee/other/vehicle.properties#L105, each success/failure is counted separately. For EE 11, we (on Platform TCK team) discussed that we don't have enough time in the EE 11 schedule to manually make test changes and instead need automation. Still, we should compare this ^ approach versus the https://github.com/jakartaee/platform-tck/wiki/OpenRewrite:
|
I'm happy to keep this PR in draft and maybe never merge it. It's a demo of one of the approaches, especially for simple tests which don't require deployment in EAR. I created it only because there's no way to run EE 11 TCK against a Jakarta EE server yet as it's a work in progress. |
An improvement over #1317 to run the TCK tests deployed to a running GlassFish server.
All standalone tests pass except
createEntityManagerFactoryNoBeanValidatorTest
inse.entityManagerFactory.Client2
, which doesn't make sense in a Jakarta EE server because Validation provider is always present.Note that this still runs the tests in standalone mode. GlassFish should also run the tests in JakartaEE mode. This is also supported by this pull requests, it's enough to change the system property
platform.mode
in pom.xml from "standalone" to "jakartaEE". This will enable theJakartaEeExecutionInterceptor
, which will attempt to inject resources into the test. However, I don't know how these resources should be created - in JakartaEE mode, there are nopersistence.xml
files with JTA persistence units to initialize the resources.I will need some help to run the tests in "jakartaEE" mode, using all the supported test vehicles (https://github.com/jakartaee/platform-tck/tree/tckrefactor/common/src/main/java/com/sun/ts/tests/common/vehicle - only stateless3, stateful3, appmanaged, appmanagedNoTx, pmservlet, and puservlet are necessary for Persistence TCK). The built-in Arquillian protocol invokes the tests using a servlet. Different test vehicles might need to be implemented as different Arquillian protocols. Or with a single protocol which executes all tests using various vehicles.