Skip to content

Commit 46e72e8

Browse files
committed
fix for GRAILS-10956 “Forked functional testing with war throwing exceptions”
1 parent d073a93 commit 46e72e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

grails-test/src/main/groovy/org/codehaus/groovy/grails/test/runner/phase/FunctionalTestPhaseConfigurer.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.codehaus.groovy.grails.test.runner.phase
1717

1818
import grails.util.BuildSettings
19+
import grails.util.Environment
1920
import grails.util.Holders
2021
import groovy.transform.CompileStatic
2122

@@ -90,7 +91,9 @@ class FunctionalTestPhaseConfigurer extends DefaultTestPhaseConfigurer {
9091

9192
// need to swap out the args map so any test phase/targetting patterns
9293
// aren't intepreted as the war name.
93-
projectRunner.warCreator.packageWar()
94+
if( !Environment.isFork() ) {
95+
projectRunner.warCreator.packageWar()
96+
}
9497

9598
if (https) {
9699
projectRunner.runWarHttps()

scripts/_GrailsTest.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ target(allTests: "Runs the project's tests.") {
8686
depends(compile, startLogging, packagePlugins, configureServerContextPath)
8787
Integer exitCode
8888
if(grailsSettings.forkSettings.test) {
89+
if(argsMap?.war) {
90+
projectRunner.warCreator.packageWar()
91+
}
8992
def forkedTestRunner = new ForkedGrailsTestRunner(grailsSettings)
9093
if(grailsSettings.forkSettings.test instanceof Map) {
9194
forkedTestRunner.configure(grailsSettings.forkSettings.test)

0 commit comments

Comments
 (0)