summaryrefslogtreecommitdiff
path: root/.gitlab/ci/test-metadata.gitlab-ci.yml
blob: 6a7f3157d593f4afbaae20a37a713482f534f67d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.tests-metadata-state:
  extends:
    - .default-only
    - .only-code-changes
  variables:
    TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache"
  before_script:
    - source scripts/utils.sh
  cache:
    key: tests_metadata
    paths:
      - knapsack/
      - rspec_flaky/
  artifacts:
    expire_in: 31d
    paths:
      - knapsack/
      - rspec_flaky/
      - rspec_profiling/

retrieve-tests-metadata:
  extends: .tests-metadata-state
  stage: prepare
  cache:
    policy: pull
  script:
    - source scripts/rspec_helpers.sh
    - retrieve_tests_metadata

update-tests-metadata:
  extends: .tests-metadata-state
  stage: post-test
  cache:
    policy: push
  script:
    - retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document
    - source scripts/rspec_helpers.sh
    - update_tests_metadata
  only:
    refs:
      - schedules
    variables:
      # Only update the Knapsack metadata on GitLab.com/gitlab-org/gitlab
      - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab"

flaky-examples-check:
  extends:
    - .default-tags
    - .default-retry
    - .default-only
    - .only-code-changes
  image: ruby:2.6-alpine
  stage: post-test
  variables:
    NEW_FLAKY_SPECS_REPORT: rspec_flaky/report-new.json
  allow_failure: true
  only:
    refs:
      - merge_requests
  artifacts:
    expire_in: 30d
    paths:
      - rspec_flaky/
  script:
    - '[[ -f $NEW_FLAKY_SPECS_REPORT ]] || echo "{}" > ${NEW_FLAKY_SPECS_REPORT}'
    - scripts/merge-reports ${NEW_FLAKY_SPECS_REPORT} rspec_flaky/new_*_*.json
    - scripts/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT