From a9d7e36d29a07cb5c2703fd8def22f206f34cb27 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Fri, 13 Nov 2020 20:07:18 +0000 Subject: [PATCH] gitlab: Export test directory as an artifact To debug test failures, it can be convenient to explore the contents of the test directories after the test runs, as they contain logs and generated files. This patch configures the GitLab CI to export the repo tree (which includes the test directory) as GitLab CI artifacts, so they can be easily accessed after the tests have completed. --- .gitlab-ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e6a5d7..5f8f88e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,15 @@ integration_stable: - docker info - docker build -t chasquid-test -f test/Dockerfile . - docker run chasquid-test env - - docker run chasquid-test make test + - docker run --name test1 chasquid-test make test + after_script: + - docker cp test1:/go/src/blitiri.com.ar/go/chasquid docker-out/ + artifacts: + when: always + expire_in: 1 hour + paths: + - docker-out/ + # Integration test, using the latest module versions. integration_latest: @@ -48,7 +56,14 @@ integration_latest: - 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 + - docker run --name test1 chasquid-test make test + after_script: + - docker cp test1:/go/src/blitiri.com.ar/go/chasquid docker-out/ + artifacts: + when: always + expire_in: 1 hour + paths: + - docker-out/ # Build docker image, upload to gitlab registry. gitlab: