Files
query-orchestration/scripts/tests.yml
T
Michael McGuinness b1f8ac453b Merged in feature/baseTemplate (pull request #1)
feat!: base template

* first bit of templating

* codeowners

* linuxbased

* restart

* baseline project

* add grpc api and basic integration test

* startqueue

* queueMsg

* splitscripts

* migrations

* queueintegrationtest

* gateway
2024-12-06 14:38:42 +00:00

43 lines
1.2 KiB
YAML

# https://taskfile.dev
version: '3'
includes:
docker:
taskfile: docker.yml
internal: true
vars:
COVERAGE_FILE_WITH_CONTEXT: "{{.CONTEXT}}/{{.OUT_DIR}}/{{.COVERAGE_FILE}}"
tasks:
unit:
cmds:
- mkdir -p {{.CONTEXT}}/{{.OUT_DIR}}
- go test {{.CONTEXT}}/test/unit/... -coverpkg={{.CONTEXT}}/internal/...,{{.CONTEXT}}/pkg/... -coverprofile={{.COVERAGE_FILE_WITH_CONTEXT}}
unit:coverage:
deps:
- unit
vars:
TMP_FILE: "{{.CONTEXT}}/{{.OUT_DIR}}/coverage.tmp"
cmds:
- go tool cover -func={{.COVERAGE_FILE_WITH_CONTEXT}} > {{.TMP_FILE}}
- cat {{.TMP_FILE}}
- |
COVERAGE=$(grep total: {{.TMP_FILE}} | awk '{print $3}' | sed 's/%//' | bc)
echo ""
echo "Coverage Threshold: {{.COVERAGE_THRESHOLD}}%"
echo "Total Coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < {{.COVERAGE_THRESHOLD}}" | bc -l) )); then
echo "Total Coverage below Coverage Threshold"
exit 1
fi
silent: true
integration:
cmds:
- go test -v {{.CONTEXT}}/test/integration/...
integration:build:
deps:
- docker:build
cmds:
- task test:integration