mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-22 07:57:34 +00:00
4e077b053c
This commit adds integration tests to headscale. They are currently quite simple, but it lays the groundwork for more comprehensive testing and ensuring we dont break things with the official tailscale client. The test works by leveraging Docker (via dockertest) to spin up a Headscale container, and a number of tailscale containers (10). Each tailscale container is joined to the headscale and then "passed on" to the tests. Currently three tests have been implemented: - Have all tailscale containers join headscale (in the setup process) - Get IP from each container (I plan to extend this with cross-ping) - List nodes with headscales CLI and verify all has been registered This test depends on Docker, and currently, I have not looked into hooking it into Github Actions.
28 lines
466 B
Makefile
28 lines
466 B
Makefile
# Calculate version
|
|
version = $(shell ./scripts/version-at-commit.sh)
|
|
|
|
build:
|
|
go build -ldflags "-s -w -X main.version=$(version)" cmd/headscale/headscale.go
|
|
|
|
dev: lint test build
|
|
|
|
test:
|
|
@go test -coverprofile=coverage.out ./...
|
|
|
|
test_integration:
|
|
go test -tags integration ./...
|
|
|
|
coverprofile_func:
|
|
go tool cover -func=coverage.out
|
|
|
|
coverprofile_html:
|
|
go tool cover -html=coverage.out
|
|
|
|
lint:
|
|
golint
|
|
golangci-lint run
|
|
|
|
compress: build
|
|
upx --brute headscale
|
|
|