Add Docker integration tests for cache push for failed job
What does this MR do?
- Add docker executor test for cache push on failed job
- Refactor docker tests job execution
Why was this MR needed?
We introduced cache push for failed jobs in !2350 (closed) however this was failing for docker and Kubernetes executor. In !2638 (merged) we fixed the problems however didn't add tests to make sure we don't break this behavior in the future.
What's the best way to test this MR?
-
Run test:
go test -v -run TestCacheInContainer ./executors/docker/
-
Run jobs that fail and uploads cache to make sure the feature works as expected
.gitlab-ci.yml
stages: - test cache-poc: stage: test image: alpine:latest cache: paths: - output/ key: "$CI_COMMIT_REF_SLUG" untracked: true when: 'always' policy: pull-push script: - mkdir output || echo "Directory output already exists. Bypassing." - ls -l output - echo `date` >> output/log - cat output/log - exit 1
What are the relevant issue numbers?
Closes #27172 (closed)
Edited by Steve Xuereb