Grails

grails test-app executes integrationtest-classes twice

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.2-RC1
  • Fix Version/s: 1.2-RC2
  • Component/s: Testing
  • Labels:
    None
  • Environment:
    Grails-1.2-RC1
    JVM: 1.5.0_14-b03
    JVM Vendor: Sun Microsystems Inc.
    OS Name: Windows XP

Description

item 1

after upgrading from 1.2-M4 to 1.2-RC1 my integration-test-classes
seem to be executed twice.

the command i execute is:

monospaced
grails test-app integration: com.mycompany.myapp.DataModelIntegration -clean
monospaced

the output is:

monospaced
-------------------------------------------------------
Running 2 integration tests...
Running test com.mycompany.myapp.DataModelIntegrationTests...PASSED
Running test com.mycompany.myapp.DataModelIntegrationTests...PASSED
Tests Completed in 2672ms ...
-------------------------------------------------------
Tests passed: 6
Tests failed: 0
-------------------------------------------------------
monospaced

DataModelIntegrationTests.groovy contains 3 test-methods

same also happens, when i execute:

monospaced
grails test-app com.mycompany.myapp.DataModelIntegration -clean -integration
monospaced

item 2

[this may not have to categorized as a bug]

by mistake i forgot the colon of 'integration:'

monospaced
grails test-app integration com.mycompany.myapp.DataModelIntegration -clean
monospaced

and got a:

Error executing script TestApp: java.lang.StringIndexOutOfBoundsException: Strin
g index out of range: -1

Issue Links

Activity

Hide
Luke Daley added a comment -

Helmut,

I am having trouble reproducing item 1

Are you able to attach your project?

Show
Luke Daley added a comment - Helmut, I am having trouble reproducing item 1 Are you able to attach your project?
Hide
Helmut Denk added a comment -

my steps to reproduce it:

step 1
grails create-app grails-test

step 2

create test-class test/integration/com/mycompany.myapp/DummyTest.groovy:

package com.mycompany.myapp

class DummyTests extends GroovyTestCase {
	void testShouldRunOk() {	
	}	
	
	void testShouldFail() {
		fail 'this test fails'
	}
}

step 3

run command:

grails test-app integration: com.mycompany.myapp.Dummy

this is the output for me:

-------------------------------------------------------
Running 2 integration tests...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1375ms ...
-------------------------------------------------------
Tests passed: 2
Tests failed: 2
-------------------------------------------------------
Show
Helmut Denk added a comment - my steps to reproduce it: step 1 grails create-app grails-test step 2 create test-class test/integration/com/mycompany.myapp/DummyTest.groovy:
package com.mycompany.myapp

class DummyTests extends GroovyTestCase {
	void testShouldRunOk() {	
	}	
	
	void testShouldFail() {
		fail 'this test fails'
	}
}
step 3 run command: grails test-app integration: com.mycompany.myapp.Dummy this is the output for me:
-------------------------------------------------------
Running 2 integration tests...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1375ms ...
-------------------------------------------------------
Tests passed: 2
Tests failed: 2
-------------------------------------------------------
Hide
Luke Daley added a comment -

I followed these steps exactly and cannot reproduce, this may be a windows specific issue.

Show
Luke Daley added a comment - I followed these steps exactly and cannot reproduce, this may be a windows specific issue.
Hide
Peter Ledbrook added a comment -

Can't reproduce on Linux with latest code. BTW, in step 2, the name of the test file is wrong: it should be DummyTests.groovy not DummyTest.groovy. Correcting it will save some heartache for those of us copying and pasting.

Show
Peter Ledbrook added a comment - Can't reproduce on Linux with latest code. BTW, in step 2, the name of the test file is wrong: it should be DummyTests.groovy not DummyTest.groovy. Correcting it will save some heartache for those of us copying and pasting.
Hide
Helmut Denk added a comment -

a sequence of commands with output
executed on my xp-box:

1 = ok

>grails test-app

Welcome to Grails 1.2.0.RC1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\tools\grails\grails-1.2.RC1

Base Directory: F:\workspaces\test\grails12RC1-test2
Resolving dependencies...
Dependencies resolved in 1094ms.
Running script c:\tools\grails\grails-1.2.RC1\scripts\TestApp.groovy
Environment set to test
No authentication for svn repo at snapshot ...
No authentication for svn repo at released ...
No authentication for svn repo at thirdparty ...
Using explicit plugin resolve order [default, core] ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\html
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\plain

Starting unit test phase ...

Starting integration test phase ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes

-------------------------------------------------------
Running 1 integration test...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1015ms ...
-------------------------------------------------------
Tests passed: 1
Tests failed: 1
-------------------------------------------------------

Starting other test phase ...
[junitreport] Processing F:\workspaces\test\grails12RC1-test2\target\test-reports\TESTS-TestSuites.xml to C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1453917995
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/hdenk/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1578ms
[junitreport] Deleting: C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1453917995

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.

2 = ok

>grails test-app integration:

Welcome to Grails 1.2.0.RC1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\tools\grails\grails-1.2.RC1

Base Directory: F:\workspaces\test\grails12RC1-test2
Resolving dependencies...
Dependencies resolved in 1360ms.
Running script c:\tools\grails\grails-1.2.RC1\scripts\TestApp.groovy
Environment set to test
No authentication for svn repo at snapshot ...
No authentication for svn repo at released ...
No authentication for svn repo at thirdparty ...
Using explicit plugin resolve order [default, core] ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\html
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\plain

Starting integration test phase ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes

