Skip to content

Commit 1e8d645

Browse files
committed
chore: Better log handling of missing tags
1 parent 77bb371 commit 1e8d645

10 files changed

+566
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- report examples (documentation)
13+
1014
### Changed
1115

1216
- Better log handling of missing tags

README.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ A simple plugin to check the presence of JUnit5 test by tags.
1010

1111
## Configuration reference
1212

13-
| parameter | type | required | notes |
14-
|--------------------------|---------|----------|------------------------------------------------------------|
15-
| format | string | false | default 'txt', accepts 'html', 'json', 'xml', 'pdf', 'txt' |
16-
| outputFile | string | true | path where should be produced the report |
17-
| requiredTags.requiredTag | string | true | tag to be checked |
18-
| failOnMissingTag | boolean | true | if set to 'true' the build will fail on missing tags |
13+
| parameter | type | required | notes |
14+
|--------------------------|---------|----------|--------------------------------------------------------------------------------------|
15+
| format | string | false | default 'txt', accepts 'html', 'json', 'xml', 'pdf', 'txt', 'xlsx', 'md', 'adoc' (*) |
16+
| outputFile | string | true | path where should be produced the report |
17+
| requiredTags.requiredTag | string | true | tag to be checked |
18+
| failOnMissingTag | boolean | true | if set to 'true' the build will fail on missing tags |
19+
20+
(*) html, pdf, xlsx, md and adoc formats are based on a common template. txt, xml and json reports are based on a specific format report.
1921

2022
Here is a sample configuration
2123

