diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 03:13:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 03:13:54 +0300 |
commit | 2d9c62ffb595d2bf555046d09098a0d4af71e17f (patch) | |
tree | c837cf91cf3e50f443d1dcb852b82448637a5c8b /spec/frontend/editor | |
parent | d9710d79c52bc73438022e79c79cfe3ab35b084b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/editor')
3 files changed, 82 insertions, 0 deletions
diff --git a/spec/frontend/editor/schema/ci/ci_schema_spec.js b/spec/frontend/editor/schema/ci/ci_schema_spec.js index 87208ec7aa8..51fcf26c39a 100644 --- a/spec/frontend/editor/schema/ci/ci_schema_spec.js +++ b/spec/frontend/editor/schema/ci/ci_schema_spec.js @@ -27,6 +27,7 @@ import CacheYaml from './yaml_tests/positive_tests/cache.yml'; import FilterYaml from './yaml_tests/positive_tests/filter.yml'; import IncludeYaml from './yaml_tests/positive_tests/include.yml'; import RulesYaml from './yaml_tests/positive_tests/rules.yml'; +import RulesNeedsYaml from './yaml_tests/positive_tests/rules_needs.yml'; import ProjectPathYaml from './yaml_tests/positive_tests/project_path.yml'; import VariablesYaml from './yaml_tests/positive_tests/variables.yml'; import JobWhenYaml from './yaml_tests/positive_tests/job_when.yml'; @@ -46,6 +47,7 @@ import ProjectPathIncludeLeadSlashYaml from './yaml_tests/negative_tests/project import ProjectPathIncludeNoSlashYaml from './yaml_tests/negative_tests/project_path/include/no_slash.yml'; import ProjectPathIncludeTailSlashYaml from './yaml_tests/negative_tests/project_path/include/tailing_slash.yml'; import RulesNegativeYaml from './yaml_tests/negative_tests/rules.yml'; +import RulesNeedsNegativeYaml from './yaml_tests/negative_tests/rules_needs.yml'; import TriggerNegative from './yaml_tests/negative_tests/trigger.yml'; import VariablesInvalidOptionsYaml from './yaml_tests/negative_tests/variables/invalid_options.yml'; import VariablesInvalidSyntaxDescYaml from './yaml_tests/negative_tests/variables/invalid_syntax_desc.yml'; @@ -88,6 +90,7 @@ describe('positive tests', () => { JobWhenYaml, HooksYaml, RulesYaml, + RulesNeedsYaml, VariablesYaml, ProjectPathYaml, IdTokensYaml, @@ -121,6 +124,7 @@ describe('negative tests', () => { IncludeNegativeYaml, JobWhenNegativeYaml, RulesNegativeYaml, + RulesNeedsNegativeYaml, TriggerNegative, VariablesInvalidOptionsYaml, VariablesInvalidSyntaxDescYaml, diff --git a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/rules_needs.yml b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/rules_needs.yml new file mode 100644 index 00000000000..f2f1eb118f8 --- /dev/null +++ b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/rules_needs.yml @@ -0,0 +1,46 @@ +# invalid rules:needs +lint_job: + script: exit 0 + rules: + - if: $var == null + needs: + +# invalid rules:needs +lint_job_2: + script: exit 0 + rules: + - if: $var == null + needs: [20] + +# invalid rules:needs +lint_job_3: + script: exit 0 + rules: + - if: $var == null + needs: + - job: + +# invalid rules:needs +lint_job_5: + script: exit 0 + rules: + - if: $var == null + needs: + - pipeline: 5 + +# invalid rules:needs +lint_job_6: + script: exit 0 + rules: + - if: $var == null + needs: + - project: namespace/group/project-name + +# invalid rules:needs +lint_job_7: + script: exit 0 + rules: + - if: $var == null + needs: + - pipeline: 5 + job: lint_job_6 diff --git a/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/rules_needs.yml b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/rules_needs.yml new file mode 100644 index 00000000000..a4a5183dcf4 --- /dev/null +++ b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/rules_needs.yml @@ -0,0 +1,32 @@ +# valid workflow:rules:needs +pre_lint_job: + script: exit 0 + rules: + - if: $var == null + +lint_job: + script: exit 0 + rules: + - if: $var == null + +rspec_job: + script: exit 0 + rules: + - if: $var == null + needs: [lint_job] + +job: + needs: [rspec_job] + script: exit 0 + rules: + - if: $var == null + needs: + - job: lint_job + artifacts: false + optional: true + - job: pre_lint_job + artifacts: true + optional: false + - rspec_job + - if: $var == true + needs: [lint_job, pre_lint_job]
\ No newline at end of file |