Skip to content

Commit

Permalink
Merge pull request #61 from eclipse-emf-parsley/issue-60-tycho-surefire
Browse files Browse the repository at this point in the history
Issue 60 tycho surefire
  • Loading branch information
LorenzoBettini committed Dec 6, 2022
2 parents 9cd2431 + 75f7145 commit 0201e28
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 213 deletions.
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Build with Maven
run: >
./mvnw -f releng/org.eclipse.emf.parsley.parent/pom.xml
-Prcp-build
clean verify
- name: Archive UI Tests Screenshots
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/maven.yml
Expand Up @@ -38,6 +38,7 @@ jobs:
- name: Build with Maven
run: >
./mvnw -f releng/org.eclipse.emf.parsley.parent/pom.xml
-Prcp-build
clean verify
- name: Archive UI Tests Screenshots
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Build with Maven
run: >
./mvnw -f releng/org.eclipse.emf.parsley.parent/pom.xml
-Prcp-build
clean verify
- name: Archive UI Tests Screenshots
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Expand Up @@ -21,7 +21,7 @@ pipeline {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh """
metacity --sm-disable --replace 2> wm.err &
./mvnw -f releng/org.eclipse.emf.parsley.parent/pom.xml clean verify
./mvnw -f releng/org.eclipse.emf.parsley.parent/pom.xml clean verify -Prcp-build
"""
}
}
Expand Down
40 changes: 3 additions & 37 deletions dsl/org.eclipse.emf.parsley.dsl.tests/pom.xml
Expand Up @@ -13,25 +13,6 @@
<artifactId>org.eclipse.emf.parsley.dsl.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>

<!--
-XstartOnFirstThread is required by the test
org.eclipse.emf.parsley.dsl.tests.EmfParsleyDslExecutionTest.testGeneratedContentProvider()
which must access the SWT thread
-->
<profiles>
<profile>
<id>macosx-jvm-flags</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<os-jvm-flags>-XstartOnFirstThread</os-jvm-flags>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand All @@ -47,24 +28,9 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>default-test</id>
<phase>integration-test</phase>
<configuration>
<skip>${dsl.tests.skip}</skip>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${uiTestsArgs} ${memoryArgs} ${moduleProperties}</argLine>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${dsl.tests.skip}</skip>
</configuration>
</plugin>

</plugins>
Expand Down
40 changes: 8 additions & 32 deletions dsl/org.eclipse.emf.parsley.dsl.ui.tests/pom.xml
Expand Up @@ -20,9 +20,6 @@
<family>mac</family>
</os>
</activation>
<properties>
<os-jvm-flags>-XstartOnFirstThread</os-jvm-flags>
</properties>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -63,35 +60,14 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>default-test</id>
<phase>integration-test</phase>
<configuration>
<skip>${dsl.tests.skip}</skip>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${uiTestsArgs} ${pdeTestsArgs} ${moduleProperties}</argLine>
<includes>
<include>**/org/eclipse/emf/parsley/dsl/ui/tests/*Test.java</include>
</includes>
<!-- TODO remove with tycho 1.3 -->
<bundleStartLevel>
<bundle>
<id>org.apache.felix.scr</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${dsl.tests.skip}</skip>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<includes>
<include>**/org/eclipse/emf/parsley/dsl/ui/tests/*Test.java</include>
</includes>
</configuration>
</plugin>

<plugin>
Expand Down
70 changes: 70 additions & 0 deletions releng/org.eclipse.emf.parsley.parent/pom.xml
Expand Up @@ -84,8 +84,16 @@
<pdeTestsArgs></pdeTestsArgs>
<skipDragAndDropTests>true</skipDragAndDropTests>
<swtbotTestsArgs>${uiTestsArgs} -DskipDragAndDropTests=${skipDragAndDropTests} -Dorg.eclipse.swtbot.search.timeout=20000 -Dorg.eclipse.swt.internal.gtk.cairoGraphics=false</swtbotTestsArgs>
<!-- we build with at least Java 11 always -->
<moduleProperties>--add-modules=ALL-SYSTEM</moduleProperties>

<!-- Define overridable properties for tycho-surefire-plugin -->
<platformSystemProperties></platformSystemProperties>
<previewProperties></previewProperties>
<systemProperties></systemProperties>
<additionalTestArguments></additionalTestArguments>
<specialTestArguments></specialTestArguments>

<!-- <jacoco.reportPath>../target/jacoco.exec</jacoco.reportPath> -->

<parsley.download.area>/home/data/httpd/download.eclipse.org/emf-parsley</parsley.download.area>
Expand Down Expand Up @@ -622,6 +630,43 @@
</pluginRepository>
</pluginRepositories>
</profile>

<profile>
<id>macos</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
<platformSystemProperties>-XstartOnFirstThread</platformSystemProperties>
</properties>
</profile>
<profile>
<id>jdk12-or-newer</id>
<activation>
<jdk>[12,)</jdk>
</activation>
<properties>
<previewProperties>--enable-preview</previewProperties>
</properties>
</profile>
<profile>
<id>jacoco</id>
<properties>
<!-- tycho.testArgLine is where jacoco stores the agent path -->
<additionalTestArguments>${tycho.testArgLine}</additionalTestArguments>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
Expand Down Expand Up @@ -687,6 +732,31 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>${platformSystemProperties} ${systemProperties} ${additionalTestArguments}</argLine>
</configuration>
</plugin>

<!-- to skip running (and compiling) tests use commandline flag: -Dmaven.test.skip
To skip tests, but still compile them, use: -DskipTests
To allow all tests in a pom to pass/fail, use commandline flag: -fae (fail
at end) -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
<argLine>${previewProperties} ${platformSystemProperties} ${systemProperties} ${moduleProperties} ${additionalTestArguments} ${specialTestArguments}</argLine>
<failIfNoTests>false</failIfNoTests>
<useUIHarness>false</useUIHarness>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
6 changes: 0 additions & 6 deletions tests/org.eclipse.emf.parsley.cdo.tests/pom.xml
Expand Up @@ -23,14 +23,8 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<skip>${simple.tests.skip}</skip>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${memoryArgs} ${moduleProperties}</argLine>
<includes>
<include>**/*Tests.java</include>
</includes>
Expand Down
30 changes: 4 additions & 26 deletions tests/org.eclipse.emf.parsley.tests.swtbot.cdo/pom.xml
Expand Up @@ -13,19 +13,9 @@
<artifactId>org.eclipse.emf.parsley.tests.swtbot.cdo</artifactId>
<packaging>eclipse-test-plugin</packaging>

