diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-03 06:14:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-03 06:14:42 +0300 |
commit | c657078ecb4bff69e58f6911713e143c99f2c71f (patch) | |
tree | 5a4dc8bf80b14c3202de9c7bd51363f3d73af541 /tooling | |
parent | 498ba9dc41fcf2b4be30a8f3721543953efb3c3b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'tooling')
-rwxr-xr-x | tooling/bin/qa/check_if_qa_only_spec_changes | 18 | ||||
-rw-r--r-- | tooling/quality/test_level.rb | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tooling/bin/qa/check_if_qa_only_spec_changes b/tooling/bin/qa/check_if_qa_only_spec_changes new file mode 100755 index 00000000000..fd331559dd7 --- /dev/null +++ b/tooling/bin/qa/check_if_qa_only_spec_changes @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# This script assumes the first argument is a path to a file containing a list of changed files and the second argument +# is the path of a file where a list of end-to-end spec files with the leading 'qa/' trimmed will be written to if +# all the files are end-to-end test spec files. + +abort("ERROR: Please specify the file containing the list of changed files and a file where the qa only spec files will be written") if ARGV.size != 2 +file_contents = File.read(ARGV.shift).split(' ') + +all_files_are_qa_specs = file_contents.all? { |file_path| file_path =~ %r{^qa\/qa\/specs\/features\/} } + +output_file = ARGV.shift + +if all_files_are_qa_specs + qa_spec_paths_trimmed = file_contents.map { |path| path.sub('qa/', '') } + File.write(output_file, qa_spec_paths_trimmed.join(' ')) +end diff --git a/tooling/quality/test_level.rb b/tooling/quality/test_level.rb index 5fbaad073c0..3cc1d87eb36 100644 --- a/tooling/quality/test_level.rb +++ b/tooling/quality/test_level.rb @@ -33,6 +33,7 @@ module Quality initializers javascripts lib + metrics_server models policies presenters |