-
Notifications
You must be signed in to change notification settings - Fork 180
184 lines (174 loc) · 6.23 KB
/
flaky-test-monitor.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# This workflow runs all skipped (flaky) and non-skipped (regular) tests and generates a summary that's uploaded to BigQuery.
name: Flaky Test Monitor
on:
schedule:
- cron: '0 */2 * * *' # every 2 hours
push:
branches:
- 'jp/update-flaky-test-monitor'
paths:
- '.github/workflows/flaky-test-monitor.yml'
env:
BIGQUERY_DATASET: dev_src_flow_test_metrics
BIGQUERY_TABLE: skipped_tests
BIGQUERY_TABLE2: test_results
GO_VERSION: "1.22"
SKIPPED_TESTS_FILE: skipped-tests
RESULTS_FILE: test-results
COMMIT_SHA: ${{ github.sha }}
RUN_ID: ${{ github.run_id }}
JSON_OUTPUT: true
VERBOSE: true
TEST_FLAKY: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
create-dynamic-test-matrix:
name: Create Dynamic Test Matrix
runs-on: ubuntu-latest
outputs:
dynamic-matrix: ${{ steps.set-test-matrix.outputs.dynamicMatrix }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Set Test Matrix
id: set-test-matrix
run: go run utils/test_matrix/test_matrix.go admin cmd consensus engine fvm ledger module network/test network/p2p utils
unit-test:
name: Unit Tests (${{ matrix.targets.name }})
needs: create-dynamic-test-matrix
strategy:
fail-fast: false
matrix:
targets: ${{ fromJSON(needs.create-dynamic-test-matrix.outputs.dynamic-matrix)}}
# need to set image explicitly due to GitHub logging issue as described in https://github.com/onflow/flow-go/pull/3087#issuecomment-1234383202
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Setup tests (${{ matrix.targets.name }})
run: make -e GO_TEST_PACKAGES="${{ matrix.targets.packages }}" install-tools
- name: Run tests (${{ matrix.targets.name }})
run: make -es GO_TEST_PACKAGES="${{ matrix.targets.packages }}" unittest-main > test-output
timeout-minutes: 100
# test run should continue even if there are failed tests
continue-on-error: true
- name: Process test results
env:
TEST_CATEGORY: unit
uses: ./.github/workflows/actions/test-monitor-process-results
with:
service_account: ${{ secrets.FLAKY_TEST_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.FLAKY_TEST_WORKLOAD_IDENTITY_PROVIDER }}
unit-test-modules:
name: Unit Tests (Modules)
strategy:
fail-fast: false
matrix:
include:
- name: crypto
setup: noop
race: 1
test_category: unit-crypto
- name: insecure
setup: install-tools
race: 0
test_category: unit-insecure
- name: integration
setup: install-tools
race: 0
test_category: unit-integration
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Setup tests (${{ matrix.name }})
run: make ${{ matrix.setup }}
- name: Run tests (${{ matrix.name }})
env:
RACE_DETECTOR: ${{ matrix.race }}
run: make -es -C ${{ matrix.name }} test > test-output
timeout-minutes: 100
continue-on-error: true
- name: Process test results (${{ matrix.name }})
env:
TEST_CATEGORY: ${{ matrix.test_category }}
uses: ./.github/workflows/actions/test-monitor-process-results
with:
service_account: ${{ secrets.FLAKY_TEST_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.FLAKY_TEST_WORKLOAD_IDENTITY_PROVIDER }}
integration-test:
name: Integration Tests
strategy:
fail-fast: false
matrix:
include:
- target: access-tests
test_category: integration-access
- target: bft-protocol-tests
test_category: integration-bft-protocol
- target: bft-framework-tests
test_category: integration-bft-framework
- target: bft-gossipsub-tests
test_category: integration-bft-gossipsub
- target: collection-tests
test_category: integration-collection
- target: consensus-tests
test_category: integration-consensus
- target: epochs-cohort1-tests
test_category: integration-epochs
- target: epochs-cohort2-tests
test_category: integration-epochs
- target: execution-tests
test_category: integration-execution
- target: ghost-tests
test_category: integration-ghost
- target: mvp-tests
test_category: integration-mvp
- target: network-tests
test_category: integration-network
- target: verification-tests
test_category: integration-verification
- target: upgrades-tests
test_category: integration-upgrades
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
# all tags are needed for integration tests
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Docker build
run: make docker-native-build-flow docker-native-build-flow-corrupt
- name: Run tests
run: make -es -C integration ${{ matrix.target }} > test-output
timeout-minutes: 100
continue-on-error: true
- name: Process test results
env:
TEST_CATEGORY: ${{ matrix.test_category }}
uses: ./.github/workflows/actions/test-monitor-process-results
with:
service_account: ${{ secrets.FLAKY_TEST_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.FLAKY_TEST_WORKLOAD_IDENTITY_PROVIDER }}