Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Tycho 2.4, Maven Surefire and Jacoco

> Previously it was okay to have tycho-surefire in the common parent
> of all bundles (non-test and test)

This should still be the case. But from your example you should distinguish between *tycho-surefire* and *maven-surefire*

> I guess for you that is the expected behavior since you assume
> separate parents for main and test code, right?

Nope this should not be required. The current logic works that way:

- if you eclipse-plugin defines any 'test' scoped source then the *maven-surefire* plugin kicks in at the 'test' stage if anything matches the usual test-patterns, if not, nothing happens - if your eclipse-plugin defines any 'test' scoped sources and matches the Integrationpttern (*IT.java) it executes the *tycho-surefire* at the integration-test and the validation at the validate stage, if not nothing happens

All this matches the usual maven behaviour in contrast to the traditional test-plugin packaging of tycho where *all* tests happen and verified at the 'integration-test' stage (what is, from maven POV simply wrong).

What we are seeing here (as far as I can tell from the reported issues so far, there is no simple reproducer yet available!) is, that the *maven-surefire* plugin has an issue, that it (instead of simply skip its execution) it failed if some Filters/Testnames are defined, this is tracked (and hopefully fixed) and could be worked around by specifying the surefire.failIfNoSpecifiedTests=false property.

For sure, there are other options to circumvent this.


Am 28.07.21 um 07:49 schrieb Keppler Michael (ETAS/ESW-CI) via tycho-user:
@Christoph:
Previously it was okay to have tycho-surefire in the common parent of all bundles (non-test and test), since it simply wouldn't bind by default to packaging eclipse-bundle. I'm quite sure that several eclipse.org projects don't even have a separate parent for their test bundles, but rather contain all Tycho plugins (for bundles, for tests and for features) in the same parent. With the upgrade maven-surefire suddenly runs on your non-test bundles then. That's all I'm saying. I'm not complaining nor do I demand a fix.

For reproduction it is sufficient to compare the effective POM of the following _eclipse-plugin_ project (which contains the Tycho surefire plugin explicitly instead of via parent, but of course that is the same) with version set to 2.3 and 2.4. You will find additional plugin executions for maven-surefire and maven-failsafe. In fact, if you use maven-enforcer with the version number rule, it will also immediately complain about missing version pinning for those plugins.

I guess for you that is the expected behavior since you assume separate parents for main and test code, right?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd";>
	<modelVersion>4.0.0</modelVersion>
	<groupId>reproducer</groupId>
	<artifactId>reproducer</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<packaging>eclipse-plugin</packaging>
	<properties>
		<tycho-version>2.3.0</tycho-version>
	</properties>
	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-surefire-plugin</artifactId>
				<version>${tycho-version}</version>
			</plugin>
		</plugins>
	</build>
</project>

@Christian:
If you also use the same parent declaring Tycho-surefire for your code and test bundles then that's probably the same issue we are talking about here. While using the property might be a solution, I still prefer not even invoking surefire if not needed, therefore I use the "phase none" configuration.



Mit freundlichen Grüßen / Best regards

Michael Keppler
Engineering Application Software - Chapter CI/CD and Common Infrastructure Components

T +49 711 3423-2429
Michael.Keppler@xxxxxxxx

ETAS GmbH, ETAS/ESW-CI
Borsigstraße 24, 70469 Stuttgart, Germany
www.etas.com

ETAS – Driving Embedded Excellence

Managing Directors: Christoph Hartung, Günter Gromeier, Götz Nigge
Chairman of the Supervisory Board: Dr. Walter Schirm
Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart, HRB 19033
-----Ursprüngliche Nachricht-----
Von: tycho-user <tycho-user-bounces@xxxxxxxxxxx> Im Auftrag von Christoph Läubrich
Gesendet: Dienstag, 27. Juli 2021 15:30
An: tycho-user@xxxxxxxxxxx
Betreff: Re: [tycho-user] Tycho 2.4, Maven Surefire and Jacoco

·Switching to 2.4 without any further changes can lead to running (and
failing) maven-surefire on all bundles (both packaging eclipse-plugin
and eclipse-test-plugin), if you use a common parent POM for both.

This only happens when you are running your maven build to have some specific test patterns this is a bug of sure-fire plugin, if you found any other cases please report them with a simple reproducer.

The recommended workaround for this is to define the property

surefire.failIfNoSpecifiedTests=false

either on commandline or a suitable place in your pom hierarchy.

I wasn’t aware it would become active
by default for everything.

