blinka-reporter 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +57 -29
- data/lib/blinka_reporter/version.rb +1 -1
- data/lib/minitest/blinka_plugin.rb +11 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d91f6af985c1f6006c8764e5b9a33c6b44a7f29a4ce101704cc924c1671ef53
|
4
|
+
data.tar.gz: caee878d2c6208ac19d39ffe936470c1e010117fec558e243edfab66db9a1d5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '040953ad949228b1a23f60323a084d7854cd09c802b498db43fa52e7d81317c136caee762580fec3d07142c59d973a005ad9c80d040f4fbe1501f6fb36dfd2ab'
|
7
|
+
data.tar.gz: 9b01fc45223ce2a111ba85b3260d8965cb633e4f4317cf0bfb965b8e5c8582a7a394d501c417141c3377bd6ba6830da6829eeb4eaf2bb48ea68d606f6727de94
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.7.2] - 2023-02-19
|
11
|
+
|
12
|
+
- Adds support for `BLINKA_APPEND=true` to append to existing JSON-files.
|
13
|
+
|
10
14
|
## [0.7.1] - 2023-02-19
|
11
15
|
|
12
16
|
- Handles empty test results.
|
data/README.md
CHANGED
@@ -60,36 +60,47 @@ Add a step to your Github Action Workflow after running tests:
|
|
60
60
|
```yaml
|
61
61
|
- name: Minitest
|
62
62
|
env:
|
63
|
-
|
63
|
+
BLINKA_PATH: ./results.json
|
64
64
|
run: bundle exec rake test
|
65
65
|
|
66
|
-
|
66
|
+
// Add a tag to be able to separate multiple jobs, e.g. "ruby-${{ matrix.ruby }}".
|
67
|
+
// This is optional.
|
68
|
+
- name: Export Blinka-metadata
|
69
|
+
if: always()
|
67
70
|
run: |
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
echo "ruby gem" > ./blinka_tag
|
72
|
+
|
73
|
+
// Archive all files required by Blinka, json, the tag and any images.
|
74
|
+
// Blinka will automatically fetch the results when the Github Action Workflow is finished.
|
75
|
+
- name: Archive results for Blinka
|
76
|
+
if: always()
|
77
|
+
uses: actions/upload-artifact@v3
|
78
|
+
with:
|
79
|
+
name: blinka-${{ strategy.job-index }}
|
80
|
+
path: |
|
81
|
+
./results.json
|
82
|
+
./blinka_tag
|
75
83
|
```
|
76
84
|
|
77
85
|
```yaml
|
78
86
|
- name: Rspec
|
79
87
|
run: bundle exec rspec --formatter RspecJunitFormatter --out ./rspec.xml
|
80
|
-
|
88
|
+
|
89
|
+
- name: Export Blinka-metadata
|
90
|
+
if: always()
|
81
91
|
run: |
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
92
|
+
echo "ruby gem" > ./blinka_tag
|
93
|
+
|
94
|
+
- name: Archive results for Blinka
|
95
|
+
if: always()
|
96
|
+
uses: actions/upload-artifact@v3
|
97
|
+
with:
|
98
|
+
name: blinka-${{ strategy.job-index }}
|
99
|
+
path: |
|
100
|
+
./rspec.xml
|
101
|
+
./blinka_tag
|
89
102
|
```
|
90
103
|
|
91
|
-
`--tag` is optional and can be used to separate different reports, for example when using a build matrix.
|
92
|
-
|
93
104
|
## How to make multiple test runs into one report?
|
94
105
|
|
95
106
|
For example when running tests in parallel you might need to run system tests separately.
|
@@ -107,16 +118,33 @@ Output the test results to different paths with `BLINKA_PATH`.
|
|
107
118
|
BLINKA_JSON: ./tests.json
|
108
119
|
run: bundle exec rails test
|
109
120
|
|
110
|
-
- name:
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
121
|
+
- name: Archive results for Blinka
|
122
|
+
if: always()
|
123
|
+
uses: actions/upload-artifact@v3
|
124
|
+
with:
|
125
|
+
name: blinka-${{ strategy.job-index }}
|
126
|
+
path: |
|
127
|
+
./tests.json
|
128
|
+
./system_tests.json
|
129
|
+
./blinka_tag
|
130
|
+
```
|
131
|
+
|
132
|
+
## How can I run multiple test runs to one file?
|
133
|
+
|
134
|
+
For Minitest this can be done by setting `BLINKA_APPEND=true`, make sure to clean the `BLINKA_PATH` file before running the tests.
|
135
|
+
|
136
|
+
```yaml
|
137
|
+
- name: Tests 1
|
138
|
+
env:
|
139
|
+
BLINKA_PATH: ./tests.json
|
140
|
+
BLINKA_APPEND: true
|
141
|
+
run: bundle exec rails test:system
|
142
|
+
|
143
|
+
- name: Tests 2
|
144
|
+
env:
|
145
|
+
BLINKA_PATH: ./tests.json
|
146
|
+
BLINKA_APPEND: true
|
147
|
+
run: bundle exec rails test
|
120
148
|
```
|
121
149
|
|
122
150
|
## How can I report tests in TAP-format?
|
@@ -42,9 +42,19 @@ module Minitest
|
|
42
42
|
results:
|
43
43
|
tests&.map do |test_result|
|
44
44
|
BlinkaReporter::MinitestAdapter.new(test_result).report
|
45
|
-
end
|
45
|
+
end || []
|
46
46
|
}
|
47
47
|
|
48
|
+
if ENV['BLINKA_APPEND'] == 'true' && File.exist?(report_path)
|
49
|
+
existing =
|
50
|
+
JSON.parse(File.open(report_path).read, symbolize_names: true)
|
51
|
+
result[:results] = existing[:results] + result[:results]
|
52
|
+
result[:nbr_tests] = existing[:nbr_tests] + result[:nbr_tests]
|
53
|
+
result[:nbr_assertions] =
|
54
|
+
existing[:nbr_assertions] + result[:nbr_assertions]
|
55
|
+
result[:total_time] = existing[:total_time] + result[:total_time]
|
56
|
+
end
|
57
|
+
|
48
58
|
File.open(report_path, 'w+') do |file|
|
49
59
|
file.write(JSON.pretty_generate(result))
|
50
60
|
end
|