Skip to content

Commit

Permalink
Add Foresight Github actions to collect detailed workflow metrics and…
Browse files Browse the repository at this point in the history
… test results (#16427)
  • Loading branch information
Serkan ÖZAL committed Nov 28, 2022
1 parent 887fa9a commit 5dc292d
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 7 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
runs-on: windows-latest
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }}
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- if: matrix.group == 'receiver-0'
Expand All @@ -56,7 +61,16 @@ jobs:
~\AppData\Local\go-build
key: go-build-cache-${{ runner.os }}-${{ matrix.group }}-go-${{ hashFiles('**/go.sum') }}
- name: Run Unit tests
run: make -j2 gotest GROUP=${{ matrix.group }}
run: make -j2 gotest GROUP=${{ matrix.group }}
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: golang
test_format: json
test_path: |
./**/foresight-test*.json
windows-unittest:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }}
runs-on: windows-latest
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -75,6 +80,11 @@ jobs:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -122,6 +132,11 @@ jobs:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -180,6 +195,11 @@ jobs:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -207,6 +227,15 @@ jobs:
key: go-test-build-${{ runner.os }}-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: make gotest GROUP=${{ matrix.group }}
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: golang
test_format: json
test_path: |
./**/foresight-test*.json
unittest:
if: ${{ always() }}
strategy:
Expand All @@ -231,6 +260,11 @@ jobs:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand All @@ -247,11 +281,28 @@ jobs:
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Run Integration Tests
run: make integration-tests-with-cover
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: golang
test_format: json
test_path: |
./**/foresight-test-report-integration*.json
coverage_format: golang
coverage_path: |
./**/integration-coverage.txt
correctness-traces:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand All @@ -274,10 +325,24 @@ jobs:
run: make install-tools
- name: Correctness
run: make -C testbed run-correctness-traces-tests
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: golang
test_format: json
test_path: |
./**/foresight-test*.json
correctness-metrics:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand All @@ -300,11 +365,25 @@ jobs:
run: make install-tools
- name: Correctness
run: make -C testbed run-correctness-metrics-tests
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: golang
test_format: json
test_path: |
./**/foresight-test*.json
build-examples:
runs-on: ubuntu-latest
needs: [setup-environment]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build Examples
Expand Down Expand Up @@ -339,6 +418,11 @@ jobs:
- os: windows
arch: ppc64le
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -376,6 +460,11 @@ jobs:
matrix:
package_type: ["deb", "rpm"]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -418,6 +507,11 @@ jobs:
runs-on: windows-latest
needs: [cross-compile]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -454,6 +548,11 @@ jobs:
runs-on: ubuntu-latest
needs: [build-package]
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Download Binaries
Expand All @@ -473,6 +572,11 @@ jobs:
needs: [lint, unittest, integration-tests, build-package]
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && github.repository == 'open-telemetry/opentelemetry-collector-contrib'
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -538,6 +642,11 @@ jobs:
needs: [lint, unittest, integration-tests, build-package]
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'open-telemetry/opentelemetry-collector-contrib'
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'on'

steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}

- name: Checkout repository
uses: actions/checkout@v3

Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
outputs:
loadtest_matrix: ${{ steps.splitloadtest.outputs.loadtest_matrix }}
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
Expand Down Expand Up @@ -61,6 +66,11 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.setup-environment.outputs.loadtest_matrix) }}
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- run: sudo chmod 0777 -R /opt
Expand Down Expand Up @@ -119,6 +129,15 @@ jobs:
uses: actions/upload-artifact@v3
with:
path: ./*.tar
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: JUNIT
test_format: JUNIT
test_path: |
./testbed/tests/results/junit/*.xml
- name: GitHub Issue Generator
if: ${{ failure() && github.ref == 'refs/heads/main' }}
run: issuegenerator $TEST_RESULTS
16 changes: 15 additions & 1 deletion .github/workflows/prometheus-compliance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -48,5 +53,14 @@ jobs:
- name: Copy binary to compliance directory
run: mkdir compliance/remote_write_sender/bin && cp opentelemetry-collector-contrib/bin/otelcontribcol_linux_amd64 compliance/remote_write_sender/bin/otelcol_linux_amd64
- name: Run compliance tests
run: go test --tags=compliance -run "TestRemoteWrite/otel/.+" -v ./
run: go test -v -json --tags=compliance -run "TestRemoteWrite/otel/.+" ./ > ./test-report.json
working-directory: compliance/remote_write_sender
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
working_directory: compliance/remote_write_sender
test_framework: golang
test_format: json
test_path: ./test-report.json
15 changes: 15 additions & 0 deletions .github/workflows/tracegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build tracegen
Expand All @@ -30,6 +35,11 @@ jobs:
permissions:
packages: write
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
Expand All @@ -51,6 +61,11 @@ jobs:
permissions:
packages: write
steps:
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set Release Tag
Expand Down
Loading

0 comments on commit 5dc292d

Please sign in to comment.