Skip to content

Commit 9d63146

Browse files
authored
add github pull request workflow (#270)
1 parent af97692 commit 9d63146

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

.github/workflows/pullrequest.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: pull request build
10+
11+
on:
12+
pull_request:
13+
branches: [ "develop" ]
14+
15+
jobs:
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
java: [ '8' , '11', '17' , '21']
22+
name: build with Java ${{ matrix.Java }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Java
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: ${{ matrix.Java }}
29+
distribution: 'temurin'
30+
cache: maven
31+
- name: run headless maven build
32+
uses: coactions/setup-xvfb@v1
33+
with:
34+
run: mvn -B clean verify javadoc:javadoc
35+
options: -screen 0 1280x1024x16

src/test/java/com/tagtraum/perf/gcviewer/exp/SummaryDataWriterTest.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.io.IOException;
88
import java.net.MalformedURLException;
99
import java.net.URL;
10+
import java.text.DecimalFormat;
1011
import java.text.NumberFormat;
1112

1213
import com.tagtraum.perf.gcviewer.exp.impl.SummaryDataWriter;
@@ -19,7 +20,6 @@
1920
import com.tagtraum.perf.gcviewer.model.GCModel;
2021
import com.tagtraum.perf.gcviewer.model.GcResourceFile;
2122
import com.tagtraum.perf.gcviewer.util.MemoryFormat;
22-
2323
import org.hamcrest.Matchers;
2424
import org.junit.BeforeClass;
2525
import org.junit.Test;
@@ -170,11 +170,14 @@ public void testWriteWithZGCPhases() throws IOException {
170170

171171
String csv = output.toString();
172172

173-
assertThat("pausePercentile75th", csv, Matchers.containsString("pausePercentile75th; 0,000934; s"));
174-
assertThat("gcPausePercentile95th", csv, Matchers.containsString("gcPausePercentile95th; 0,000934; s"));
173+
// use locale specific decimalSeparator to check, if the right values are present
174+
char decimalSeparator = new DecimalFormat().getDecimalFormatSymbols().getDecimalSeparator();
175+
176+
assertThat("pausePercentile75th", csv, Matchers.containsString("pausePercentile75th; 0" + decimalSeparator + "000934; s"));
177+
assertThat("gcPausePercentile95th", csv, Matchers.containsString("gcPausePercentile95th; 0" + decimalSeparator + "000934; s"));
175178
assertThat("pauseCount", csv, Matchers.containsString("pauseCount; 1; -"));
176179
assertThat("gcPhaseCount", csv, Matchers.containsString("gcPhaseCount; 3; -"));
177-
assertThat("gcPhaseAverage", csv, Matchers.containsString("gcPhaseAverage; 0,000311; s"));
178-
assertThat("gcPhasePercentile99th", csv, Matchers.containsString("gcPhasePercentile99th; 0,000499; s"));
180+
assertThat("gcPhaseAverage", csv, Matchers.containsString("gcPhaseAverage; 0" + decimalSeparator + "000311; s"));
181+
assertThat("gcPhasePercentile99th", csv, Matchers.containsString("gcPhasePercentile99th; 0" + decimalSeparator + "000499; s"));
179182
}
180183
}

0 commit comments

Comments
 (0)