forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
308 lines (251 loc) · 9.46 KB
/
Taskfile.yml
File metadata and controls
308 lines (251 loc) · 9.46 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# https://taskfile.dev
# To run on a system without task installed, `./scripts/run_task.sh` will execute it with `go run`.
# If in the nix dev shell, `task` is available.
# To install nix, `./scripts/run_task.sh install-nix`
# - Tasks should be simple entrypoints to functionality exposed by scripts or code.
# - Avoid the temptation to use task vars to define an API surface. Prefer configuring the
# underlying script or code via CLI args and/or env vars.
version: '3'
tasks:
default: ./scripts/run_task.sh --list
build:
desc: Builds avalanchego
cmd: ./scripts/build.sh
build-antithesis-images-avalanchego:
desc: Builds docker images for antithesis for the avalanchego test setup
env:
TEST_SETUP: avalanchego
cmd: bash -x ./scripts/build_antithesis_images.sh
build-antithesis-images-xsvm:
desc: Builds docker images for antithesis for the xsvm test setup
env:
TEST_SETUP: xsvm
cmd: bash -x ./scripts/build_antithesis_images.sh
build-bootstrap-monitor:
desc: Builds bootstrap-monitor
cmd: ./scripts/build_bootstrap_monitor.sh
build-bootstrap-monitor-image:
desc: Builds docker image for bootstrap-monitor
cmd: ./scripts/build_bootstrap_monitor_image.sh
build-image:
desc: Builds docker image for avalanchego
cmd: ./scripts/build_image.sh
build-race:
desc: Builds avalanchego with race detection enabled
cmd: ./scripts/build.sh -r
build-tmpnetctl:
desc: Builds tmpnetctl
cmd: ./scripts/build_tmpnetctl.sh
build-xsvm:
desc: Builds xsvm plugin
cmd: ./scripts/build_xsvm.sh
build-xsvm-image:
desc: Builds xsvm image
cmd: ./scripts/build_xsvm_image.sh
check-clean-branch:
desc: Checks that the git working tree is clean
cmd: .github/workflows/check-clean-branch.sh
check-generate-canoto:
desc: Checks that generated canoto is up-to-date (requires a clean git working tree)
cmds:
- task: generate-canoto
- task: check-clean-branch
check-generate-load-contract-bindings:
desc: Checks that generated load contract bindings are up-to-date (requires a clean git working tree)
cmds:
- task: generate-load-contract-bindings
- task: check-clean-branch
check-generate-mocks:
desc: Checks that generated mocks are up-to-date (requires a clean git working tree)
cmds:
- task: generate-mocks
- task: check-clean-branch
check-generate-protobuf:
desc: Checks that generated protobuf is up-to-date (requires a clean git working tree)
cmds:
- task: generate-protobuf
- task: check-clean-branch
check-go-mod-tidy:
desc: Checks that go.mod and go.sum are up-to-date (requires a clean git working tree)
cmds:
- cmd: go mod tidy
- task: check-clean-branch
- cmd: go mod tidy
dir: tools
- task: check-clean-branch
create-kind-cluster:
desc: Creates the default kind cluster
cmd: bash -x ./scripts/start_kind_cluster.sh {{.CLI_ARGS}}
delete-kind-cluster:
desc: Deletes the default kind cluster
cmd: kind delete cluster
export-cchain-block-range:
desc: Export range of C-Chain blocks from source to target directory.
cmd: go run github.com/ava-labs/avalanchego/tests/reexecute/blockexport {{.CLI_ARGS}}
generate-mocks:
desc: Generates testing mocks
cmds:
# Avoid deleting mocks in grafted modules
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | grep -v '^./graft' | xargs -r rm
- cmd: go generate -run "mockgen" ./...
generate-canoto:
desc: Generates canoto
cmd: go generate -run "canoto" ./...
generate-load-contract-bindings:
desc: Generates load contract bindings
cmds:
- cmd: grep -lr -E '^// Code generated - DO NOT EDIT\.$' tests/load | xargs -r rm
- cmd: go generate ./tests/load/...
generate-protobuf:
desc: Generates protobuf
cmd: ./scripts/protobuf_codegen.sh
ginkgo-build:
desc: Runs ginkgo against the current working directory
cmd: ./bin/ginkgo build {{.USER_WORKING_DIR}}
import-chain-data:
desc: Imports the C-Chain block and state data to re-execute.
cmd: ./scripts/import_cchain_data.sh
install-nix:
desc: Installs nix with an OS-appropriate installer
cmd: ./scripts/install_nix.sh
lint:
desc: Runs static analysis tests of golang code
cmd: ./scripts/lint.sh
lint-fix:
desc: Runs automated fixing for failing static analysis of golang code
cmd: ./scripts/run_tool.sh golangci-lint run --config .golangci.yml --fix
lint-action:
desc: Runs actionlint to check sanity of github action configuration
cmd: ./scripts/actionlint.sh
lint-all:
desc: Runs all lint checks in parallel
deps:
- lint
- lint-action
- lint-shell
lint-all-ci:
desc: Runs all lint checks one-by-one
cmds:
- task: lint
- task: lint-action
- task: lint-shell
lint-shell:
desc: Runs shellcheck to check sanity of shell scripts
cmd: ./scripts/shellcheck.sh
test-bootstrap-monitor-e2e:
desc: Runs bootstrap monitor e2e tests
cmd: bash -x ./scripts/tests.e2e.bootstrap_monitor.sh
test-build-antithesis-images-avalanchego:
desc: Tests the build of antithesis images for the avalanchego test setup
env:
TEST_SETUP: avalanchego
cmds:
- task: build-race
- cmd: go run ./tests/antithesis/avalanchego --avalanchego-path=./build/avalanchego --duration=120s
- cmd: bash -x ./scripts/tests.build_antithesis_images.sh
test-build-antithesis-images-xsvm:
desc: Tests the build of antithesis images for the xsvm test setup
env:
TEST_SETUP: xsvm
cmds:
- task: build-race
- task: build-xsvm
- cmd: go run ./tests/antithesis/xsvm --avalanchego-path=./build/avalanchego --duration=120s
- cmd: bash -x ./scripts/tests.build_antithesis_images.sh
test-build-image:
# On mac, docker/podman/lima should work out-of-the-box.
# On linux, requires qemu (e.g. apt -y install qemu-system qemu-user-static).
desc: Runs test of cross-platform docker image build
cmd: bash -x scripts/tests.build_image.sh
test-cchain-reexecution:
desc: Runs C-Chain re-execution test. Run without args to see available tests.
cmd: ./scripts/benchmark_cchain_range.sh {{.CLI_ARGS}}
test-e2e:
desc: Runs e2e tests
cmds:
- task: build
- task: build-xsvm
- cmd: bash -x ./scripts/tests.e2e.sh {{.CLI_ARGS}}
test-e2e-ci:
desc: Runs e2e tests [serially with race detection enabled]
env:
E2E_SERIAL: 1
cmds:
- task: build-race
- task: build-xsvm
- cmd: bash -x ./scripts/tests.e2e.sh {{.CLI_ARGS}}
test-e2e-existing-ci:
desc: Runs e2e tests with an existing network [serially with race detection enabled]
env:
E2E_SERIAL: 1
cmds:
- task: build-race
- task: build-xsvm
- cmd: bash -x ./scripts/tests.e2e.existing.sh {{.CLI_ARGS}}
test-e2e-kube:
desc: Runs e2e tests against a network deployed to kube
cmds:
- cmd: bash -x ./scripts/tests.e2e.kube.sh {{.CLI_ARGS}}
test-e2e-kube-ci:
# Free github action runners do not have sufficient resources to reliably run a full e2e run against a kube-hosted network
desc: Runs the xsvm e2e tests in serial against a network deployed to kube
env:
E2E_SERIAL: 1
cmds:
- cmd: bash -x ./scripts/tests.e2e.kube.sh --ginkgo.focus-file=xsvm.go {{.CLI_ARGS}}
# To use a different fuzz time, run `task test-fuzz FUZZTIME=[value in seconds]`.
# A value of `-1` will run until it encounters a failing output.
test-fuzz:
desc: Runs each fuzz test for 10 seconds
vars:
FUZZTIME: '{{.FUZZTIME| default "10"}}'
cmd: ./scripts/build_fuzz.sh {{.FUZZTIME}}
test-fuzz-long:
desc: Runs each fuzz test for 180 seconds
vars:
FUZZTIME: '{{.FUZZTIME| default "180"}}'
cmd: ./scripts/build_fuzz.sh {{.FUZZTIME}}
test-fuzz-merkledb:
desc: Runs each merkledb fuzz test for 15 minutes
vars:
FUZZTIME: '{{.FUZZTIME| default "900"}}'
cmd: ./scripts/build_fuzz.sh {{.FUZZTIME}} ./x/merkledb
test-load:
desc: Runs load tests
cmds:
- task: generate-load-contract-bindings
- task: build
- cmd: go run ./tests/load/main --avalanchego-path=./build/avalanchego {{.CLI_ARGS}}
test-load-exclusive:
desc: Runs load tests against kube with exclusive scheduling
cmds:
- cmd: go run ./tests/load/main --runtime=kube --kube-use-exclusive-scheduling {{.CLI_ARGS}}
test-load-kube:
desc: Runs load tests against a kubernetes cluster
cmds:
- task: generate-load-contract-bindings
- cmd: go run ./tests/load/main --runtime=kube {{.CLI_ARGS}}
test-load-kube-kind:
desc: Runs load tests against a kind cluster
cmds:
- task: generate-load-contract-bindings
- cmd: bash -x ./scripts/tests.load.kube.kind.sh {{.CLI_ARGS}}
test-robustness:
desc: Deploys kind with chaos mesh. Intended to eventually run a robustness (fault-injection) test suite.
cmds:
- ./bin/tmpnetctl start-kind-cluster --install-chaos-mesh
test-unit:
desc: Runs unit tests
# Invoking with bash ensures compatibility with CI execution on Windows
cmd: bash ./scripts/build_test.sh
test-unit-fast:
desc: Runs unit tests
env:
NO_SHUFFLE: TRUE # Allows caching
NO_RACE: TRUE # Tests are much faster without race detection
cmd: bash ./scripts/build_test.sh
test-upgrade:
desc: Runs upgrade tests
cmds:
- task: build
- cmd: bash -x ./scripts/tests.upgrade.sh {{.CLI_ARGS}}