From 0621d0b18f8d31b0639e537bae25cbd6e9a199bd Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sat, 29 May 2021 12:00:57 -0700 Subject: [PATCH] TESTING --- .github/workflows/pr.yaml | 114 +++++++++++++----- .../smoketest/WebFluxTest.java | 38 ------ 2 files changed, 81 insertions(+), 71 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1456ba4cd5c..046d6a79c84 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,17 +7,9 @@ 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: Support longpaths - run: git config --system core.longpaths true - if: matrix.os == 'windows-latest' - name: Check out repository uses: actions/checkout@v2 with: @@ -32,6 +24,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 @@ -40,31 +34,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-2: 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-3: 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 @@ -90,16 +92,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-4: 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-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 diff --git a/test/smoke/testApps/WebFlux/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/WebFluxTest.java b/test/smoke/testApps/WebFlux/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/WebFluxTest.java index e2c7174eae3..c5df391203c 100644 --- a/test/smoke/testApps/WebFlux/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/WebFluxTest.java +++ b/test/smoke/testApps/WebFlux/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/WebFluxTest.java @@ -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 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 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()); - } }