2019-04-12 04:56:38 -04:00
|
|
|
# Insurance in case a gem needed by one of our releases gets yanked from
|
|
|
|
# rubygems.org in the future.
|
|
|
|
cache gems:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-06-02 08:08:33 -04:00
|
|
|
- .rails-cache
|
2019-08-26 16:41:55 -04:00
|
|
|
- .default-before_script
|
2020-02-12 10:09:37 -05:00
|
|
|
- .setup:rules:cache-gems
|
2019-08-28 17:07:54 -04:00
|
|
|
stage: test
|
2020-05-13 20:07:47 -04:00
|
|
|
needs: ["setup-test-env"]
|
2019-08-26 16:41:55 -04:00
|
|
|
variables:
|
2020-07-16 11:09:38 -04:00
|
|
|
BUNDLE_INSTALL_FLAGS: --with=production --with=development --with=test --jobs=2 --path=vendor --retry=3 --quiet
|
2019-08-26 16:41:55 -04:00
|
|
|
SETUP_DB: "false"
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- bundle package --all --all-platforms
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- vendor/cache
|
2020-05-11 11:09:37 -04:00
|
|
|
expire_in: 31d
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-08-26 16:41:55 -04:00
|
|
|
.minimal-job:
|
2019-07-01 11:04:19 -04:00
|
|
|
extends:
|
2019-08-26 16:41:55 -04:00
|
|
|
- .default-retry
|
2020-02-20 13:08:51 -05:00
|
|
|
needs: []
|
2019-08-26 16:41:55 -04:00
|
|
|
|
2022-07-06 11:08:08 -04:00
|
|
|
.absolutely-minimal-job:
|
|
|
|
extends:
|
|
|
|
- .minimal-job
|
2021-02-03 13:09:25 -05:00
|
|
|
image: ${GITLAB_DEPENDENCY_PROXY}alpine:edge
|
2020-03-27 05:08:28 -04:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2022-07-06 11:08:08 -04:00
|
|
|
|
|
|
|
dont-interrupt-me:
|
|
|
|
extends:
|
|
|
|
- .absolutely-minimal-job
|
|
|
|
- .setup:rules:dont-interrupt-me
|
|
|
|
stage: sync
|
|
|
|
interruptible: false
|
2020-03-27 05:08:28 -04:00
|
|
|
script:
|
|
|
|
- echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible."
|
|
|
|
|
2019-08-26 16:41:55 -04:00
|
|
|
gitlab_git_test:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .minimal-job
|
|
|
|
- .setup:rules:gitlab_git_test
|
2020-02-20 13:08:51 -05:00
|
|
|
stage: test
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
|
|
|
|
|
2021-11-15 22:13:10 -05:00
|
|
|
no-ee-check:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .minimal-job
|
2021-11-15 22:13:10 -05:00
|
|
|
- .setup:rules:no-ee-check
|
2020-02-20 13:08:51 -05:00
|
|
|
stage: test
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
2021-11-15 22:13:10 -05:00
|
|
|
- scripts/no-dir-check ee
|
|
|
|
|
|
|
|
no-jh-check:
|
|
|
|
extends:
|
|
|
|
- .minimal-job
|
|
|
|
- .setup:rules:no-jh-check
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- scripts/no-dir-check jh
|
2020-08-25 11:10:17 -04:00
|
|
|
|
2022-07-06 11:08:08 -04:00
|
|
|
verify-ruby-2.7:
|
|
|
|
extends:
|
|
|
|
- .absolutely-minimal-job
|
|
|
|
- .setup:rules:verify-ruby-2.7
|
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- echo 'Please remove label ~"pipeline:run-in-ruby3" so we do test against Ruby 2.7 (default version) before merging the merge request'
|
|
|
|
- exit 1
|
|
|
|
|
2020-08-25 11:10:17 -04:00
|
|
|
verify-tests-yml:
|
|
|
|
extends:
|
|
|
|
- .setup:rules:verify-tests-yml
|
2022-06-15 11:09:20 -04:00
|
|
|
image: ${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}-alpine3.13
|
2020-08-25 11:10:17 -04:00
|
|
|
stage: test
|
|
|
|
needs: []
|
|
|
|
script:
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_tff_gem
|
|
|
|
- scripts/verify-tff-mapping
|
2020-09-01 08:11:01 -04:00
|
|
|
|
2022-04-07 11:09:57 -04:00
|
|
|
verify-approvals:
|
|
|
|
extends:
|
2022-07-06 11:08:08 -04:00
|
|
|
- .minimal-job
|
2022-04-07 11:09:57 -04:00
|
|
|
- .setup:rules:jh-contribution
|
|
|
|
script:
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_gitlab_gem
|
|
|
|
- tooling/bin/find_app_sec_approval
|
|
|
|
|
2021-11-24 19:10:49 -05:00
|
|
|
generate-frontend-fixtures-mapping:
|
|
|
|
extends:
|
|
|
|
- .setup:rules:generate-frontend-fixtures-mapping
|
|
|
|
- .use-pg12
|
|
|
|
- .rails-cache
|
|
|
|
needs: ["setup-test-env"]
|
|
|
|
stage: prepare
|
|
|
|
before_script:
|
|
|
|
- !reference [.default-before_script, before_script]
|
|
|
|
- source ./scripts/rspec_helpers.sh
|
|
|
|
- run_timed_command "scripts/gitaly-test-spawn"
|
|
|
|
script:
|
|
|
|
- generate_frontend_fixtures_mapping
|
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
|
|
|
- ${FRONTEND_FIXTURES_MAPPING_PATH}
|
|
|
|
|
2020-09-01 08:11:01 -04:00
|
|
|
.detect-test-base:
|
2022-06-15 11:09:20 -04:00
|
|
|
image: ${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}
|
2020-09-01 08:11:01 -04:00
|
|
|
needs: []
|
|
|
|
stage: prepare
|
|
|
|
script:
|
2020-12-09 10:10:12 -05:00
|
|
|
- source ./scripts/utils.sh
|
|
|
|
- source ./scripts/rspec_helpers.sh
|
2020-09-01 08:11:01 -04:00
|
|
|
- install_gitlab_gem
|
|
|
|
- install_tff_gem
|
2020-12-09 10:10:12 -05:00
|
|
|
- retrieve_tests_mapping
|
2021-11-24 19:10:49 -05:00
|
|
|
- retrieve_frontend_fixtures_mapping
|
2021-09-08 05:09:10 -04:00
|
|
|
- |
|
|
|
|
if [ -n "$CI_MERGE_REQUEST_IID" ]; then
|
|
|
|
tooling/bin/find_changes ${CHANGES_FILE};
|
|
|
|
tooling/bin/find_tests ${CHANGES_FILE} ${MATCHED_TESTS_FILE};
|
2021-11-24 19:10:49 -05:00
|
|
|
tooling/bin/find_changes ${CHANGES_FILE} ${MATCHED_TESTS_FILE} ${FRONTEND_FIXTURES_MAPPING_PATH};
|
|
|
|
echo "Changed files: $(cat $CHANGES_FILE)";
|
|
|
|
echo "Related rspec tests: $(cat $MATCHED_TESTS_FILE)";
|
2021-09-08 05:09:10 -04:00
|
|
|
fi
|
2020-09-01 08:11:01 -04:00
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
2021-09-08 05:09:10 -04:00
|
|
|
- ${CHANGES_FILE}
|
2020-09-01 08:11:01 -04:00
|
|
|
- ${MATCHED_TESTS_FILE}
|
2021-11-24 19:10:49 -05:00
|
|
|
- ${FRONTEND_FIXTURES_MAPPING_PATH}
|
2020-09-01 08:11:01 -04:00
|
|
|
|
|
|
|
detect-tests:
|
|
|
|
extends:
|
|
|
|
- .detect-test-base
|
|
|
|
- .rails:rules:detect-tests
|
|
|
|
variables:
|
2021-09-07 05:11:43 -04:00
|
|
|
RSPEC_TESTS_MAPPING_ENABLED: "true"
|
2021-09-08 05:09:10 -04:00
|
|
|
CHANGES_FILE: tmp/changed_files.txt
|
2020-09-01 08:11:01 -04:00
|
|
|
MATCHED_TESTS_FILE: tmp/matching_tests.txt
|
|
|
|
|
|
|
|
detect-tests as-if-foss:
|
|
|
|
extends:
|
|
|
|
- .detect-test-base
|
|
|
|
- .rails:rules:detect-tests
|
|
|
|
- .as-if-foss
|
|
|
|
variables:
|
2021-09-08 05:09:10 -04:00
|
|
|
CHANGES_FILE: tmp/changed_foss_files.txt
|
2020-09-01 08:11:01 -04:00
|
|
|
MATCHED_TESTS_FILE: tmp/matching_foss_tests.txt
|
|
|
|
before_script:
|
|
|
|
- '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
|
2021-10-13 17:09:56 -04:00
|
|
|
|
2021-10-25 11:12:11 -04:00
|
|
|
detect-previous-failed-tests:
|
|
|
|
extends:
|
|
|
|
- .detect-test-base
|
|
|
|
- .rails:rules:detect-previous-failed-tests
|
|
|
|
variables:
|
|
|
|
PREVIOUS_FAILED_TESTS_DIR: tmp/previous_failed_tests/
|
|
|
|
RSPEC_PG_REGEX: /rspec .+ pg12( .+)?/
|
|
|
|
RSPEC_EE_PG_REGEX: /rspec-ee .+ pg12( .+)?/
|
|
|
|
script:
|
|
|
|
- source ./scripts/utils.sh
|
|
|
|
- source ./scripts/rspec_helpers.sh
|
|
|
|
- retrieve_previous_failed_tests ${PREVIOUS_FAILED_TESTS_DIR} "${RSPEC_PG_REGEX}" "${RSPEC_EE_PG_REGEX}"
|
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
|
|
|
- ${PREVIOUS_FAILED_TESTS_DIR}
|