diff --git a/.github/workflows/pullrequest.yaml b/.github/workflows/pullrequest.yaml new file mode 100644 index 00000000..e880289b --- /dev/null +++ b/.github/workflows/pullrequest.yaml @@ -0,0 +1,35 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: pull request build + +on: + pull_request: + branches: [ "develop" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' , '11', '17' , '21'] + name: build with Java ${{ matrix.Java }} + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.Java }} + distribution: 'temurin' + cache: maven + - name: run headless maven build + uses: coactions/setup-xvfb@v1 + with: + run: mvn -B clean verify javadoc:javadoc + options: -screen 0 1280x1024x16 diff --git a/src/test/java/com/tagtraum/perf/gcviewer/exp/SummaryDataWriterTest.java b/src/test/java/com/tagtraum/perf/gcviewer/exp/SummaryDataWriterTest.java index ec2ecd20..f0a03ea5 100644 --- a/src/test/java/com/tagtraum/perf/gcviewer/exp/SummaryDataWriterTest.java +++ b/src/test/java/com/tagtraum/perf/gcviewer/exp/SummaryDataWriterTest.java @@ -7,6 +7,7 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.text.DecimalFormat; import java.text.NumberFormat; import com.tagtraum.perf.gcviewer.exp.impl.SummaryDataWriter; @@ -19,7 +20,6 @@ import com.tagtraum.perf.gcviewer.model.GCModel; import com.tagtraum.perf.gcviewer.model.GcResourceFile; import com.tagtraum.perf.gcviewer.util.MemoryFormat; - import org.hamcrest.Matchers; import org.junit.BeforeClass; import org.junit.Test; @@ -170,11 +170,14 @@ public void testWriteWithZGCPhases() throws IOException { String csv = output.toString(); - assertThat("pausePercentile75th", csv, Matchers.containsString("pausePercentile75th; 0,000934; s")); - assertThat("gcPausePercentile95th", csv, Matchers.containsString("gcPausePercentile95th; 0,000934; s")); + // use locale specific decimalSeparator to check, if the right values are present + char decimalSeparator = new DecimalFormat().getDecimalFormatSymbols().getDecimalSeparator(); + + assertThat("pausePercentile75th", csv, Matchers.containsString("pausePercentile75th; 0" + decimalSeparator + "000934; s")); + assertThat("gcPausePercentile95th", csv, Matchers.containsString("gcPausePercentile95th; 0" + decimalSeparator + "000934; s")); assertThat("pauseCount", csv, Matchers.containsString("pauseCount; 1; -")); assertThat("gcPhaseCount", csv, Matchers.containsString("gcPhaseCount; 3; -")); - assertThat("gcPhaseAverage", csv, Matchers.containsString("gcPhaseAverage; 0,000311; s")); - assertThat("gcPhasePercentile99th", csv, Matchers.containsString("gcPhasePercentile99th; 0,000499; s")); + assertThat("gcPhaseAverage", csv, Matchers.containsString("gcPhaseAverage; 0" + decimalSeparator + "000311; s")); + assertThat("gcPhasePercentile99th", csv, Matchers.containsString("gcPhasePercentile99th; 0" + decimalSeparator + "000499; s")); } }