mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add profiling options to tests in Makefile (#21488)
Usage example:
```bash
$ make test TEST_CPUPROFILE=cpu.prof TEST_MEMPROFILE=mem.prof TEST_PACKAGES=./coderd
```
Note that `TEST_PACKAGES` has to be specified, otherwise you get `cannot
use -{cpu,memory}profile flag with multiple packages`.
Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
@@ -1033,6 +1033,14 @@ ifdef RUN
|
|||||||
GOTEST_FLAGS += -run $(RUN)
|
GOTEST_FLAGS += -run $(RUN)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef TEST_CPUPROFILE
|
||||||
|
GOTEST_FLAGS += -cpuprofile=$(TEST_CPUPROFILE)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef TEST_MEMPROFILE
|
||||||
|
GOTEST_FLAGS += -memprofile=$(TEST_MEMPROFILE)
|
||||||
|
endif
|
||||||
|
|
||||||
TEST_PACKAGES ?= ./...
|
TEST_PACKAGES ?= ./...
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
|||||||
Reference in New Issue
Block a user