0

I want to run only my integration tests using the grails-maven-plugin. I setup a profile to run the exec command as such:

   <profile>
        <id>run-tests</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.grails</groupId>
                    <artifactId>grails-maven-plugin</artifactId>
                    <version>${grails.version}</version>
                    <executions>
                        <execution>
                            <id>grails-integration-tests</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                            <configuration>
                                <command>test-app</command>
                                <env>integration</env>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

The problem is to run only the integration tests the grails command looks like: grails test-app integration: With the colon at the end of integration, so when I do

<args>integration:</args>

This throws:

BasicLazyInitializer: Javassist Enhancement failed: <my classes in integration tests>
groovy.lang.MissingPropertyException: No such property: hasProperty for class: groovy.lang.MetaClassImpl

So basically I need to figure out how to pass the argument integration: into the maven exec, but I think maven doesn't like the colon.

janDro
  • 1,426
  • 2
  • 11
  • 24
  • Have you tried `-integration`? – dmahapatro Nov 13 '14 at 20:29
  • That throws the same errors, but then continues on and runs the integration tests as expected. As a side note, when I run without the args tag, it runs both unit tests and integration tests, without any errors. – janDro Nov 13 '14 at 20:37
  • I think I'm just going to end up skipping the default maven test phase which runs the unit tests with -DskipTests=true and having the exec run both unit and integration tests. Thanks for the help @dmahapatro! – janDro Nov 13 '14 at 21:07
  • 1
    You can run only integration test with this command as well if needed: `mvn grails:exec -Dcommand=test-app -Dargs="-integration"` – dmahapatro Nov 13 '14 at 21:12

0 Answers0