Server timing header #1096
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java Agent Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
paths-ignore: | |
- 'components/**' | |
- 'inspectit-ocelot-documentation/**' | |
- 'resources/**' | |
- 'codequality/**' | |
- '**.md' | |
- '**.txt' | |
- '.github/**' | |
- '.circleci/**' | |
workflow_call: | |
jobs: | |
pr-check: | |
name: 'Agent Tests (${{ matrix.dockerimage }})' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dockerimage: | |
- 'ibmcom/ibmjava:8-sdk' | |
- 'eclipse-temurin:8' | |
- 'eclipse-temurin:11' | |
- 'eclipse-temurin:17' | |
container: ${{ matrix.dockerimage }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: assemble | |
run: ./gradlew :inspectit-ocelot-core:assemble | |
- name: test | |
run: ./gradlew :inspectit-ocelot-core:test --no-daemon | |
- name: systemTest | |
run: ./gradlew :inspectit-ocelot-agent:systemTest | |
- name: upload test results | |
uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: 'test-results' | |
path: | | |
inspectit-ocelot-agent/build/test-results | |
inspectit-ocelot-core/build/test-results | |
inspectit-ocelot-core/build/reports | |
inspectit-ocelot-config/build/test-results | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
container: eclipse-temurin:8-jdk | |
needs: [ pr-check ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Run code coverage | |
run: ./gradlew codeCoverageReport | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
name: codecov-ocelot-agent | |
files: ./build/reports/jacoco/report.xml | |
flags: unittests | |
verbose: true | |
jmh-compile: | |
name: 'Compile JMH Tests' | |
runs-on: ubuntu-latest | |
container: eclipse-temurin:8-jdk | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: jmhCompile | |
run: ./gradlew jmhCompile | |
attach-alpine-jdk8: | |
name: 'Runtime Attachment' | |
runs-on: ubuntu-latest | |
container: eclipse-temurin:8-jdk-alpine | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: assemble | |
run: ./gradlew assemble | |
- name: attach | |
run: | | |
apk update && apk add curl | |
echo "class Dummy{public static void main(String[] args)throws InterruptedException{while (true){Thread.sleep(1000);}}}" > Dummy.java | |
javac Dummy.java | |
$(nohup java Dummy > out.txt &) | |
processId=$( ps -e -o pid,comm,args | grep 'java Dummy' | awk '{ if ($2=="java") print $1 }' ) | |
pwd | |
java -jar inspectit-ocelot-agent/build/inspectit-ocelot-agent-SNAPSHOT.jar $processId '{"inspectit.exporters.metrics.prometheus.enabled":"ENABLED"}' | |
curl -4 -o /dev/null -s -w "%{http_code}" --connect-timeout 2 --max-time 2 --retry 3 --retry-delay 3 --retry-max-time 10 --retry-connrefuse http://localhost:8888 |