@@ -45,4 +47,55 @@ Here is a sample configuration
4547
</execution>
4648
</executions>
4749
</plugin>
50+
```
51+
52+
## Report
53+
54+
Sample reports output
55+
56+
- [HTML](src/docs/report-samples/executed-test-tag-report.html)
57+
- [TXT](src/docs/report-samples/executed-test-tag-report.txt)
58+
- [JSON](src/docs/report-samples/executed-test-tag-report.json)
59+
- [XML](src/docs/report-samples/executed-test-tag-report.xml)
60+
- [PDF](src/docs/report-samples/executed-test-tag-report.pdf)
61+
- [XLSX](src/docs/report-samples/executed-test-tag-report.xlsx)
62+
- [Markdown](src/docs/report-samples/executed-test-tag-report.md)
63+
- [AsciiDoc](src/docs/report-samples/executed-test-tag-report.asoc)
64+
65+
And here is the Markdown version
66+
67+
```
68+
# **Executed Test Tag Report**
69+
70+
## **Summary**
71+
72+
73+
| Metric | Count |
74+
|---------------|---------------|
75+
| Total Tests | 8 |
76+
| Passed | 8 |
77+
| Failed | 0 |
78+
| Errors | 0 |
79+
80+
## **Tags Summary**
81+
82+
| Tag | Tests |
83+
|---------------|---------------|
84+
| security | 8 |
85+
| authorized | 2 |
86+
| unauthorized | 5 |
87+
| forbidden | 1 |
88+
89+
## **All Executed Tests**
90+
91+
| Status | Test | Tags | Time |
92+
|---------------|---------------|---------------|---------------|
93+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testHtmlOkNoAdminRole | security authorized | 1.512s |
94+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testHtml401NoAuthorizationBearer | security unauthorized | 0.01s |
95+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testAsciiDocNoAuthorizationBearer | security unauthorized | 0.007s |
96+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testPdfOkNoAdminRole | security authorized | 0.057s |
97+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testInvalidJwtPayload | security unauthorized | 0.012s |
98+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testMarkdown403NoAdminRole | security forbidden | 0.007s |
99+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testMarkdown401NoAuthorizationBearer | security unauthorized | 0.005s |
100+
| ✅ | test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testInvalidJwt | security unauthorized | 0.008s |
48101
```
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
= Executed Test Tag Report
2+
fugerit79
3+
:description: Report
4+
:lang: en
5+
:generator: Venus Fugerit Doc over Apache FreeMarker
6+
:created-by: Venus Fugerit Doc (https://venusdocs.fugerit.org)
7+
8+
== *Executed Test Tag Report* +
9+
=== *Summary* +
10+
11+
[%header,cols="50,50"]
12+
|===
13+
|Metric |Count
14+
|Total Tests |8
15+
|Passed |8
16+
|Failed |0
17+
|Errors |0
18+
|===
19+
=== *Tags Summary* +
20+
21+
[%header,cols="50,50"]
22+
|===
23+
|Tag |Tests
24+
|security |8
25+
|authorized |2
26+
|unauthorized |5
27+
|forbidden |1
28+
|===
29+
=== *All Executed Tests* +
30+
31+
[%header,cols="15,55,15,15"]
32+
|===
33+
|Status |Test |Tags |Time
34+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testHtmlOkNoAdminRole |security authorized |1.37s
35+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testHtml401NoAuthorizationBearer |security unauthorized |0.009s
36+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testAsciiDocNoAuthorizationBearer |security unauthorized |0.008s
37+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testPdfOkNoAdminRole |security authorized |0.057s
38+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testInvalidJwtPayload |security unauthorized |0.012s
39+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testMarkdown403NoAdminRole |security forbidden |0.007s
40+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testMarkdown401NoAuthorizationBearer |security unauthorized |0.007s
41+
|✅ |test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testInvalidJwt |security unauthorized |0.008s
42+
|===
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>Executed Test Tag Report</title>
5+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
6+
<meta name="author" content="fugerit79"/>
7+
<meta name="description" content="Report"/>
8+
<meta http-equiv="content-language" content="en"/>
9+
<meta http-equiv="generator" content="Venus Fugerit Doc over Apache FreeMarker"/>
10+
<meta http-equiv="created-by" content="Venus Fugerit Doc (https://venusdocs.fugerit.org)"/>
11+
<meta name="doc-version-compatibility" content="2-x"/>
12+
13+
<style type="text/css">
14+
15+
body { font-family: Arial, sans-serif; margin: 20px; }
16+
table { border-collapse: collapse; width: 100%; margin: 20px 0; }
17+
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
18+
th { background-color: #4CAF50; color: white; }
19+
tr:nth-child(even) { background-color: #f2f2f2; }
20+
.pass { color: green; }
21+
.fail { color: red; }
22+
.error { color: orange; }
23+
.skip { color: gray; }
24+
.tag { background-color: #e7f3ff; padding: 2px 8px; border-radius: 3px; margin: 2px; display: inline-block; }
25+
</style>
26+
</head>
27+
<body>
28+
<div>
29+
<h1 style="font-weight: bold;">Executed Test Tag Report</h1>
30+
<h2 style="font-weight: bold; padding-top: 20px;">Summary</h2>
31+
<table style=' width: 100%'>
32+
<thead>
33+
<tr>
34+
<th id="cell_0_0" style=" width: 50%;">
35+
<span >Metric</span>
36+
</th>
37+
<th id="cell_0_1" style=" width: 50%;">
38+
<span >Count</span>
39+
</th>
40+
</tr>
41+
</thead>
42+
<tbody>
43+
<tr>
44+
<td id="cell_0_0" style=" width: 50%;">
45+
<span >Total Tests</span>
46+
</td>
47+
<td id="cell_0_1" style=" width: 50%;">
48+
<span >8</span>
49+
</td>
50+
</tr>
51+
<tr>
52+
<td id="cell_1_0" style=" width: 50%;">
53+
<span >Passed</span>
54+
</td>
55+
<td id="cell_1_1" style=" width: 50%;">
56+
<span class="pass" >8</span>
57+
</td>
58+
</tr>
59+
<tr>
60+
<td id="cell_2_0" style=" width: 50%;">
61+
<span >Failed</span>
62+
</td>
63+
<td id="cell_2_1" style=" width: 50%;">
64+
<span class="fail" >0</span>
65+
</td>
66+
</tr>
67+
<tr>
68+
<td id="cell_3_0" style=" width: 50%;">
69+
<span >Errors</span>
70+
</td>
71+
<td id="cell_3_1" style=" width: 50%;">
72+
<span class="error" >0</span>
73+
</td>
74+
</tr>
75+
</tbody>
76+
</table>
77+
<h2 style="font-weight: bold; padding-top: 20px;">Tags Summary</h2>
78+
<table style=' width: 100%'>
79+
<thead>
80+
<tr>
81+
<th id="cell_0_0" style=" width: 50%;">
82+
<span >Tag</span>
83+
</th>
84+
<th id="cell_0_1" style=" width: 50%;">
85+
<span >Tests</span>
86+
</th>
87+
</tr>
88+
</thead>
89+
<tbody>
90+
<tr>
91+
<td id="cell_0_0" style=" width: 50%;">
92+
<span >security</span>
93+
</td>
94+
<td id="cell_0_1" style=" width: 50%;">
95+
<span >8</span>
96+
</td>
97+
</tr>
98+
<tr>
99+
<td id="cell_1_0" style=" width: 50%;">
100+
<span >authorized</span>
101+
</td>
102+
<td id="cell_1_1" style=" width: 50%;">
103+
<span >2</span>
104+
</td>
105+
</tr>
106+
<tr>
107+
<td id="cell_2_0" style=" width: 50%;">
108+
<span >unauthorized</span>
109+
</td>
110+
<td id="cell_2_1" style=" width: 50%;">
111+
<span >5</span>
112+
</td>
113+
</tr>
114+
</tbody>
115+
</table>
116+
<h2 style="font-weight: bold; padding-top: 20px;">All Executed Tests</h2>
117+
<table style=' width: 100%'>
118+
<thead>
119+
<tr>
120+
<th id="cell_0_0" style=" width: 15%;">
121+
<span >Status</span>
122+
</th>
123+
<th id="cell_0_1" style=" width: 55%;">
124+
<span >Test</span>
125+
</th>
126+
<th id="cell_0_2" style=" width: 15%;">
127+
<span >Tags</span>
128+
</th>
129+
<th id="cell_0_3" style=" width: 15%;">
130+
<span >Time</span>
131+
</th>
132+
</tr>
133+
</thead>
134+
<tbody>
135+
<tr>
136+
<td id="cell_0_0" style=" width: 15%;">
137+
<span ></span>
138+
</td>
139+
<td id="cell_0_1" style=" width: 55%;">
140+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testHtmlOkNoAdminRole</span>
141+
</td>
142+
<td id="cell_0_2" style=" width: 15%;">
143+
<span class="tag" >security</span>
144+
<span class="tag" >authorized</span>
145+
</td>
146+
<td id="cell_0_3" style=" width: 15%;">
147+
<span >1.627s</span>
148+
</td>
149+
</tr>
150+
<tr>
151+
<td id="cell_1_0" style=" width: 15%;">
152+
<span ></span>
153+
</td>
154+
<td id="cell_1_1" style=" width: 55%;">
155+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testHtml401NoAuthorizationBearer</span>
156+
</td>
157+
<td id="cell_1_2" style=" width: 15%;">
158+
<span class="tag" >security</span>
159+
<span class="tag" >unauthorized</span>
160+
</td>
161+
<td id="cell_1_3" style=" width: 15%;">
162+
<span >0.01s</span>
163+
</td>
164+
</tr>
165+
<tr>
166+
<td id="cell_2_0" style=" width: 15%;">
167+
<span ></span>
168+
</td>
169+
<td id="cell_2_1" style=" width: 55%;">
170+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testAsciiDocNoAuthorizationBearer</span>
171+
</td>
172+
<td id="cell_2_2" style=" width: 15%;">
173+
<span class="tag" >security</span>
174+
<span class="tag" >unauthorized</span>
175+
</td>
176+
<td id="cell_2_3" style=" width: 15%;">
177+
<span >0.008s</span>
178+
</td>
179+
</tr>
180+
<tr>
181+
<td id="cell_3_0" style=" width: 15%;">
182+
<span ></span>
183+
</td>
184+
<td id="cell_3_1" style=" width: 55%;">
185+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testPdfOkNoAdminRole</span>
186+
</td>
187+
<td id="cell_3_2" style=" width: 15%;">
188+
<span class="tag" >security</span>
189+
<span class="tag" >authorized</span>
190+
</td>
191+
<td id="cell_3_3" style=" width: 15%;">
192+
<span >0.088s</span>
193+
</td>
194+
</tr>
195+
<tr>
196+
<td id="cell_4_0" style=" width: 15%;">
197+
<span ></span>
198+
</td>
199+
<td id="cell_4_1" style=" width: 55%;">
200+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testInvalidJwtPayload</span>
201+
</td>
202+
<td id="cell_4_2" style=" width: 15%;">
203+
<span class="tag" >security</span>
204+
<span class="tag" >unauthorized</span>
205+
</td>
206+
<td id="cell_4_3" style=" width: 15%;">
207+
<span >0.03s</span>
208+
</td>
209+
</tr>
210+
<tr>
211+
<td id="cell_5_0" style=" width: 15%;">
212+
<span ></span>
213+
</td>
214+
<td id="cell_5_1" style=" width: 55%;">
215+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testMarkdown403NoAdminRole</span>
216+
</td>
217+
<td id="cell_5_2" style=" width: 15%;">
218+
<span class="tag" >security</span>
219+
</td>
220+
<td id="cell_5_3" style=" width: 15%;">
221+
<span >0.039s</span>
222+
</td>
223+
</tr>
224+
<tr>
225+
<td id="cell_6_0" style=" width: 15%;">
226+
<span ></span>
227+
</td>
228+
<td id="cell_6_1" style=" width: 55%;">
229+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testMarkdown401NoAuthorizationBearer</span>
230+
</td>
231+
<td id="cell_6_2" style=" width: 15%;">
232+
<span class="tag" >security</span>
233+
<span class="tag" >unauthorized</span>
234+
</td>
235+
<td id="cell_6_3" style=" width: 15%;">
236+
<span >0.011s</span>
237+
</td>
238+
</tr>
239+
<tr>
240+
<td id="cell_7_0" style=" width: 15%;">
241+
<span ></span>
242+
</td>
243+
<td id="cell_7_1" style=" width: 55%;">
244+
<span >test.org.fugerit.java.demo.unittestdemoapp.DocResourceSicurezzaTest​#testInvalidJwt</span>
245+
</td>
246+
<td id="cell_7_2" style=" width: 15%;">
247+
<span class="tag" >security</span>
248+
<span class="tag" >unauthorized</span>
249+
</td>
250+
<td id="cell_7_3" style=" width: 15%;">
251+
<span >0.015s</span>
252+
</td>
253+
</tr>
254+
</tbody>
255+
</table>
256+
</div>
257+
</body>
258+
</html>

0 commit comments

Comments
 (0)