Skip to content

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.

Example of log artifacts: https://gitlab.com/gitlab-org/gitaly/-/jobs/3294571352/artifacts/browse/_build/test-logs/. The logs are persisted when tests failed only. Test names are attached to each log line. It's trivial to filter logs of a test with grep and jq.

Screenshot_2022-11-02_at_18.23.27

Edited by Quang-Minh Nguyen

Merge request reports