-------------------------------------------------------
Running 1 integration test...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1000ms ...
-------------------------------------------------------
Tests passed: 1
Tests failed: 1
-------------------------------------------------------
[junitreport] Processing F:\workspaces\test\grails12RC1-test2\target\test-reports\TESTS-TestSuites.xml to C:\DOKUME~1\hdenk\LOKALE~1\Temp\null513622173
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/hdenk/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1766ms
[junitreport] Deleting: C:\DOKUME~1\hdenk\LOKALE~1\Temp\null513622173

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.

3 = not ok

>grails test-app integration: com.mycompany.myapp.Dummy

Welcome to Grails 1.2.0.RC1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\tools\grails\grails-1.2.RC1

Base Directory: F:\workspaces\test\grails12RC1-test2
Resolving dependencies...
Dependencies resolved in 1219ms.
Running script c:\tools\grails\grails-1.2.RC1\scripts\TestApp.groovy
Environment set to test
No authentication for svn repo at snapshot ...
No authentication for svn repo at released ...
No authentication for svn repo at thirdparty ...
Using explicit plugin resolve order [default, core] ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\html
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\plain

Starting integration test phase ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes

-------------------------------------------------------
Running 2 integration tests...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1188ms ...
-------------------------------------------------------
Tests passed: 2
Tests failed: 2
-------------------------------------------------------
[junitreport] Processing F:\workspaces\test\grails12RC1-test2\target\test-reports\TESTS-TestSuites.xml to C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1251350568
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/hdenk/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1547ms
[junitreport] Deleting: C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1251350568

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.
Show
Helmut Denk added a comment - a sequence of commands with output executed on my xp-box: 1 = ok
>grails test-app

Welcome to Grails 1.2.0.RC1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\tools\grails\grails-1.2.RC1

Base Directory: F:\workspaces\test\grails12RC1-test2
Resolving dependencies...
Dependencies resolved in 1094ms.
Running script c:\tools\grails\grails-1.2.RC1\scripts\TestApp.groovy
Environment set to test
No authentication for svn repo at snapshot ...
No authentication for svn repo at released ...
No authentication for svn repo at thirdparty ...
Using explicit plugin resolve order [default, core] ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\html
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\plain

Starting unit test phase ...

Starting integration test phase ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes

-------------------------------------------------------
Running 1 integration test...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1015ms ...
-------------------------------------------------------
Tests passed: 1
Tests failed: 1
-------------------------------------------------------

Starting other test phase ...
[junitreport] Processing F:\workspaces\test\grails12RC1-test2\target\test-reports\TESTS-TestSuites.xml to C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1453917995
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/hdenk/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1578ms
[junitreport] Deleting: C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1453917995

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.
2 = ok >grails test-app integration:
Welcome to Grails 1.2.0.RC1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\tools\grails\grails-1.2.RC1

Base Directory: F:\workspaces\test\grails12RC1-test2
Resolving dependencies...
Dependencies resolved in 1360ms.
Running script c:\tools\grails\grails-1.2.RC1\scripts\TestApp.groovy
Environment set to test
No authentication for svn repo at snapshot ...
No authentication for svn repo at released ...
No authentication for svn repo at thirdparty ...
Using explicit plugin resolve order [default, core] ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\html
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\plain

Starting integration test phase ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes

-------------------------------------------------------
Running 1 integration test...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1000ms ...
-------------------------------------------------------
Tests passed: 1
Tests failed: 1
-------------------------------------------------------
[junitreport] Processing F:\workspaces\test\grails12RC1-test2\target\test-reports\TESTS-TestSuites.xml to C:\DOKUME~1\hdenk\LOKALE~1\Temp\null513622173
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/hdenk/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1766ms
[junitreport] Deleting: C:\DOKUME~1\hdenk\LOKALE~1\Temp\null513622173

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.
3 = not ok
>grails test-app integration: com.mycompany.myapp.Dummy

Welcome to Grails 1.2.0.RC1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\tools\grails\grails-1.2.RC1

Base Directory: F:\workspaces\test\grails12RC1-test2
Resolving dependencies...
Dependencies resolved in 1219ms.
Running script c:\tools\grails\grails-1.2.RC1\scripts\TestApp.groovy
Environment set to test
No authentication for svn repo at snapshot ...
No authentication for svn repo at released ...
No authentication for svn repo at thirdparty ...
Using explicit plugin resolve order [default, core] ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\html
    [mkdir] Created dir: F:\workspaces\test\grails12RC1-test2\target\test-reports\plain

Starting integration test phase ...
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes
  [groovyc] Compiling 1 source file to F:\workspaces\test\grails12RC1-test2\target\classes

-------------------------------------------------------
Running 2 integration tests...
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Running test com.mycompany.myapp.DummyTests...
                    testShouldFail...FAILED
Tests Completed in 1188ms ...
-------------------------------------------------------
Tests passed: 2
Tests failed: 2
-------------------------------------------------------
[junitreport] Processing F:\workspaces\test\grails12RC1-test2\target\test-reports\TESTS-TestSuites.xml to C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1251350568
[junitreport] Loading stylesheet jar:file:/C:/Dokumente%20und%20Einstellungen/hdenk/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1547ms
[junitreport] Deleting: C:\DOKUME~1\hdenk\LOKALE~1\Temp\null1251350568

Tests FAILED - view reports in target\test-reports
Application context shutting down...
Application context shutdown.
Hide
Luke Daley added a comment -

Behaviour is no longer exhibited with HEAD.

Please verify that this has been fixed when RC2 is released over the coming days.

Show
Luke Daley added a comment - Behaviour is no longer exhibited with HEAD. Please verify that this has been fixed when RC2 is released over the coming days.
Hide
Helmut Denk added a comment -

i checked it against RC2 and
test-app works as expected now.

Show
Helmut Denk added a comment - i checked it against RC2 and test-app works as expected now.
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: