diff options
Diffstat (limited to 'spec/frontend/editor')
7 files changed, 155 insertions, 1 deletions
diff --git a/spec/frontend/editor/schema/ci/ci_schema_spec.js b/spec/frontend/editor/schema/ci/ci_schema_spec.js index 51fcf26c39a..77c7f0d49a8 100644 --- a/spec/frontend/editor/schema/ci/ci_schema_spec.js +++ b/spec/frontend/editor/schema/ci/ci_schema_spec.js @@ -35,6 +35,7 @@ import IdTokensYaml from './yaml_tests/positive_tests/id_tokens.yml'; import HooksYaml from './yaml_tests/positive_tests/hooks.yml'; import SecretsYaml from './yaml_tests/positive_tests/secrets.yml'; import ServicesYaml from './yaml_tests/positive_tests/services.yml'; +import NeedsParallelMatrixYaml from './yaml_tests/positive_tests/needs_parallel_matrix.yml'; // YAML NEGATIVE TEST import ArtifactsNegativeYaml from './yaml_tests/negative_tests/artifacts.yml'; @@ -56,6 +57,9 @@ import IdTokensNegativeYaml from './yaml_tests/negative_tests/id_tokens.yml'; import HooksNegative from './yaml_tests/negative_tests/hooks.yml'; import SecretsNegativeYaml from './yaml_tests/negative_tests/secrets.yml'; import ServicesNegativeYaml from './yaml_tests/negative_tests/services.yml'; +import NeedsParallelMatrixNumericYaml from './yaml_tests/negative_tests/needs/parallel_matrix/numeric.yml'; +import NeedsParallelMatrixWrongParallelValueYaml from './yaml_tests/negative_tests/needs/parallel_matrix/wrong_parallel_value.yml'; +import NeedsParallelMatrixWrongMatrixValueYaml from './yaml_tests/negative_tests/needs/parallel_matrix/wrong_matrix_value.yml'; const ajv = new Ajv({ strictTypes: false, @@ -96,6 +100,7 @@ describe('positive tests', () => { IdTokensYaml, ServicesYaml, SecretsYaml, + NeedsParallelMatrixYaml, }), )('schema validates %s', (_, input) => { // We construct a new "JSON" from each main key that is inside a @@ -136,6 +141,9 @@ describe('negative tests', () => { ProjectPathIncludeTailSlashYaml, SecretsNegativeYaml, ServicesNegativeYaml, + NeedsParallelMatrixNumericYaml, + NeedsParallelMatrixWrongParallelValueYaml, + NeedsParallelMatrixWrongMatrixValueYaml, }), )('schema validates %s', (_, input) => { // We construct a new "JSON" from each main key that is inside a diff --git a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/numeric.yml b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/numeric.yml new file mode 100644 index 00000000000..6d666203a8a --- /dev/null +++ b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/numeric.yml @@ -0,0 +1,6 @@ +# invalid needs:parallel:matrix where parallel has a numeric value +job_with_needs_parallel_matrix: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: 10 diff --git a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/wrong_matrix_value.yml b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/wrong_matrix_value.yml new file mode 100644 index 00000000000..746df9ebd96 --- /dev/null +++ b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/wrong_matrix_value.yml @@ -0,0 +1,30 @@ +# invalid needs:parallel:matrix where matrix value is incorrect +job_with_needs_parallel_matrix: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: + matrix: 10 + +job_with_needs_parallel_matrix_2: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: + matrix: "string" + +job_with_needs_parallel_matrix_3: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: + matrix: [a1, a2] + +job_with_needs_parallel_matrix_4: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: + matrix: + VAR_1: 1 + VAR_2: 2 diff --git a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/wrong_parallel_value.yml b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/wrong_parallel_value.yml new file mode 100644 index 00000000000..727c97119f1 --- /dev/null +++ b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/needs/parallel_matrix/wrong_parallel_value.yml @@ -0,0 +1,27 @@ +# invalid needs:parallel:matrix where parallel value is incorrect +job_with_needs_parallel_matrix: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: + not_matrix: + - VAR_1: [a1, a2] + VAR_2: [b1, b2] + +job_with_needs_parallel_matrix_2: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: [a1, a2] + +job_with_needs_parallel_matrix_3: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: "matrix" + +job_with_needs_parallel_matrix_4: + script: exit 0 + needs: + - job: some_job_with_parallel_matrix + parallel: object diff --git a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/secrets.yml b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/secrets.yml index 14ba930b394..4baf4c6b850 100644 --- a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/secrets.yml +++ b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/secrets.yml @@ -1,4 +1,4 @@ -job_with_secrets_without_vault: +job_with_secrets_without_any_vault_provider: script: - echo $TEST_DB_PASSWORD secrets: @@ -37,3 +37,37 @@ job_with_secrets_with_missing_required_engine_property: vault: engine: path: kv + +job_with_azure_key_vault_secrets_with_extra_properties: + script: + - echo $TEST_DB_PASSWORD + secrets: + TEST_DB_PASSWORD: + azure_key_vault: + name: mypass + extra_prop: TEST + +job_with_secrets_with_invalid_azure_key_vault_property: + script: + - echo $TEST_DB_PASSWORD + secrets: + TEST_DB_PASSWORD: + azure_key_vault: + invalid: TEST + +job_with_secrets_with_missing_required_azure_key_vault_property: + script: + - echo $TEST_DB_PASSWORD + secrets: + TEST_DB_PASSWORD: + azure_key_vault: + version: latest + +job_with_secrets_with_missing_required_name_property: + script: + - echo $TEST_DB_PASSWORD + secrets: + TEST_DB_PASSWORD: + azure_key_vault: + name: + version: latest diff --git a/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/needs_parallel_matrix.yml b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/needs_parallel_matrix.yml new file mode 100644 index 00000000000..22b386d1dc8 --- /dev/null +++ b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/needs_parallel_matrix.yml @@ -0,0 +1,32 @@ +# valid needs:parallel:matrix +job_with_needs_parallel_matrix: + script: exit 0 + needs: + - job: job_with_parallel_matrix + parallel: + matrix: + - VAR_1: [a] + VAR_2: [d] + +job_with_needs_parallel_matrix_2: + script: exit 0 + needs: + - job: job_with_parallel_matrix + parallel: + matrix: + - VAR_1: a + VAR_2: d + +job_with_needs_parallel_matrix_3: + script: exit 0 + needs: + - job: job_with_parallel_matrix + parallel: + matrix: + - VAR_1: ["a", b] + VAR_2: d + - job: job_with_parallel_matrix_2 + parallel: + matrix: + - VAR_1: [a, "b", c] + VAR_5: [d, "e"] diff --git a/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/secrets.yml b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/secrets.yml index 083cb4348ed..af3107974b9 100644 --- a/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/secrets.yml +++ b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/secrets.yml @@ -26,3 +26,20 @@ valid_job_with_secrets_with_every_vault_keyword: field: password file: true token: $TEST_TOKEN + +valid_job_with_azure_key_vault_secrets_name: + script: + - echo $TEST_DB_PASSWORD + secrets: + TEST_DB_PASSWORD: + azure_key_vault: + name: 'test' + +valid_job_with_azure_key_vault_secrets_name_and_version: + script: + - echo $TEST_DB_PASSWORD + secrets: + TEST_DB_PASSWORD: + azure_key_vault: + name: 'test' + version: 'version' |