It isn't active for everything, and we haven't had to change any integration-test in tycho because of this change. That shows that it works for a wide range of common usecases, sad enough we don't have the resources to take care of *every* use case of tycho especially if there is no itest for it, so if you see room for improvement here, the best is to provide an itest[1] so we can integrate/investigate and make sure this specific use-case won't break your builds in the future anymore.

·If you have a bundle with packaging eclipse-plugin (not test!) mixed
into your test bundles and use Jacoco for coverage

I'm not a ware of any itest[1] that covers that combination, also here, it would be good to have an itest so we can better support this use case.

[1] https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feclipse%2Ftycho%2Fwiki%23providing-an-integration-test&amp;data=04%7C01%7Cmichael.keppler%40etas.com%7C7ce3f83341b4406cca7408d95102b4e6%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637629894327184323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=B8ce5siSzm6e9SzlX0uEePW%2FzMZDGSTjNbyXoRShcqo%3D&amp;reserved=0


Am 27.07.21 um 15:19 schrieb Keppler Michael (ETAS/ESW-CI) via tycho-user:
Hi folks,

Upgrading to Tycho 2.4 caused some confusion for us, therefore I want
to document that behavior for others:

·Switching to 2.4 without any further changes can lead to running (and
failing) maven-surefire on all bundles (both packaging eclipse-plugin
and eclipse-test-plugin), if you use a common parent POM for both. You
may need to bind maven-surefire with phase none for your none-test
bundles to get rid of that, or split the parent POM. This feature is
documented in release notes, but I wasn’t aware it would become active
by default for everything.

·If you have a bundle with packaging eclipse-plugin (not test!) mixed
into your test bundles and use Jacoco for coverage, you may suddenly
see maven errors about unresolved “tycho.argLine” property. Previously
such bundles were ignored by Tycho when running tests. Now they are
included (due to above changes), and they _/don’t/_ use the “tycho.argLine”
property like the test bundles, but rather the “argLine” property only
(as documented in jacoco-maven-plugin). So if you have only defined
“tycho.argLine” in your common parent and have such a bundle between
your tests, you may need to explicitly disable surefire there, too.

Mit freundlichen Grüßen / Best regards

*Michael Keppler*
Engineering Application Software - Chapter CI/CD and Common
Infrastructure Components

T +49 711 3423-2429
Michael.Keppler@xxxxxxxx <mailto:Michael.Keppler@xxxxxxxx>

ETAS GmbH, ETAS/ESW-CI
Borsigstraße 24, 70469 Stuttgart, Germany
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.e
tas.com%2F&amp;data=04%7C01%7Cmichael.keppler%40etas.com%7C7ce3f83341b
4406cca7408d95102b4e6%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637
629894327184323%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=NrcCd9I7g8MEyeDI
mZLsYSZxPCwmNdmmtnE84rhmiZo%3D&amp;reserved=0
<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
etas.com%2F&amp;data=04%7C01%7Cmichael.keppler%40etas.com%7C7ce3f83341
b4406cca7408d95102b4e6%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C63
7629894327194317%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV
2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=k4Ac1rQwE7i3oqg
0OqWiLz3MzN%2FsU2tupQ%2BmfVY8%2BOY%3D&amp;reserved=0>*

ETAS – Driving Embedded Excellence*

Managing Directors: Christoph Hartung, Günter Gromeier, Götz Nigge
Chairman of the Supervisory Board: Dr. Walter Schirm Registered
Office: Stuttgart, Registration Court: Amtsgericht Stuttgart, HRB
19033 ​


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
eclipse.org%2Fmailman%2Flistinfo%2Ftycho-user&amp;data=04%7C01%7Cmicha
el.keppler%40etas.com%7C7ce3f83341b4406cca7408d95102b4e6%7C0ae51e1907c
84e4bbb6d648ee58410f4%7C0%7C0%7C637629894327194317%7CUnknown%7CTWFpbGZ
sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
D%7C1000&amp;sdata=6MiTnGj2%2BBw39OIByPjbon%2B7vjJcUrun7h3k%2BWWb2sE%3
D&amp;reserved=0

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.eclipse.org%2Fmailman%2Flistinfo%2Ftycho-user&amp;data=04%7C01%7Cmichael.keppler%40etas.com%7C7ce3f83341b4406cca7408d95102b4e6%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C637629894327194317%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=6MiTnGj2%2BBw39OIByPjbon%2B7vjJcUrun7h3k%2BWWb2sE%3D&amp;reserved=0
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user



Back to the top