build: correct Makefile to run smoke tests locally (#16137)
This commit is contained in:
parent
fbc51dd190
commit
6e9ee969ad
17
GNUmakefile
17
GNUmakefile
|
@ -32,6 +32,11 @@ ifndef NOMAD_NO_UI
|
|||
GO_TAGS := ui $(GO_TAGS)
|
||||
endif
|
||||
|
||||
#GOTEST_GROUP is set in CI pipelines. We have to set it for local run.
|
||||
ifndef GOTEST_GROUP
|
||||
GOTEST_GROUP := nomad client command drivers quick
|
||||
endif
|
||||
|
||||
# tag corresponding to latest release we maintain backward compatibility with
|
||||
PROTO_COMPARE_TAG ?= v1.0.3$(if $(findstring ent,$(GO_TAGS)),+ent,)
|
||||
|
||||
|
@ -408,3 +413,15 @@ ec2info: ## Generate AWS EC2 CPU specification table
|
|||
.PHONY: cl
|
||||
cl: ## Create a new Changelog entry
|
||||
@go run -modfile tools/go.mod tools/cl-entry/main.go
|
||||
|
||||
.PHONY: test
|
||||
test: GOTEST_PKGS := $(foreach g,$(GOTEST_GROUP),$(shell go run -modfile=tools/go.mod tools/missing/main.go ci/test-core.json $(g)))
|
||||
test: ## Use this target as a smoke test
|
||||
@echo "==> Running Nomad smoke tests on groups: $(GOTEST_GROUP)"
|
||||
@echo "==> with packages: $(GOTEST_PKGS)"
|
||||
gotestsum --format=testname --packages="$(GOTEST_PKGS)" -- \
|
||||
-cover \
|
||||
-timeout=20m \
|
||||
-count=1 \
|
||||
-tags "$(GO_TAGS)" \
|
||||
$(GOTEST_PKGS)
|
||||
|
|
|
@ -44,10 +44,14 @@ Developing without Vagrant
|
|||
```sh
|
||||
$ [ "$(ulimit -n)" -lt 1024 ] && ulimit -n 1024
|
||||
```
|
||||
1. Verify you can run tests
|
||||
1. Verify you can run smoke tests
|
||||
```sh
|
||||
$ make test
|
||||
```
|
||||
**Note:** You can think of this as a `smoke` test which runs a subset of
|
||||
tests and some may fail because of `operation not permitted` error which
|
||||
requires `root` access. You can use `go test` to test the specific subsystem
|
||||
which you are working on and let the CI run rest of the tests for you.
|
||||
|
||||
Running a development build
|
||||
---
|
||||
|
|
Loading…
Reference in New Issue