Skip to content

Commit 6668965

Browse files
committed
Simple acceptance test for ec validate input text
Include the --color flag added in the previous commit. Ref: https://issues.redhat.com/browse/EC-1576
1 parent 475701a commit 6668965

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

features/__snapshots__/validate_input.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@
2828

2929
[valid policy URL:stderr - 1]
3030

31+
---
32+
[valid policy URL with text output:stdout - 1]
33+
Success: true
34+
Result: SUCCESS
35+
Violations: 0, Warnings: 0, Successes: 1
36+
Input File: pipeline_definition.yaml
37+
38+
Results:
39+
✓ [Success] main.acceptor
40+
FilePath: pipeline_definition.yaml
41+
42+
43+
---
44+
45+
[valid policy URL with text output:stderr - 1]
46+
3147
---
3248

3349
[policy with multiple sources:stdout - 1]

features/validate_input.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@ Feature: validate input
2727
Then the exit status should be 0
2828
Then the output should match the snapshot
2929

30+
Scenario: valid policy URL with text output
31+
Given a git repository named "happy-day-config" with
32+
| policy.yaml | examples/happy_config.yaml |
33+
Given a git repository named "happy-day-policy" with
34+
| main.rego | examples/happy_day.rego |
35+
Given a pipeline definition file named "pipeline_definition.yaml" containing
36+
"""
37+
---
38+
apiVersion: tekton.dev/v1
39+
kind: Pipeline
40+
metadata:
41+
name: basic-build
42+
spec:
43+
tasks:
44+
- name: appstudio-init
45+
taskRef:
46+
name: init
47+
version: "0.1"
48+
"""
49+
When ec command is run with "validate input --file pipeline_definition.yaml --policy git::https://${GITHOST}/git/happy-day-config.git --output text --show-successes --color"
50+
Then the exit status should be 0
51+
Then the output should match the snapshot
52+
3053
Scenario: policy URL with no rego files
3154
Given a git repository named "sad-day-config" with
3255
| policy.yaml | examples/sad_config.yaml |

0 commit comments

Comments
 (0)