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
  • From: "Keppler Michael (ETAS/ESW-CI)" <Michael.Keppler@xxxxxxxx>
  • Date: Wed, 28 Jul 2021 05:49:26 +0000
  • Accept-language: de-DE, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 139.15.153.201) smtp.rcpttodomain=eclipse.org smtp.mailfrom=etas.com; dmarc=pass (p=reject sp=none pct=100) action=none header.from=etas.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4wgd3yIeJdTSTE0k7W9YU6mrDH15lGcrJBpdbLwOp1I=; b=GOH9NtuAaKnQa4glyOEba7+0x09O4hOAadbowIYb+HoK1m2GdDj45xzH5uLIW3OivAbCOf5EM4RHDHM4POwRwt/BLLa1k7qgE+LXr/6je3SyEYQ6/qG5QM3+djvOHrefL1iqBhMkIGAqdT1Edf1Im3LL1olOX/kMY+N6uoVLha6guBDbmfTYuJPbhqAWKgQkKfgMjTiikyj+pMpd/a6KtASFAzExxRxwxjUmpSeYLyczjEoEU+9+Rcze7PFkKJ7dVMwOp4hmnWpABf+PX+GHK9G/VHSvGVh8C9JFxrGnh+Vvyhe98pXOBVMelP9UXd9ksT7H14XRndtIEWYaY7D0Vw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZdaEPIPMNrwlg9vuqIxBpxIc1HLIeKpMJbADvoV/SRBaaaXAOz/+pHqGy05Pfc2uxaCEOqANQqPAJBWpcIdzxSX1ysm8AFRw00GqIt7sk+ZZRRx3rdoYmBu1fXQSCWeISmqhOiA53sGXBqLWZCpkUTRwXTFxIBSsXUfmY1hACDLO4sznuRbI77Vgf87k/uJnkSSeJ/vCQyd6m96YlY3dVKJ6GCrgbJfKV/NNTuBHskJeCVF6miVAcZUFvG96Eyg5K40+KPwKXoJSu89dh4H93/bxoHd+WJDUXaQ2zIAXenPnCALP4QKTOsh9TNKm4AqdPnnZRG04+iJ0XH6hEO/zWQ==
  • Delivered-to: tycho-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tycho-user/>
  • List-help: <mailto:tycho-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tycho-user>, <mailto:tycho-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tycho-user>, <mailto:tycho-user-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdeC59AuGtF2lp9OTauURrpeNiYMwv//5fCA//7aNJA=
  • Thread-topic: [tycho-user] Tycho 2.4, Maven Surefire and Jacoco

@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

Back to the top