git » chasquid » commit a9d7e36

gitlab: Export test directory as an artifact

author Alberto Bertogli
2020-11-13 20:07:18 UTC
committer Alberto Bertogli
2020-11-13 20:49:42 UTC
parent e79586a014dcabf3cdaae02b080ad7b96c94e018

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 +17 -2

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: