question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate troubles caused by Spock integration

See original GitHub issue

Reported here https://github.com/junit-team/junit5/commit/eaab286a53d534966de7cf6200955c0d3b8830f4. I need to check in more depth but perhaps one nice idea would be to have the support not dependant on the JfrEventTest annotation (global spock extension). If I understand that correctly Quarkus support works like that. It would make usage even simpler.

cc @gunnarmorling @sbrannen

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sbrannencommented, Jul 28, 2021

@gunnarmorling, I think you misunderstood the point I was trying to make (likely because I was too vague).

I think the current behavior is desirable, as it allows to re-use annotated classes in different contexts. The canonical example being JPA entities which can be used as data structures on the client-side, without the need for having the persistence API on the classpath there.

Yes, that’s a great feature of Java. No doubt. We love it!

But… the Java compiler emits a warning if you try to use a third-party annotation in your own code when that third-party annotation is meta-annotated with a second third-party annotation that is not present in the class path.

And… if you compile with -Werror (which many projects do), your build fails.

We argued with the Java team that such a condition should not result in a warning that can fail the build, because of the fact that the exact same code (once compiled) works fine at runtime without the second third-party annotation on the classpath.

Does that make sense now?


Hmmm… maybe I should say fourth-party instead of “second third-party”. 🤔

1reaction
gunnarmorlingcommented, Jul 28, 2021

Ah yes, got it now. Indeed I understood exactly the opposite of what you meant to say 😃 So yes, I agree there should be a way for compiling the code of this situation without any warnings (and without supressing other, unrelated, warnings), if that code can be run just fine later on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spock Framework Reference Documentation
Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful...
Read more >
Chapter 1. Introducing the Spock testing framework
Introducing Spock; Bird's-eye view of the testing process; Using Groovy to test Java; Understanding Spock's place in the testing world;
Read more >
Grails 3.0.0: Problem using @Rollback with integration tests ...
I expect the Rollback annotation is causing the problem because there isn't a transaction running in the integration test space. Is Rollback the ......
Read more >
Grails spock tests with private methods failing after upgrading ...
All are working fine, but some test cases are failing which containing some private methods. import org.junit.Before class UserServiceSpec ...
Read more >
Speed Up Spock Spring Tests - Object Partners
Spock tests for Spring applications can be slow and hard to maintain. ... Disadvantages: Dangerous – almost guaranteed to cause problems ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found