6 Replies Last post: Mar 15, 2013 8:31 PM by Roberto Schneiders  
Roberto Schneiders Newbie 18 posts since
Mar 14, 2013
Currently Being Moderated

Mar 14, 2013 6:46 PM

TeamCity + Maven Project doesn't perform the tests

Hello guys!

 

I'm new here. I'm starting to use the tools IntelliJ, YouTrack and TeamCity. I am also new to the Java world. I also have no experience with Maven. Lots of new stuff to learn.

 

I set up a continuous integration server with TeamCity. I'm trying to set up a project using Maven.

 

I had some difficulties, then follow the step by step tutorial book "7 TeamCity Continuous Integration Essentials". However, even following the tutorial I could not make it work right. Something is wrong.

 

My problem is that TeamCity application compiles but does not run the tests.

 

The book tells how to configure Maven Goals: clean compile install

 

I do not know if this is correct, because in the book, after setting up the server so it runs all tests. On my server, the tests are not performed.

 

At the moment I have 2 tests. One of them is passing and the other does not. Just to test.

 

If I run in IntelliJ the maven goal "test" it displays this message:

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.051 sec <<< FAILURE!

 

Exactly what I expected.

 

In TeamCity server the result of Build is: Success

No test information.

 

In BuildLog of TeamCity displays these messages:

----------------

[INFO] --- maven-surefire-plugin: 2.10: test (default-test) @ sample ---

[INFO] No tests to run.

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

----------------

 

I figured that the configuration of the Maven goals were wrong, so I switched to just: test

 

And now the result of the build is: Tests passed: 1

 

The log shows this information:

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.056 sec

 

I do not know what's wrong. Why running in the TeamCity he does not find the 2 tests?

 

What should be the goals of Maven settings in TeamCity configuration?

 

OBS: Attached pom file

 

Thank you!

Attachments:
Nikita Skvortsov JetBrains 172 posts since
Dec 21, 2010
Currently Being Moderated
Mar 14, 2013 7:44 PM in response to: Roberto Schneiders
Re: TeamCity + Maven Project doesn't perform the tests

Roberto,

 

Try running this command in your projects directory:

mvn clean test

How many tests are reported in maven output?

Nikita Skvortsov JetBrains 172 posts since
Dec 21, 2010
Currently Being Moderated
Mar 15, 2013 1:57 PM in response to: Roberto Schneiders
Re: TeamCity + Maven Project doesn't perform the tests

Hi Roberto,

 

There was a minor issue with maven project structure. You should place sources of your tests under 'src/test/java' path, not directly to 'src/test'

 

Please, update your project.

 

Fixed sample is attached.

Attachments:
Nikita Skvortsov JetBrains 172 posts since
Dec 21, 2010
Currently Being Moderated
Mar 15, 2013 6:41 PM in response to: Roberto Schneiders
Re: TeamCity + Maven Project doesn't perform the tests

Possibly, the archetype is corrupted.  This problem deserves being reported to archetype's author.

More Like This

  • Retrieving data ...