-
Notifications
You must be signed in to change notification settings - Fork 67
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
Test NG / Spring Boot #44
Comments
Can you give any more information about what would be required to get QuickPerf working correctly with Spring? Specifically if we are using integration tests that extend the AbstractTransactionalTestNGSpringContextTests class. Is there a problem with the TestNG listener, or is it more to do with how the datasource / session factory / transactions are working? We have started trying to implement QuickPerf and have added a proxy to the datasource. If there are code changes required so that the QuickPerf annotations will be read then I may be able to have a look at them if you can give me more information. Thanks. |
I have never tested QuickPerf + Test NG + Spring Boot. So, I am not sure that the SQL annotations would work with this configuration. It may have issues with AbstractTransactionalTestNGSpringContextTests. Could you share an example with AbstractTransactionalTestNGSpringContextTests and the proxy on the datasource? So, I could also look at this example, and help have something working. |
One issue may be that the performance recording does not start just before the test method execution and does not stop just after the test method execution (code). It is difficult to say without an example. |
I've written a small example to show the annotations not working with Spring: repo. |
Thank you @oliver-hughes! I see what happens from your repo. QuickPerfTestNGListener is not called during the execution. The reason may be that |
Thanks for doing this. I think myself and Oliver understand the problem better now. We agree that because the Spring base class implements IHookable this is conflicting with the listener. You know this code better than us, are you happy to try and finish off the implementation? Or if not let us know and we can try. |
So are you planning on having two methods of running TestNG tests? One for non-Spring code and one for using Spring? If so will you move the code that needs to be run before and after tests to a central class and then invoke that from both QuickPerfTestNGListener and the Spring listener? I would be tempted to rename the second listener to QuickPerfSpringTestExecutionListener to make it clearer that it is specific to Spring. |
Hi @hedleyproctor and @oliver-hughes , I have good news. I have found a solution to have QuickPerf SQL annotations work with Test NG + Spring. The code is here. The solution is based on an
Yes, I would prefer today. The reason is it is far more challenging to run the JVM annotations with Spring. The
Good point.
I don't know. QuickPerfSpringTestNGListener is not very long? Could you please use the Once the implementation seems stable, we could provide it with a QuickPerf dependency to help other QuickPerf users. |
Hi @jeanbisutti, |
Hi @oliver-hughes and @hedleyproctor,
@oliver-hughes Thank you very much for having tested with another TestNG & Spring project. Now we could add the new code to QuickPerf. A new |
Hi @jeanbisutti, sure - I'd be happy to create a pull request with this.
|
Hi @oliver-hughes, Great!
Yes, good point!
I agree. Something like Don't hesitate to ask if you have other remarks or need help. |
Myself and Oliver have tried to build the QuickPerf master branch but it is failing to get a dependency: Failed to execute goal on project quick-perf-jfr-annotations: Could not resolve dependencies for project org.quickperf:quick-perf-jfr-annotations:jar:1.1.1-SNAPSHOT: Failure to find org.openjdk.jmc:flightrecorder.rules.jdk:jar:7.1.1 Looking on Maven Central I can see only Flight Recorder v8. We could try to clone and build the Flight Recorder project locally but is this the best solution? Or alternatively could we upgrade QuickPerf to use Flight Recorder v8? We could do an issue and PR to upgrade the library version if you think the upgrade would be easy? |
The JFrog repository provides the missing dependency (QuickPerf pom) I have just removed the 7.1.1 JMC dependencies from my local repository. After that, I can see that Maven can download them. I suspect that Maven only uses the Maven central repository and blocks the others in your environment. v8 may have an impact, for example on @ExpectNoJvmIssue. Could you try downloading the 7.1.1 dependencies from the JFrog repository or building from v8 and remove v8 for your PR? |
Fixed with 7b9487a Thanl you @oliver-hughes and @hedleyproctor!! |
A QuickPerf Test NG listener is developed (see #32 and 3932345 ).
A Spring Boot application is tested with QuickPerf+JUnit4 and QuickPerf+Junit5.
The aim of this issue is to provide a Github repository containing this Spring Boot application with tests using QuickPerf and Test NG.
The text was updated successfully, but these errors were encountered: