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.

    1. $ go build -o dist/traefik-mesh cmd/mesh/mesh.go
    2. $ ./dist/traefik-mesh version
    3. version : dev
    4. commit : I don't remember exactly
    5. build date : I don't remember exactly
    6. go version : go1.15
    7. go compiler : gc
    8. platform : linux/amd64

    Testing

    Run unit tests by using the test target:

    1. # Run every tests in the MyTest suite
    2. $ TESTFLAGS="-check.f MyTestSuite" make test-integration
    3. # Run the test "MyTest" in the MyTest suite
    4. # Run every tests starting with "My", in the MyTest suite
    5. $ TESTFLAGS="-check.f MyTestSuite.My" make test-integration
    6. # Run every tests ending with "Test", in the MyTest suite
    7. $ 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:

    1. $ go test -v ./integration -integration -check.f CoreDNSSuite
    2. #[...]
    3. OK: 2 passed
    4. --- PASS: Test (161.20s)

    Before running the integration tests, build the Traefik Mesh Docker image. Check out the section for more details.