<profiles>
<profile>
<id>macosx-jvm-flags</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<os-jvm-flags>-XstartOnFirstThread</os-jvm-flags>
</properties>
</profile>
</profiles>
<properties>
<specialTestArguments>${swtbotTestsArgs}</specialTestArguments>
</properties>

<build>
<plugins>
Expand All @@ -37,28 +27,16 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<skip>${swtbot.cdo.tests.skip}</skip>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${swtbotTestsArgs} ${moduleProperties}</argLine>
<includes>
<include>**/*Test*.java</include>
</includes>
<!-- TODO remove with tycho 1.3 -->
<bundleStartLevel>
<bundle>
<id>org.apache.felix.scr</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
</configuration>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
Expand Down
22 changes: 4 additions & 18 deletions tests/org.eclipse.emf.parsley.tests.swtbot.e4/pom.xml
Expand Up @@ -12,20 +12,10 @@

<artifactId>org.eclipse.emf.parsley.tests.swtbot.e4</artifactId>
<packaging>eclipse-test-plugin</packaging>

<profiles>
<profile>
<id>macosx-jvm-flags</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<os-jvm-flags>-XstartOnFirstThread</os-jvm-flags>
</properties>
</profile>
</profiles>

<properties>
<specialTestArguments>${swtbotTestsArgs}</specialTestArguments>
</properties>

<build>
<plugins>
Expand All @@ -37,15 +27,11 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<product>org.eclipse.emf.parsley.examples.eclipse4.product</product>
<application>org.eclipse.e4.ui.workbench.swt.E4Application</application>
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${swtbotTestsArgs} ${moduleProperties}</argLine>
<environmentVariables>
<!-- Ubuntu overlay scrollbars cause different crashes in GTK2 so disable them -->
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
Expand Down
30 changes: 4 additions & 26 deletions tests/org.eclipse.emf.parsley.tests.swtbot.examples/pom.xml
Expand Up @@ -12,20 +12,10 @@

<artifactId>org.eclipse.emf.parsley.tests.swtbot.examples</artifactId>
<packaging>eclipse-test-plugin</packaging>

<profiles>
<profile>
<id>macosx-jvm-flags</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<os-jvm-flags>-XstartOnFirstThread</os-jvm-flags>
</properties>
</profile>
</profiles>

<properties>
<specialTestArguments>${swtbotTestsArgs}</specialTestArguments>
</properties>

<build>
<plugins>
Expand All @@ -37,24 +27,12 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<skip>${swtbot.tests.skip}</skip>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<product>org.eclipse.emf.parsley.examples.mail.rcp.product</product>
<application>org.eclipse.emf.parsley.examples.mail.rcp.application</application>
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${swtbotTestsArgs} ${moduleProperties}</argLine>
<!-- TODO remove with tycho 1.3 -->
<bundleStartLevel>
<bundle>
<id>org.apache.felix.scr</id>
<level>1</level>
<autoStart>true</autoStart>
</bundle>
</bundleStartLevel>
</configuration>
</plugin>

Expand Down

0 comments on commit 0201e28

Please sign in to comment.