Error running test configuration with regex
I am trying to create a Specs2 configuration to run only unit tests, without integration tests. I have tried using regex to exclude all packages that contain “.integration.”, e.g. com.mydomain.integration.foo.bar. I have tried multiple regex variations with no luck. Here are some of the things I've tried:
- ^(?!.*integration\.).*$
- ^((?!.*integration\.).+)$
- ^((?!.*integration\.).+)
- ^((?!integration\.).)*$
- ^(?!com\.mydomain\.integration\.).+
- ^((?!com\.mydomain\.integration\.).+)
- ^((?!com\.mydomain\.integration\.).+)$
I've tested all expressions I've used with regexr.com and I get the expected result there. Even so, they all end up with the same error in IntelliJ. A red speech bubble from the run icon with the text:
Error running ‘Unit Tests’
Cannot invoke "String.endsWith(String)" because the return value of "com.intellij.psi.PsiClass.getQualifiedName()" is null
It's very frustrating that there isn't a simple way to exclude a package from testing in IntelliJ.
Please sign in to leave a comment.
Hi Joakimhelgemo , is it using sbt or Maven/Gradle? Please upload a simple sample project to https://uploads.jetbrains.com/ and paste the upload id here, the uploaded file is only visible to JetBrains employees.
Note: the run configuration works for JUnit but maybe not for Scall(Specss), once reproduced, I'll create a issue report for you.
Please vote and star it, thank you.
Thank you! It's been very busy at work so I've had no time to create a sample project.