Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pull request workflow #270

Merged
merged 4 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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"));
}
}