Skip to content

Commit b145321

Browse files
committed
cleanup
1 parent a0c287e commit b145321

File tree

4 files changed

+56
-28
lines changed

4 files changed

+56
-28
lines changed

.evergreen/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ functions:
101101
go install github.com/go-task/task/v3/cmd/task@latest
102102
103103
# Install libmongocrypt.
104-
bash etc/install-libmongocrypt.sh
104+
task install-libmongocrypt
105105
if [ "Windows_NT" = "$OS" ]; then
106106
export PATH=$PATH:/cygdrive/c/libmongocrypt/bin
107107
fi
@@ -279,7 +279,7 @@ functions:
279279
script: |
280280
${PREPARE_SHELL}
281281
export OIDC="oidc"
282-
bash ${PROJECT_DIRECTORY}/etc/run-oidc-test.sh 'task --silent evg-test-oidc-auth'
282+
task test-oidc
283283
284284
run-task:
285285
- command: shell.exec
@@ -312,7 +312,7 @@ functions:
312312
${PREPARE_SHELL}
313313
export BASE_SHA=${revision}
314314
export HEAD_SHA=${github_commit}
315-
bash etc/api_report.sh
315+
task api-report
316316
317317
"add PR labels":
318318
- command: shell.exec
@@ -394,7 +394,7 @@ functions:
394394
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
395395
script: |
396396
${PREPARE_SHELL}
397-
bash etc/run-atlas-test.sh
397+
task run-atlas
398398
399399
run-ocsp-test:
400400
- command: shell.exec
@@ -525,8 +525,8 @@ functions:
525525
working_dir: src/go.mongodb.org/mongo-driver
526526
script: |
527527
${PREPARE_SHELL}
528-
bash etc/run_docker.sh
529-
TOPOLOGY=sharded_cluster bash etc/run_docker.sh test-short
528+
task run-docker
529+
TOPOLOGY=sharded_cluster task run-docker -- test-short
530530
531531
run-valid-ocsp-server:
532532
- command: shell.exec
@@ -1780,7 +1780,7 @@ tasks:
17801780
working_dir: src/go.mongodb.org/mongo-driver
17811781
script: |
17821782
${PREPARE_SHELL}
1783-
bash etc/run-awskms-test.sh
1783+
task test-awskms
17841784
17851785
- name: "testawskms-fail-task"
17861786
# testawskms-fail-task runs without environment variables.
@@ -1794,7 +1794,7 @@ tasks:
17941794
script: |
17951795
${PREPARE_SHELL}
17961796
export EXPECT_ERROR='status=400'
1797-
bash etc/run-awskms-test.sh
1797+
task test-awskms
17981798
17991799
- name: "testazurekms-task"
18001800
commands:

Taskfile.yml

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77

88
tasks:
99

10-
### Utility targets. ###
10+
### Utility tasks. ###
1111
default:
1212
deps: [build, check-license, check-fmt, check-modules, lint, test-short]
1313

@@ -33,8 +33,6 @@ tasks:
3333
- GOOS=linux GOARCH=ppc64le go build ./...
3434
- GOOS=linux GOARCH=s390x go build ./...
3535

36-
install-lll: go install github.com/walle/lll/...@latest
37-
3836
check-fmt:
3937
deps: [install-lll]
4038
cmds:
@@ -46,12 +44,15 @@ tasks:
4644

4745
fmt: go fmt ./...
4846

49-
# NOTE: A golangci-lint version is also pinned in .pre-commit-config.yaml. Make
50-
# sure to change it there to keep it in-sync with what's used here!
51-
install-golangci-lint:
52-
- go install github.com/golangci/golangci-lint/cmd/[email protected]
47+
api-report: etc/api_report.sh
48+
49+
install-libmongocrypt: etc/install-libmongocrypt.sh
5350

54-
# Lint with various GOOS and GOARCH targets to catch static analysis failures that may only affect
51+
run-docker: etc/run_docker.sh
52+
53+
cherry-picker: etc/cherry-picker.sh
54+
55+
# Lint with various GOOS and GOARCH tasks to catch static analysis failures that may only affect
5556
# specific operating systems or architectures. For example, staticcheck will only check for 64-bit
5657
# alignment of atomically accessed variables on 32-bit architectures (see
5758
# https://staticcheck.io/docs/checks#SA1027)
@@ -67,7 +68,7 @@ tasks:
6768

6869
update-notices: etc/generate_notices.pl > THIRD-PARTY-NOTICES
6970

70-
### Local testing targets. ###
71+
### Local testing tasks. ###
7172
test: go test ${BUILD_TAGS} -timeout {{.TEST_TIMEOUT}}s -p 1 ./...
7273

7374
test-cover:
@@ -78,14 +79,20 @@ tasks:
7879

7980
test-short: go test ${BUILD_TAGS} -timeout 60s -short ./...
8081

