-
Notifications
You must be signed in to change notification settings - Fork 8
120 lines (117 loc) · 4.25 KB
/
test-json.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Tests JSON
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
jobs:
direct-from-repository-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Confirm execution without install/build
uses: ./
with:
name: "Successful cucumber report direct from repository"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json" # This committed report should be a success
ubuntu-action-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run cucumber || true
- run: npm run cucumber-ok || true
- run: npm run cucumber-undefined || true
- run: npm run cucumber-non-failed || true
- run: npm run cucumber-empty || true
- uses: ./
name: "fail because of error"
with:
name: "failed cucumber report"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json"
- uses: ./
name: "fail because of error (without number of error)"
with:
name: "failed (no number of error)"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json"
show-number-of-error-on-check-title: false
- uses: ./
name: "fail because of error with all annotation"
with:
name: "failed with all annotation"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json"
show-number-of-error-on-check-title: false
annotation-status-on-undefined: notice
annotation-status-on-pending: notice
- uses: ./
name: "fail because of undefined test"
with:
name: "failed because of undefined test"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report-non-failed.json"
check-status-on-undefined: "failure"
annotation-status-on-undefined: "failure"
- uses: ./
name: "fail because of pending test"
with:
name: "failed because of pending test"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report-non-failed.json"
check-status-on-pending: "failure"
annotation-status-on-pending: "failure"
- uses: ./
name: "neutral because of error"
with:
name: "neutral cucumber report"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json"
check-status-on-error: 'neutral'
annotation-status-on-error: 'warning'
- uses: ./
name: "sucess because all is ok"
with:
name: "success cucumber report"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report-ok.json"
check-status-on-error: 'neutral'
annotation-status-on-error: 'warning'
- uses: ./
id: success-with-empty-cucumber-report
name: "success with empty cucumber report"
with:
name: "success empty report"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report-empty.json"
- uses: ./
name: "job with summary"
with:
name: "job with summary"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json"
show-global-summary-report: 'true'
- id: check-output
name: "check output for cucumber-report-empty.json"
if: steps.success-with-empty-cucumber-report.output.cucumber-report-empty_failed_scenarios != 0
run: exit 1
- uses: ./
id: job-failed
continue-on-error: true
name: "fail job due to failed test"
with:
name: "fail job due to failed test"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report-non-failed.json"
check-status-on-pending: "failure"
annotation-status-on-pending: "failure"
number-of-test-error-to-fail-job: 1
- name: 'check that job-failed outcome is failed'
if: steps.job-failed.outcome == 'failure'
run: exit 0
- name: 'check that job-failed outcome is failed'
if: steps.job-failed.outcome != 'failure'
run: exit 1