forked from onflow/flow-go
-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (82 loc) · 2.75 KB
/
test-monitor-flaky.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This workflow runs ALL tests, including all tests that are skipped because they are flaky, as well as all the normal (non-skipped) tests.
# This workflow is run less frequently because running flaky tests is problematic and causes errors.
name: Test Monitor - Flaky
on:
schedule:
- cron: '0 */12 * * *' # every 12 hours
push:
paths:
- 'tools/test_monitor/**'
env:
BIGQUERY_DATASET: production_src_flow_test_metrics
BIGQUERY_TABLE: test_results
GO_VERSION: 1.19
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
flaky-test-run:
name: Test Monitor - Flaky 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 }}
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
continue-on-error: true
run: ./tools/test_monitor/run-tests.sh
env:
TEST_FLAKY: true
JSON_OUTPUT: true
RACE_DETECTOR: 1
- 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
uses: nick-fields/retry@v2
with:
timeout_minutes: 2
max_attempts: 3
command: bq load --source_format=NEWLINE_DELIMITED_JSON $BIGQUERY_DATASET.$BIGQUERY_TABLE $RESULTS_FILE tools/test_monitor/schemas/test_results_schema.json