Skip to content

Commit

Permalink
test: add edge cases to no-duplicate-param tests
Browse files Browse the repository at this point in the history
  • Loading branch information
madbence committed Oct 25, 2020
1 parent 0940028 commit 6cc83be
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 64 deletions.
90 changes: 45 additions & 45 deletions regression-tests/__snapshots__/regresion.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -838,77 +838,77 @@ Array [
"level": "warning",
"loc": Object {
"endColumn": 1,
"endLine": 21,
"endLine": 20,
"range": Array [
297,
324,
289,
299,
],
"startColumn": 7,
"startLine": 19,
},
"message": "TriggerTemplate 'no-duplicate-param-2' defines parameter 'foo', but it's not used anywhere in the spec",
"message": "Pipeline 'no-duplicate-param-2' defines parameter 'foo', but it's not used anywhere in the spec",
"path": "./regression-tests/no-duplicate-param.yaml",
"rule": "no-unused-param",
},
Object {
"level": "error",
"loc": Object {
"endColumn": 16,
"endLine": 21,
"endLine": 20,
"range": Array [
336,
339,
311,
314,
],
"startColumn": 13,
"startLine": 21,
"startLine": 20,
},
"message": "Duplicate param 'foo'",
"path": "./regression-tests/no-duplicate-param.yaml",
"rule": "no-duplicate-param",
},
Object {
"level": "warning",
"level": "error",
"loc": Object {
"endColumn": 1,
"endLine": 33,
"endColumn": 20,
"endLine": 30,
"range": Array [
492,
519,
488,
491,
],
"startColumn": 7,
"startLine": 31,
"startColumn": 17,
"startLine": 30,
},
"message": "Pipeline 'no-duplicate-param-3' defines parameter 'foo', but it's not used anywhere in the spec",
"message": "Duplicate param 'foo'",
"path": "./regression-tests/no-duplicate-param.yaml",
"rule": "no-unused-param",
"rule": "no-duplicate-param",
},
Object {
"level": "error",
"level": "warning",
"loc": Object {
"endColumn": 16,
"endLine": 33,
"endColumn": 1,
"endLine": 40,
"range": Array [
531,
534,
620,
630,
],
"startColumn": 13,
"startLine": 33,
"startColumn": 7,
"startLine": 39,
},
"message": "Duplicate param 'foo'",
"message": "Task 'no-duplicate-param-3' defines parameter 'foo', but it's not used anywhere in the spec",
"path": "./regression-tests/no-duplicate-param.yaml",
"rule": "no-duplicate-param",
"rule": "no-unused-param",
},
Object {
"level": "error",
"loc": Object {
"endColumn": 20,
"endLine": 43,
"endColumn": 16,
"endLine": 40,
"range": Array [
703,
706,
642,
645,
],
"startColumn": 17,
"startLine": 43,
"startColumn": 13,
"startLine": 40,
},
"message": "Duplicate param 'foo'",
"path": "./regression-tests/no-duplicate-param.yaml",
Expand All @@ -918,29 +918,29 @@ Array [
"level": "warning",
"loc": Object {
"endColumn": 1,
"endLine": 54,
"endLine": 50,
"range": Array [
835,
862,
777,
787,
],
"startColumn": 7,
"startLine": 52,
"startLine": 49,
},
"message": "Task 'no-duplicate-param-4' defines parameter 'foo', but it's not used anywhere in the spec",
"message": "TriggerTemplate 'no-duplicate-param-4' defines parameter 'foo', but it's not used anywhere in the spec",
"path": "./regression-tests/no-duplicate-param.yaml",
"rule": "no-unused-param",
},
Object {
"level": "error",
"loc": Object {
"endColumn": 16,
"endLine": 54,
"endLine": 50,
"range": Array [
874,
877,
799,
802,
],
"startColumn": 13,
"startLine": 54,
"startLine": 50,
},
"message": "Duplicate param 'foo'",
"path": "./regression-tests/no-duplicate-param.yaml",
Expand All @@ -950,13 +950,13 @@ Array [
"level": "error",
"loc": Object {
"endColumn": 22,
"endLine": 92,
"endLine": 82,
"range": Array [
1675,
1678,
1522,
1525,
],
"startColumn": 19,
"startLine": 92,
"startLine": 82,
},
"message": "Duplicate param 'foo'",
"path": "./regression-tests/no-duplicate-param.yaml",
Expand Down
28 changes: 9 additions & 19 deletions regression-tests/no-duplicate-param.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,20 @@ spec:
- name: foo
value: foo
---
apiVersion: tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
name: no-duplicate-param-2
spec:
params:
- name: foo
value: foo
- name: foo
value: foo
resourcetemplates: []
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: no-duplicate-param-3
name: no-duplicate-param-2
spec:
params:
- name: foo
value: foo
- name: foo
value: foo
tasks:
- name: task
taskSpec:
params:
- name: foo
- name: foo
params:
- name: foo
value: foo
Expand All @@ -46,20 +33,21 @@ spec:
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: no-duplicate-param-4
name: no-duplicate-param-3
spec:
params:
- name: foo
value: foo
- name: foo
value: foo
steps: []
---
apiVersion: tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
name: no-duplicate-param-5
name: no-duplicate-param-4
spec:
params:
- name: foo
- name: foo
resourcetemplates:
- apiVersion: v1
kind: ConfigMap
Expand All @@ -76,11 +64,13 @@ spec:
pipelineSpec:
params:
- name: foo
- name: foo
tasks:
- name: task
taskSpec:
params:
- name: foo
- name: foo
params:
- name: foo
value: foo
Expand Down

0 comments on commit 6cc83be

Please sign in to comment.