Shin
Shin

Reputation: 181

How can I find out what test type is being executed?

I've written a plugin to do data migrations under mongodb which inserts test data under a test context (like liquibase does) but the test data is interfering with my functional tests.

I was thinking rather than applying the test data during the test context, I could insert when the test type is 'migration' also.

Within Grails, how do I determine the current test type that is executing?

Thanks!

Upvotes: 0

Views: 54

Answers (1)

Martin Hauner
Martin Hauner

Reputation: 1733

You can try using the variables currentTestPhaseName and currentTestTypeName from the delegate binding (GantBinding). If you are in _Events.groovy you can directly access them from an event closure. If you are inside a GrailsTestTypeSupport there is a member buildBinding.

Upvotes: 1

Related Questions