81-
### Local FaaS targets. ###
82+
test-oidc: etc/run-oidc-test.sh 'task --silent evg-test-oidc-auth'
83+
84+
test-atlas: etc/run-atlas-test.sh
85+
86+
test-awskms: etc/run-awskms-test.sh
87+
88+
### Local FaaS tasks. ###
8289
build-faas-awslambda:
8390
requires:
8491
vars: [MONGODB_URI]
8592
cmds:
8693
- make -c internal/cmd/faas/awslambda
8794

88-
### Evergreen specific targets. ###
95+
### Evergreen specific tasks. ###
8996
build-aws-ecs-test: go build ${BUILD_TAGS} ./internal/cmd/testaws/main.go
9097

9198
evg-test:
@@ -160,15 +167,31 @@ tasks:
160167

161168
build-kms-test: go build ${BUILD_TAGS} ./internal/cmd/testkms
162169

163-
### Benchmark specific targets and support. ###
170+
### Benchmark specific tasks and support. ###
164171
benchmark:
165-
deps: [perf]
172+
deps: [perf-files]
166173
cmds:
167174
- go test ${BUILD_TAGS} -benchmem -bench=. ./benchmark | test benchmark.suite
168175

169176
driver-benchmark:
170-
deps: [perf]
177+
deps: [perf-files]
171178
cmds:
172179
- go run ./internal/cmd/benchmark | tee perf.suite
173180

174-
perf: etc/prep-perf.sh
181+
### Internal tasks. ###
182+
perf-files:
183+
internal: true
184+
cmds:
185+
- etc/prep-perf.sh
186+
187+
install-lll:
188+
internal: true
189+
cmds:
190+
- go install github.com/walle/lll/...@latest
191+
192+
# NOTE: A golangci-lint version is also pinned in .pre-commit-config.yaml. Make
193+
# sure to change it there to keep it in-sync with what's used here!
194+
install-golangci-lint:
195+
internal: true
196+
cmds:
197+
- go install github.com/golangci/golangci-lint/cmd/[email protected]

docs/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ git config --global github.user <github_handle>
7575
If a Pull Request needs to be cherry-picked to a new branch, get the sha of the commit in the base branch, and then run
7676

7777
```bash
78-
bash etc/cherry-picker.sh <sha>
78+
task cherry-picker -- <sha>
7979
```
8080

8181
By default it will use `master` as the target branch. The branch can be specified as the second argument, e.g.
8282

8383
```bash
84-
bash etc/cherry-picker.sh <sha> branch
84+
task cherry-picker -- <sha> branch
8585
```
8686

8787
It will create a new checkout in a temp dir, create a new branch, perform the cherry-pick, and then
@@ -91,7 +91,7 @@ prompt before creating a PR to the target branch.
9191

9292
The driver tests can be run against several database configurations. The most simple configuration is a standalone mongod with no auth, no ssl, and no compression. To run these basic driver tests, make sure a standalone MongoDB server instance is running at localhost:27017. To run the tests, you can run `task`. This will run coverage, run go-lint, run go-vet, and build the examples.
9393

94-
You can install `libmongocrypt` locally by running `bash etc/build-libmongocrypt.sh`, which will create an `install` directory
94+
You can install `libmongocrypt` locally by running `task install-libmongocrypt`, which will create an `install` directory
9595
in the repository top level directory. On Windows you will also need to add `c:/libmongocrypt/` to your `PATH`.
9696

9797
### Testing Different Topologies
@@ -227,7 +227,7 @@ See the readme in `$DRIVERS_TOOLS/.evergreen/docker` for more information on usa
227227
1. Finally, run the Go Driver tests using the following script in this repo:
228228

229229
```bash
230-
bash etc/run_docker.sh
230+
make run-docker
231231
```
232232

233233
The script takes an optional argument for the `TASKFILE_TARGET` and allows for some environment variable overrides.
@@ -238,7 +238,7 @@ For example, to test against a sharded cluster (make sure you started the server
238238
using enterprise auth, run:
239239

240240
```bash
241-
TOPOLOGY=sharded_cluster bash etc/run_docker.sh evg-test-enterprise-auth
241+
TOPOLOGY=sharded_cluster task run-docker -- evg-test-enterprise-auth
242242
```
243243

244244
## Talk To Us

etc/prep-perf.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# Prepares perf data.
33
set -eux
44

5+
if [ -d /testdata/perf/ ]; then
6+
echo "/testdata/perf/ already exists, skipping download"
7+
exit 0
8+
fi
9+
510
curl --retry 5 "https://s3.amazonaws.com/boxes.10gen.com/build/driver-test-data.tar.gz" -o driver-test-data.tar.gz --silent --max-time 120
611

712
if [ $(uname -s) == "Darwin" ]; then

0 commit comments

Comments
 (0)