Skip to content
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

Couldn't run test clicking in the greens arrows alongside of the class #574

Closed
AdrianAgr opened this issue Jan 23, 2019 · 10 comments
Closed
Labels
Milestone

Comments

@AdrianAgr
Copy link

This morning I found an update from Spek (to v2.0.0-rc.1.180+b8533a4-IJ2018.3), and after did it I couldn't run any test individually (clicking in the green arrows alongside the class). The only way that I have found to run the test is running all the test classes that I have in the folder at the same time (right-click on the folder -->Run Test in whatever).

I'm working with Windows and IntelliJ IDEA 2018.3.3 (Ultimate Edition, Build #IU-183.5153.38)
This bug was easy to reproduce as well.

Please, find the images below for more details:

annotation 2019-01-23 114226

This is the trace:

annotation 2019-01-23 114259

@raniejade
Copy link
Member

By any chance do you have the class in the default package?

@raniejade
Copy link
Member

Also, can you share a reproducer? The kotlin plugin version you are using may help as well.

@AdrianAgr
Copy link
Author

No, I don't have this class in the default package (I created another package specifically for test). And regarding the reproducer (if I understood correctly), you have to write a regular Spek test.

The Kotlin plugin version is: v1.3.11-release-IJ2018.3-1

@AdrianAgr
Copy link
Author

I solved the issue, somehow the package line was removed and I didn't notice it,

@jcornaz
Copy link
Contributor

jcornaz commented Jan 25, 2019

But, Spek should be able to run specification in the default package, right?

@raniejade
Copy link
Member

@jcornaz It should - I definitely fixed this before, going to look at it again.

@raniejade
Copy link
Member

raniejade commented Feb 6, 2019

Tried replicating but with no luck. Also tests under the default package are working, so no problem there.

EDIT: I was wrong the issue is with tests in the default package but it only happens if you are using JDK 1.8. Java 9 and above Class#getPackage() never returns null anymore https://bugs.openjdk.java.net/browse/JDK-8193889.

@raniejade raniejade added this to the 2.0.1 milestone Feb 6, 2019
@NikkyAI
Copy link

NikkyAI commented Feb 6, 2019

i get this issue with all my tests being in packages though.. i had some files that were just empty / commented out but even deleting those did not fix it,
i am not sure what is in the default package but it should not be any of the tests

@raniejade
Copy link
Member

@NikkyAI can you double check your tests? Maybe missing the package line? The only time I can consistently replicate this via the IDE and gradle is when I'm using Java 8 and have a test in the default package.

@raniejade
Copy link
Member

@NikkyAI once the dev builds are out can you try it out and see if it fixes your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants