TeamCity 1.0 and Maven2/TestNG


By all accounts TeamCity seems to be building my projects, however I
intentionally broke the build such that the standard Maven2 build will fail
because one of the tests fail. In TeamCity, it continues to show 'success'.
Is there a known issue with this configuration, or is there something that
should be done to fail this build explicitly.

The build output seems to be different than the Maven2 standard build
output, which makes it difficult to determine where the problem is. Is there
any possible way to see the raw build output in addition to the TeamCity
build output?

Thanks.


8 comments
Comment actions Permalink


I'm now under the impression it's related to surefire + testng + maven
2.1.

Unfortunately, this may render TeamCity unusable for our work environment.
:(


By all accounts TeamCity seems to be building my projects,
however I
intentionally broke the build such that the standard Maven2 build will
fail
because one of the tests fail. In TeamCity, it continues to show
'success'.
Is there a known issue with this configuration, or is there something
that
should be done to fail this build explicitly.
The build output seems to be different than the Maven2 standard
build output, which makes it difficult to determine where the problem
is. Is there any possible way to see the raw build output in addition
to the TeamCity build output?

Thanks.



0
Comment actions Permalink

CMP wrote:


By all accounts TeamCity seems to be building my projects, however I
intentionally broke the build such that the standard Maven2 build will
fail because one of the tests fail. In TeamCity, it continues to show
'success'. Is there a known issue with this configuration, or is there
something that should be done to fail this build explicitly.


TeamCity builds fail if maven process will return error exit code
(in fact, not 0 exit code).


The build output seems to be different than the Maven2 standard
build output, which makes it difficult to determine where the problem
is. Is there any possible way to see the raw build output in addition
to the TeamCity build output?


Unfortunately, that's not possible. You can take a look at build agent's
log, placed at buildAgent/logs/teamcity.log (or TeamCity/buildAgent/logs/teamcity.log,
if you use bundled agent)

Hope this helps,
KIR


--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink


It looks like Maven 2 (2.1) that TeamCity uses isn't executing my test
cases. Likely, it's a Maven 2 (2.1) issue, as the same config works grand
on my other CI/Build test environments (which use Maven 2 2.0.4). I've even
configured the exact same plugin version for surefire.

Not sure if this is a JetBrains issue or a Maven issue.



CMP wrote:

>> By all accounts TeamCity seems to be building my projects, however I
>> intentionally broke the build such that the standard Maven2 build
>> will fail because one of the tests fail. In TeamCity, it continues
>> to show 'success'. Is there a known issue with this configuration, or
>> is there something that should be done to fail this build explicitly.
>>

TeamCity builds fail if maven process will return error exit code
(in fact, not 0 exit code).

>> The build output seems to be different than the Maven2 standard build
>> output, which makes it difficult to determine where the problem is.
>> Is there any possible way to see the raw build output in addition to
>> the TeamCity build output?
>>

Unfortunately, that's not possible. You can take a look at build
agent's
log, placed at buildAgent/logs/teamcity.log (or
TeamCity/buildAgent/logs/teamcity.log,
if you use bundled agent)
Hope this helps,
KIR



0
Comment actions Permalink

>that TeamCity uses isn't executing my test
cases.

Could you please describe the symptoms?
What is the full output (BuildLog | All Messages) for your configuration?
How do you enable TestNG in your pom.xml?

Thanks in advance for the information,


--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink


I put together a simple test, and apparently it's working okay. What
I did remove from the equation was the local settings and the 'parent pom.'
I will continue to investigate and post my findings.

Thanks.


>> that TeamCity uses isn't executing my test
>>

cases.

Could you please describe the symptoms?
What is the full output (BuildLog | All Messages) for your
configuration?
How do you enable TestNG in your pom.xml?
Thanks in advance for the information,



0
Comment actions Permalink


So I think I've found the problem (unfortunately, not the solution).

My company has a parent pom, which many if not all of the builds use
for the purposes of triggering different profiles. I did a TeamCity build
using 'help:effective-pom' and discovered that somehow the maven-surefire-plugin
config that's present in the project pom is overwritten, such that the configuration
of the xmlsuite for testng is removed (hence, no tests are being executed).
In TeamCity, it looks like the following:

maven-surefire-plugin /tmp/agent-maven-runnner-surefire53139reports false true However, it's defined like this in my pom: maven-surefire-plugin src/test/resources/testng.xml And from the command line (help:effective-pom), I get the following: maven-surefire-plugin src/test/resources/testng.xml ]]>

There is no maven-surefire-plugin configuration in the parent pom that I'm
using, and I've removed the parent pom from both my local machine and the
build agent machine and forced it to redownload and I still see the same
problem.


-C


I put together a simple test, and apparently it's working okay.
What
I did remove from the equation was the local settings and the 'parent
pom.'
I will continue to investigate and post my findings.
Thanks.

>>> that TeamCity uses isn't executing my test
>>>
>> cases.
>>
>> Could you please describe the symptoms?
>> What is the full output (BuildLog | All Messages) for your
>> configuration?
>> How do you enable TestNG in your pom.xml?
>> Thanks in advance for the information,


0
Comment actions Permalink

Yep, this seems to be TeamCity problem.
In order to read test reports and send them to the server, TC reads the pom.xml and obtains the location of the directory where
surefire writes the reports.
If the directory is not explicitly set, TC retargets the output directory to some temp dir. The bug seems to be in the fact that the
tags
are not preserved. The question is: would it run ok if the configuration was like this: maven-surefire-plugin /tmp/agent-maven-runnner-surefire53139reports false true src/test/resources/testng.xml -- Best regards, Eugene Zhuravlev Software Developer JetBrains Inc. http://www.jetbrains.com "Develop with pleasure!" "CMP" wrote in message news:6a22e6f22e9468c8ba822bb9c393@news.jetbrains.com... >]]>

So I think I've found the problem (unfortunately, not the solution).

>

My company has a parent pom, which many if not all of the builds use for the purposes of triggering different profiles. I did
a TeamCity build using 'help:effective-pom' and discovered that somehow the maven-surefire-plugin config that's present in the
project pom is overwritten, such that the configuration of the xmlsuite for testng is removed (hence, no tests are being
executed). In TeamCity, it looks like the following:

>

<plugin>
<artifactId>maven-surefire-plugin</artifactId> <configuration>
<reportsDirectory>/tmp/agent-maven-runnner-surefire53139reports</reportsDirectory>
<disableXmlReport>false</disableXmlReport> <useFile>true</useFile> </configuration> </plugin>

>

However, it's defined like this in my pom:

>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

>

And from the command line (help:effective-pom), I get the following:

>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

>

There is no maven-surefire-plugin configuration in the parent pom that I'm using, and I've removed the parent pom from both my
local machine and the build agent machine and forced it to redownload and I still see the same problem.

>
>

-C

>
>
>
>> I put together a simple test, and apparently it's working okay.
>> What
>> I did remove from the equation was the local settings and the 'parent
>> pom.'
>> I will continue to investigate and post my findings.
>> Thanks.
>>
>>>> that TeamCity uses isn't executing my test
>>>>
>>> cases.
>>>
>>> Could you please describe the symptoms?
>>> What is the full output (BuildLog | All Messages) for your
>>> configuration?
>>> How do you enable TestNG in your pom.xml?
>>> Thanks in advance for the information,
>



0
Comment actions Permalink

Hmm, just double-checked:
all existing options for the surefire configuration are preserved. TC just ensures that some properties exist and have certain
values.

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

"Eugene Zhuravlev (JetBrains)" <jeka@intellij.com> wrote in message news:egj3ml$13b$1@is.intellij.net...

Yep, this seems to be TeamCity problem.
In order to read test reports and send them to the server, TC reads the pom.xml and obtains the location of the directory where
surefire writes the reports.
If the directory is not explicitly set, TC retargets the output directory to some temp dir. The bug seems to be in the fact that
the tags
<suiteXmlFiles> are not preserved.
The question is: would it run ok if the configuration was like this:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reportsDirectory>/tmp/agent-maven-runnner-surefire53139reports</reportsDirectory>
<disableXmlReport>false</disableXmlReport>
<useFile>true</useFile>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

>
>

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

>
>


0

Please sign in to leave a comment.