Skip to content

Commit 1e5e3cc

Browse files
committed
Save screenshot to build output directory
eclipse-platform/eclipse.platform.swt#3303 As screenshots are effectively a build artifact, save them in build output directory (target/ by default). SWT does not use Platform, so existing heuristics have not worked in GitHub Actions, abandoning screenshots in /tmp without archiving into artifacts. The change breaks existing Gerrit jobs, but as Gerrit is no longer used, this should be fine.
1 parent 3306df2 commit 1e5e3cc

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/mavenBuild.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,4 @@ jobs:
9595
path: |
9696
${{ github.workspace }}/**/target/surefire-reports/*.xml
9797
${{ github.workspace }}/**/results/**/*.png
98+
${{ github.workspace }}/**/target/screenshots/*.png

eclipse-platform-parent/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
<!-- system specific JVM args; if needed provided by system properties to the build command -->
132132
<surefire.systemProperties></surefire.systemProperties>
133133
<surefire.timeout>1200</surefire.timeout>
134+
<surefire.screenshot_directory>${project.build.directory}/screenshots</surefire.screenshot_directory>
134135
<java.version>17</java.version>
135136
<printApiMessages>false</printApiMessages>
136137
<failOnJavadocErrors>false</failOnJavadocErrors>
@@ -343,6 +344,11 @@
343344
<groupId>org.apache.maven.plugins</groupId>
344345
<artifactId>maven-surefire-plugin</artifactId>
345346
<version>${surefire.version}</version>
347+
<configuration>
348+
<systemPropertyVariables>
349+
<eclipse.screenshot_directory>${surefire.screenshot_directory}</eclipse.screenshot_directory>
350+
</systemPropertyVariables>
351+
</configuration>
346352
</plugin>
347353
<plugin>
348354
<groupId>org.apache.maven.plugins</groupId>
@@ -434,6 +440,9 @@
434440
<enableAssertions>true</enableAssertions>
435441
<argLine>${surefire.testArgLine} ${surefire.platformSystemProperties} ${surefire.systemProperties} ${surefire.moduleProperties}</argLine>
436442
<quiet>true</quiet>
443+
<systemProperties>
444+
<eclipse.screenshot_directory>${surefire.screenshot_directory}</eclipse.screenshot_directory>
445+
</systemProperties>
437446
</configuration>
438447
</plugin>
439448
<plugin>

eclipse.platform.releng/bundles/org.eclipse.test/src/org/eclipse/test/Screenshots.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ private static File getJunitReportOutput() {
139139
}
140140
}
141141
}
142+
String path = System.getProperty("eclipse.screenshot_directory");
143+
if (path != null) {
144+
return new File(path);
145+
}
142146
return null;
143147
}
144148

0 commit comments

Comments
 (0)