From 9dea372d96d434ad2a080d18fabba64261b47dc1 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sat, 19 Oct 2019 00:26:59 +0100 Subject: [PATCH] gitlab-ci.yml: Run integration tests against submitted and latest deps It is useful to run the integration tests both against the submitted dependencies, based on Go module versions from the repository, as well as the latest ones, to catch integration problems early. This patch extends the .gitlab-ci.yml configuration to do that, by optionally passing a flag to "go get" to update the modules. --- .gitlab-ci.yml | 13 +++++++++++++ test/Dockerfile | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6345a0..ac9083f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - test - docker_image +# Integration test, using the module versions from the repository. integration_test: stage: test image: docker:stable @@ -14,6 +15,18 @@ integration_test: - docker run chasquid-test env - docker run chasquid-test make test +# Integration test, using the latest module versions. +integration_test_latest: + stage: test + image: docker:stable + services: + - docker:dind + script: + - docker info + - docker build -t chasquid-test --build-arg GO_GET_ARGS="-u=patch" -f test/Dockerfile . + - docker run chasquid-test env + - docker run chasquid-test make test + image_build: stage: docker_image image: docker:stable diff --git a/test/Dockerfile b/test/Dockerfile index 24f79c7..122808f 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -56,7 +56,7 @@ RUN useradd -m chasquid && chown -R chasquid:chasquid . # Do it as chasquid because that is what the tests will run as. USER chasquid ENV GOPATH= -RUN go get -v ./... && go mod download +RUN go get -v ${GO_GET_ARGS} ./... && go mod download # Build the minidns server, which will be run from within the entrypoint. RUN go build -o /tmp/minidns ./test/util/minidns.go