-
Notifications
You must be signed in to change notification settings - Fork 736
/
Copy pathTaskfile.yml
206 lines (168 loc) · 5.97 KB
/
Taskfile.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# 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.
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
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-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
generate-mocks:
desc: Generates testing mocks
cmds:
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
- cmd: go generate -run "go.uber.org/mock/mockgen" ./...
generate-canoto:
desc: Generates canoto
cmd: go generate -run "github.com/StephenButtolph/canoto/canoto" ./...
generate-protobuf:
desc: Generates protobuf
cmd: ./scripts/protobuf_codegen.sh
install-nix:
desc: Installs nix with the determinate systems installer
cmd: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
lint:
desc: Runs static analysis tests of golang code
cmd: ./scripts/lint.sh
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-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}}
# 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-unit:
desc: Runs unit tests
# Invoking with bash ensures compatibility with CI execution on Windows
cmd: bash ./scripts/build_test.sh
test-upgrade:
desc: Runs upgrade tests
cmds:
- task: build
- cmd: bash -x ./scripts/tests.upgrade.sh {{.CLI_ARGS}}