Skip to content

Commit

Permalink
TESTING
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed May 29, 2021
1 parent 8fc3ac7 commit 8f4629b
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 71 deletions.
259 changes: 226 additions & 33 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,154 @@ on:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
includeProfiler: [ false, true ]
fail-fast: false
webflux-smoke-test-1:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

webflux-smoke-test-2:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

webflux-smoke-test-3:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

webflux-smoke-test-4:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

webflux-smoke-test-5:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

webflux-smoke-test-6:
runs-on: ubuntu-latest
steps:
- name: Support longpaths
run: git config --system core.longpaths true
if: matrix.os == 'windows-latest'
- name: Check out repository
uses: actions/checkout@v2
with:
Expand All @@ -32,6 +169,8 @@ jobs:
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
Expand All @@ -40,31 +179,39 @@ jobs:
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew check -PincludeProfiler=${{ matrix.includeProfiler }} --stacktrace
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

setup-smoke-test-matrix:
webflux-smoke-test-7:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 11 for running Gradle
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- id: set-matrix
# "grep -v skipWinNative" is used to skip the warning message "Skipping build of :etw:native because skipWinNative=true"
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q :test:smoke:testApps:listTestApps | grep -v skipWinNative | xargs echo | sed 's/ /","/g')\"]}"
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

smoke-test:
needs: setup-smoke-test-matrix
webflux-smoke-test-8:
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.setup-smoke-test-matrix.outputs.matrix)}}
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -90,16 +237,62 @@ jobs:
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew ${{ matrix.module }}:smokeTest
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

accept-pr:
needs: [ build, smoke-test ]
webflux-smoke-test-9:
runs-on: ubuntu-latest
if: always()
steps:
# run this action to get workflow conclusion
# You can get conclusion by env (env.WORKFLOW_CONCLUSION)
- uses: technote-space/workflow-conclusion-action@v2
- name: Fail build
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
run: exit 1
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest

webflux-smoke-test-10:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Init and update otel submodule
run: |
git submodule init
git submodule update
- name: Restore cache
uses: burrunan/gradle-cache-action@v1
with:
read-only: true
- name: Build otel-fork
run: |
cd otel
# TODO why does this error only happen in GHA, without "-x signMavenPublication"?
# "Cannot perform signing task ':instrumentation-api:signMavenPublication' because it has no configured signatory"
./gradlew publishToMavenLocal -x signMavenPublication
- name: Test
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
run: ./gradlew :test:smoke:testApps:WebFlux:smokeTest
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,4 @@ public void doMostBasicTest() throws Exception {
assertTrue(rd.getProperties().isEmpty());
assertTrue(rd.getSuccess());
}

@Test
@TargetUri("/exception")
public void testException() throws Exception {
List<Envelope> rdList = mockedIngestion.waitForItems("RequestData", 1);

Envelope rdEnvelope = rdList.get(0);
String operationId = rdEnvelope.getTags().get("ai.operation.id");

mockedIngestion.waitForItemsInOperation("RemoteDependencyData", 1, operationId);
assertEquals(0, mockedIngestion.getCountForType("EventData"));

RequestData rd = (RequestData) ((Data<?>) rdEnvelope.getData()).getBaseData();

assertEquals("GET /exception", rd.getName());
assertEquals("500", rd.getResponseCode());
assertTrue(rd.getProperties().isEmpty());
assertFalse(rd.getSuccess());
}

@Test
@TargetUri("/futureException")
public void testFutureException() throws Exception {
List<Envelope> rdList = mockedIngestion.waitForItems("RequestData", 1);

Envelope rdEnvelope = rdList.get(0);
String operationId = rdEnvelope.getTags().get("ai.operation.id");

mockedIngestion.waitForItemsInOperation("RemoteDependencyData", 1, operationId);
assertEquals(0, mockedIngestion.getCountForType("EventData"));

RequestData rd = (RequestData) ((Data<?>) rdEnvelope.getData()).getBaseData();

assertEquals("GET /futureException", rd.getName());
assertEquals("500", rd.getResponseCode());
assertTrue(rd.getProperties().isEmpty());
assertFalse(rd.getSuccess());
}
}

0 comments on commit 8f4629b

Please sign in to comment.