Files

77 lines
2.6 KiB
YAML

# All commands should be invoked from the parent directory; see Taskfile.yml there.
---
version: 3
vars:
RACE_FLAG: -race={{and (ne OS "windows") (ne ARCH "arm") (ne ARCH "riscv64")}}
BUILD_TAGS: docdb_dev
BENCH_NAME: .
BENCH_COUNT: 10
BENCH_TIME: 5s
BENCH_DOCS: 1000
BENCH_FLAGS:
tasks:
env-data:
cmds:
- >
go test -count=1 -tags={{.BUILD_TAGS}} {{.RACE_FLAG}} -run=TestEnvData
-tags=docdb_testenvdata .
-target-backend=mongodb
-target-url='mongodb://username:[email protected]:47017/'
- >
go test -count=1 -tags={{.BUILD_TAGS}} {{.RACE_FLAG}} -run=TestEnvData
-tags=docdb_testenvdata .
-target-backend=docdb
-target-url='mongodb://username:[email protected]:27017/'
integration-gen:
cmds:
- go generate -x ./...
lint:
desc: "Run linters"
cmds:
- ../bin/golangci-lint{{exeExt}} run --config=.golangci.yml
- ../bin/golangci-lint{{exeExt}} run --config=.golangci-new.yml
- ../bin/go-consistent{{exeExt}} -pedantic ./...
- go vet -vettool=../bin/checkswitch{{exeExt}} ./...
- go vet -vettool=../bin/checkcomments{{exeExt}} ./...
integration-security:
cmds:
- ../bin/govulncheck{{exeExt}} -test -show=verbose,color ./...
bench-postgresql:
desc: "Run benchmarks for `postgresql` backend"
cmds:
# TODO https://github.com/hanzoai/docdb/issues/4934
# Remove -otel-traces-url='' to reproduce the issue.
- >
go test -timeout=0 -run=XXX
-log-level=error
-count={{.BENCH_COUNT}} -bench={{.BENCH_NAME}} -benchtime={{.BENCH_TIME}} -bench-docs={{.BENCH_DOCS}} -benchmem
{{if .BENCH_FLAGS}}{{.BENCH_FLAGS}}{{end}}
-target-backend=docdb
-postgresql-url=postgres://username:[email protected]:5432/postgres
-otel-traces-url=''
| tee new-postgresql.txt
- ../bin/benchstat{{exeExt}} old-postgresql.txt new-postgresql.txt
bench-mongodb:
desc: "Run benchmarks for MongoDB"
cmds:
# TODO https://github.com/hanzoai/docdb/issues/4934
# Remove -otel-traces-url='' to reproduce the issue.
- >
go test -timeout=0 -run=XXX
-log-level=error
-count={{.BENCH_COUNT}} -bench={{.BENCH_NAME}} -benchtime={{.BENCH_TIME}} -bench-docs={{.BENCH_DOCS}} -benchmem
{{if .BENCH_FLAGS}}{{.BENCH_FLAGS}}{{end}}
-target-backend=mongodb
-target-url='mongodb://username:[email protected]:47017/'
-otel-traces-url=''
| tee new-mongodb.txt
- ../bin/benchstat{{exeExt}} old-mongodb.txt new-mongodb.txt