Grails integration tests incorrectly running as unit tests since last intellij update (2017.2.1) causing No transactionManager was specified errors

Answered

Hi,

I have a runtime config that grabs all tests (using pattern match in a package). Then I run all tests with coverage. This has been working fine for a few months, but since a recent upgrade, the integrations tests included in this scope no longer run as integration tests (grails app doesn't fire up) and immediately fail because no transaction manger is configured:

java.lang.IllegalStateException: No transactionManager was specified. Using @Transactional or @Rollback requires a valid configured transaction manager. If you are running in a unit test ensure the test has been properly configured and that you run the test suite not an individual test method.

This error seems to make sense if I was running a unit test with @Rollback or @Transactional - but these are Integration tests... why are these suddenly not running in the correct context? If I do grails test-app, everything is fine, but then of course I don't get IntelliJ's great code coverage. Did something in the test or runtime config change?

0
5 comments

Bug report with the steps to reproduce would be appreciated at https://youtrack.jetbrains.com/issues/IDEA.

0
Avatar
Permanently deleted user

@serge Thanks, thought I'd check with the community first incase I was just being dense. I'll make a test case and file a formal report. Thanks!

0

Community is not very active here, so 99% of the responses will be from the JetBrains team anyway.

0
Avatar
Permanently deleted user

Good to know. Building test case now - just some more info before I submit, it seems integration tests aren't working at all - when I right click on a test and run, it fails for the same reason as above immediately, so it looks like the whole runtime config thing is unrelated, it has something to do with grails integration tests in general.

0
Avatar
Permanently deleted user
0

Please sign in to leave a comment.