gloo-test 1.3 → 1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/results.rb +11 -0
- data/lib/test_runner.rb +2 -0
- 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: 4dfc0f6425cf939267eda29265a6145d1f30db09ea0fdc7494e85d920bd17399
|
|
4
|
+
data.tar.gz: ec80b8ccd8149243c0d3f6f458196ecd54b8dab0705082cc1328004ba3efa1ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83092cf5af2264484ca3d1fcee69e93746e01d4e7ba307e4e4d85db471fae053d92e0b385c96d4f65c1d59d8f9491874478507fb2976cff1d2bb0f901ad055e7
|
|
7
|
+
data.tar.gz: f3e4e1688f1390b1056e07006cbf1b98ba261dcf3557ca14491701ef0b827fd737739c96e92111c4851c372f3ca9db8e0caecddbc931b52778e0a49cda2cbe47
|
data/README.md
CHANGED
|
@@ -10,6 +10,8 @@ Loaded automatically when running gloo in test mode:
|
|
|
10
10
|
> gloo --test ./path/to/tests/
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
The run reports whether it passed: no test failed, and nothing was logged that no test expected. gloo uses that for its exit status (0 or 1), so scripts and CI can tell a failing run. See Testing in the gloo docs for how to write tests.
|
|
14
|
+
|
|
13
15
|
It can also be loaded explicitly in a script, like any other core library:
|
|
14
16
|
|
|
15
17
|
```gloo
|
data/lib/results.rb
CHANGED
|
@@ -72,6 +72,17 @@ class Results
|
|
|
72
72
|
# Show Results
|
|
73
73
|
# ---------------------------------------------------------------------
|
|
74
74
|
|
|
75
|
+
#
|
|
76
|
+
# Did the run as a whole pass? True when no test failed and nothing
|
|
77
|
+
# was logged that a test didn't expect (what the logged summary
|
|
78
|
+
# reports). gloo uses this for its exit status.
|
|
79
|
+
#
|
|
80
|
+
def passed?
|
|
81
|
+
return false if @fail_count.positive?
|
|
82
|
+
|
|
83
|
+
return get_logged_summary.nil?
|
|
84
|
+
end
|
|
85
|
+
|
|
75
86
|
#
|
|
76
87
|
# Show the results.
|
|
77
88
|
#
|
data/lib/test_runner.rb
CHANGED
|
@@ -18,6 +18,7 @@ class TestRunner
|
|
|
18
18
|
|
|
19
19
|
#
|
|
20
20
|
# Execute all tests and display results.
|
|
21
|
+
# Returns true if the run passed (see Results#passed?), false if not.
|
|
21
22
|
#
|
|
22
23
|
def run
|
|
23
24
|
# Count only what's logged from here on, not loading gloo-test.
|
|
@@ -32,6 +33,7 @@ class TestRunner
|
|
|
32
33
|
@results.show_failures
|
|
33
34
|
@results.show_results
|
|
34
35
|
@engine.log.debug "TestRunner is finished"
|
|
36
|
+
return @results.passed?
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
#
|