Building and Testing
To build Traefik Mesh from the sources you need either Docker and , or Go.
Traefik Mesh can be built from the sources by using the make
command. This will create a binary for the Linux platform in the dist
directory and a Docker image:
Note
Requirements:
Go
v1.14+- Environment variable
GO111MODULE=on
One your Go environment is set up, you can build Traefik Mesh from the sources by using the command. The Go compiler will build an executable for your platform.
$ go build -o dist/traefik-mesh cmd/mesh/mesh.go
$ ./dist/traefik-mesh version
version : dev
commit : I don't remember exactly
build date : I don't remember exactly
go version : go1.15
go compiler : gc
platform : linux/amd64
Testing
Run unit tests by using the test
target:
# Run every tests in the MyTest suite
$ TESTFLAGS="-check.f MyTestSuite" make test-integration
# Run the test "MyTest" in the MyTest suite
# Run every tests starting with "My", in the MyTest suite
$ TESTFLAGS="-check.f MyTestSuite.My" make test-integration
# Run every tests ending with "Test", in the MyTest suite
$ TESTFLAGS="-check.f MyTestSuite.*Test" make test-integration
More on https://labix.org/gocheck.
Run the unit tests by using the go test
command:
Run the integration tests in the integration
directory by using the go test ./integration -integration
command:
$ go test -v ./integration -integration -check.f CoreDNSSuite
#[...]
OK: 2 passed
--- PASS: Test (161.20s)
Before running the integration tests, build the Traefik Mesh Docker image. Check out the section for more details.