Skip to content

Test Monitor - Regular and Skipped #14

Test Monitor - Regular and Skipped

Test Monitor - Regular and Skipped #14

# This workflow
# 1) runs all non-skipped (regular) tests and generates a summary.
# 2) generates a report of all skipped tests (e.g. due to flakiness).
name: Test Monitor - Regular and Skipped
on:
schedule:
- cron: '0 */2 * * *' # every 2 hours
push:
paths:
- 'tools/test_monitor/**'
env:
BIGQUERY_DATASET: production_src_flow_test_metrics
BIGQUERY_TABLE: skipped_tests
BIGQUERY_TABLE2: test_results
GO_VERSION: 1.19
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
regular-skipped-test-run:
name: Test Monitor - Regular, Skipped Tests Run
strategy:
fail-fast: false
matrix:
test-category:
- unit
- unit-crypto
- unit-insecure
- unit-integration
- integration-bft
- integration-mvp
- integration-ghost
- integration-network
- integration-epochs
- integration-access
- integration-collection
- integration-consensus
- integration-execution
- integration-verification
env:
TEST_CATEGORY: ${{ matrix.test-category }}
COMMIT_SHA: ${{ github.sha }}
RUN_ID: ${{ github.run_id }}
SKIPPED_TESTS_FILE: skipped-tests
RESULTS_FILE: test-results
runs-on: ubuntu-latest
steps:
- name: Get job run date
id: job_run_date
run: echo "::set-output name=date::$(TZ=":America/Los_Angeles" date -Iseconds)"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ env.COMMIT_SHA }}
- name: Get commit date
id: commit_date
run: echo "::set-output name=date::$(git show --no-patch --no-notes --pretty='%cI' $COMMIT_SHA)"
- name: Run tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 60
max_attempts: 5
command: ./tools/test_monitor/run-tests.sh
env:
JSON_OUTPUT: true
- name: Print test results
run: cat test-output
- name: Process test results
run: cat test-output | go run tools/test_monitor/level1/process_summary1_results.go
env:
JOB_STARTED: ${{ steps.job_run_date.outputs.date }}
COMMIT_DATE: ${{ steps.commit_date.outputs.date }}
- name: Upload results to BigQuery (skipped tests)
uses: nick-fields/retry@v2
with:
timeout_minutes: 1
max_attempts: 3
command: bq load --source_format=NEWLINE_DELIMITED_JSON $BIGQUERY_DATASET.$BIGQUERY_TABLE $SKIPPED_TESTS_FILE tools/test_monitor/schemas/skipped_tests_schema.json
- name: Upload results to BigQuery (test run)
uses: nick-fields/retry@v2
with:
timeout_minutes: 2
max_attempts: 3
command: bq load --source_format=NEWLINE_DELIMITED_JSON $BIGQUERY_DATASET.$BIGQUERY_TABLE2 $RESULTS_FILE tools/test_monitor/schemas/test_results_schema.json