Commit a29daf8b authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'caalberts-detect-tests-ee-foss' into 'master'

Detect matching EE and FOSS tests based on MR changes

See merge request gitlab-org/gitlab!40576
parents 5989e502 824cfe38
......@@ -94,5 +94,6 @@ webpack-dev-server.json
.solargraph.yml
apollo.config.js
/tmp/matching_foss_tests.txt
/tmp/matching_tests.txt
ee/changelogs/unreleased-ee
......@@ -493,19 +493,17 @@ rspec-ee system pg12 geo:
rspec foss-impact:
extends:
- .rspec-base-pg11-as-if-foss
- .rails:rules:ee-mr-only
- .rails:rules:rspec-foss-impact
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests as-if-foss"]
script:
- install_gitlab_gem
- install_tff_gem
- run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn"
- source scripts/rspec_helpers.sh
- tooling/bin/find_foss_tests tmp/matching_foss_tests.txt
- rspec_matched_foss_tests tmp/matching_foss_tests.txt "--tag ~quarantine"
artifacts:
expire_in: 7d
paths:
- tmp/matching_foss_tests.txt
- tmp/capybara/
# EE: Canonical MR pipelines
##################################################
......@@ -555,7 +555,16 @@
- <<: *if-master-refs
changes: *code-backstage-patterns
.rails:rules:ee-mr-only:
.rails:rules:detect-tests:
rules:
- <<: *if-not-ee
when: never
- <<: *if-security-merge-request
changes: *code-backstage-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-backstage-patterns
.rails:rules:rspec-foss-impact:
rules:
- <<: *if-not-ee
when: never
......
......@@ -59,3 +59,34 @@ verify-tests-yml:
- source scripts/utils.sh
- install_tff_gem
- scripts/verify-tff-mapping
.detect-test-base:
image: ruby:2.6-alpine
needs: []
stage: prepare
script:
- source scripts/utils.sh
- install_gitlab_gem
- install_tff_gem
- tooling/bin/find_foss_tests ${MATCHED_TESTS_FILE}
artifacts:
expire_in: 7d
paths:
- ${MATCHED_TESTS_FILE}
detect-tests:
extends:
- .detect-test-base
- .rails:rules:detect-tests
variables:
MATCHED_TESTS_FILE: tmp/matching_tests.txt
detect-tests as-if-foss:
extends:
- .detect-test-base
- .rails:rules:detect-tests
- .as-if-foss
variables:
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'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment