Skip to content

Commit

Permalink
FISH-8905 - fix test + add verify_pr workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
simonladen committed Jul 23, 2024
1 parent 4d7f475 commit 65a1214
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/verify_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Verify PR

on:
pull_request:
branches: [ master, Payara6, Payara4, Payara7 ]
paths-ignore:
- 'README.*'
- '**/README.*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8

- name: Cache repository
uses: actions/cache@v2
with:
path: |
~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Clean snapshot dependencies
run: "test -d ~/.m2/repository && find ~/.m2/repository/ -name '*-SNAPSHOT' -type d -print0 | xargs -0 rm -r"
continue-on-error: true

- name: Build with Maven
env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.rto=30000 -Djava.net.preferIPv4Stack=true
run: mvn -B -V clean verify

- name: Archive logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs
path: "**/*.log"
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ public void metricMeasures() {
}
}
*/
assertEquals(counter, metrics.getJsonObject("application").getJsonNumber("fish.payara.bomdemo.metric.MetricController.endpoint_counter").longValue());
JsonObject app = metrics.getJsonObject("application");
String key = app.keySet().stream().filter(s -> s.contains("endpoint_counter")).findFirst().orElseThrow(() -> new AssertionError(
"endpoint_counter should be present in " + app));
assertEquals(counter, metrics.getJsonObject("application").getJsonNumber(key).longValue());
assertNotNull(metrics.getJsonObject("application").getJsonObject("fish.payara.bomdemo.metric.MetricController.timed-request"));
}

Expand Down

0 comments on commit 65a1214

Please sign in to comment.