diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2022-11-01 18:51:15 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2022-11-09 17:49:07 +0300 |
commit | d07b20bab4d192aa366100b0487fefdbe5e61a84 (patch) | |
tree | a3055c2be475a11f658ee2223b1605ede2b201d1 /.gitlab-ci.yml | |
parent | 1ba70888404fcb9719d4eb33481f57138bce7447 (diff) |
Expose logs as artifacts when running tests on CI
Gitaly test suite on CI doesn't expose any logs. Sometimes, it's not
easy to re-produce the tests on local environment. This commit exposes
the logs generated while running tests. Those logs are then persisted
as the artifacts of CI jobs for a reasonable amount of time.
The folder storing logs are configured from TEST_LOG_DIR env variable.
The dir is created and injected into testcfg builder and testserver as
the dependency of started Gitaly server.
We can also produce the logs on the local environment with
TEST_LOG_DIR=/tmp/gitaly-logs make test-go
Changelog: other
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66ea51cd0..0520c027d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -102,6 +102,7 @@ include: TEST_REPORT: "${CI_PROJECT_DIR}/_build/reports/go-tests-report.xml" TEST_COVERAGE_DIR: "${CI_PROJECT_DIR}/_build/reports/coverage" TEST_FULL_OUTPUT: "${CI_PROJECT_DIR}/_build/reports/test-output.log" + TEST_LOG_DIR: "${CI_PROJECT_DIR}/_build/reports/test-logs" before_script: &test_before_script - go version script: @@ -123,10 +124,11 @@ include: fi artifacts: paths: - - ruby/tmp/gitaly-rspec-test.log + - ${CI_PROJECT_DIR}/ruby/tmp/gitaly-rspec-test.log + - ${TEST_LOG_DIR} reports: junit: ${TEST_REPORT} - when: on_failure + when: always expire_in: 1 week danger-review: @@ -335,6 +337,9 @@ test:macos: PGUSER: gitlab TEST_OPTIONS: "-timeout=20m" # a number of tests may exceed the default 10m artifacts: + paths: + - ${CI_PROJECT_DIR}/ruby/tmp/gitaly-rspec-test.log + - ${TEST_LOG_DIR} reports: junit: ${TEST_REPORT} when: always |