rspec-watchdog 0.1.4 → 0.1.5
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/CHANGELOG.md +7 -0
- data/README.md +10 -0
- data/lib/rspec/watchdog/slow_spec_formatter.rb +22 -15
- data/lib/rspec/watchdog/version.rb +1 -1
- data/lib/rspec/watchdog.rb +1 -1
- data/rspec-watchdog-0.1.4.gem +0 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a2d7cf470c00b52f49425017a7389d2afb84f07bbcd16f582fe7a5455364a3c
|
4
|
+
data.tar.gz: 219af50dd343f4e4a0d4a19d379b541a163679c829647810a1a49578b27d79a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a53957da45639d5655cbc66c61a2bb3e9b9746ed5d518a89bdc1423a4e46f15cf686a4ca100c5ecb4dd7238c3505314a4fa6314581ff1ab2ba8819d9376870
|
7
|
+
data.tar.gz: be22c22d007e291bfe749611d3dce8e76b4f7298364b4a871f0cb88638d90476906d5b455875a39c201f293f027c568f00d58bfbb71968aa0d4048bf503413a0
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -47,6 +47,7 @@ Rspec::Watchdog.configure do |config|
|
|
47
47
|
# Set these only if using the dashboard integration
|
48
48
|
# config.watchdog_api_url = "http://your-app.com/watchdog/analytics"
|
49
49
|
# config.watchdog_api_token = "your_secret_token"
|
50
|
+
# config.fast_specs_threshold = 1.0 # in seconds to filter unflaky fast specs
|
50
51
|
end
|
51
52
|
|
52
53
|
RSpec.configure do |config|
|
@@ -84,6 +85,11 @@ This token is used to validate that the request being sent to the API is legitim
|
|
84
85
|
- If you're running tests in a CI/CD environment (e.g., GitHub Actions or CircleCI)
|
85
86
|
- Should match the token configured in your dashboard instance
|
86
87
|
|
88
|
+
#### `fast_specs_threshold` (Optional)
|
89
|
+
|
90
|
+
This threshold is used to filter out unflaky fast specs.
|
91
|
+
The idea is to focus on slow and flaky specs.
|
92
|
+
|
87
93
|
## Usage
|
88
94
|
|
89
95
|
After installation, RspecWatchdog automatically hooks into your RSpec test suite. You can start tracking your tests immediately without any additional configuration.
|
@@ -138,3 +144,7 @@ We welcome contributions to RspecWatchdog! If you have ideas, suggestions, or fi
|
|
138
144
|
## License
|
139
145
|
|
140
146
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
147
|
+
|
148
|
+
## Credits
|
149
|
+
|
150
|
+
RspecWatchdog is maintained by [Windmotion](https://windmotion.io) with the help of our [contributors](https://github.com/windmotion-io/rspec-watchdog/graphs/contributors).
|
@@ -11,12 +11,13 @@ class SlowSpecFormatter
|
|
11
11
|
@flaky_spec_detection = RSpec.configuration.flaky_spec_detection
|
12
12
|
@watchdog_api_url = Rspec::Watchdog.config.watchdog_api_url
|
13
13
|
@watchdog_api_token = Rspec::Watchdog.config.watchdog_api_token
|
14
|
+
@fast_specs_threshold = RSpec.configuration.fast_specs_threshold
|
14
15
|
end
|
15
16
|
|
16
17
|
def dump_summary(summary)
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
if @show_logs
|
19
|
+
puts "\nAll examples sorted by run time (most durable to fastest):"
|
20
|
+
end
|
20
21
|
|
21
22
|
all_examples = summary.examples.map do |example|
|
22
23
|
{
|
@@ -30,24 +31,30 @@ class SlowSpecFormatter
|
|
30
31
|
}
|
31
32
|
end
|
32
33
|
|
34
|
+
if @fast_specs_threshold
|
35
|
+
all_examples = all_examples.select { |ex| ex[:run_time] > @fast_specs_threshold && !ex[:flaky] }
|
36
|
+
end
|
37
|
+
|
33
38
|
sorted_examples = all_examples.sort_by { |ex| -ex[:run_time] }
|
34
39
|
|
35
40
|
sorted_examples.each do |ex|
|
36
41
|
puts "#{ex[:description]} (#{ex[:file_path]}) - #{ex[:run_time]} seconds - #{ex[:location]}"
|
37
42
|
end
|
38
43
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
44
|
+
if @show_logs
|
45
|
+
calculate_average_time(summary)
|
46
|
+
fastest_test(sorted_examples)
|
47
|
+
slowest_test(sorted_examples)
|
48
|
+
percentiles(sorted_examples)
|
49
|
+
failed_tests(summary)
|
50
|
+
tests_grouped_by_file(sorted_examples)
|
51
|
+
tests_that_tooked_longer_than(sorted_examples, 2.0)
|
52
|
+
time_distribution_analysis(sorted_examples)
|
53
|
+
test_stability_analysis(summary)
|
54
|
+
execution_time_variance(sorted_examples)
|
55
|
+
temporal_complexity_analysis(sorted_examples)
|
56
|
+
test_dependency_analysis(sorted_examples)
|
57
|
+
end
|
51
58
|
|
52
59
|
return unless @watchdog_api_url && @watchdog_api_token
|
53
60
|
|
data/lib/rspec/watchdog.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-watchdog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Aldunate
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-04-
|
12
|
+
date: 2025-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -46,6 +46,7 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
+
- CHANGELOG.md
|
49
50
|
- README.md
|
50
51
|
- Rakefile
|
51
52
|
- dashboard_1.png
|
@@ -56,6 +57,7 @@ files:
|
|
56
57
|
- rspec-watchdog-0.1.1.gem
|
57
58
|
- rspec-watchdog-0.1.2.gem
|
58
59
|
- rspec-watchdog-0.1.3.gem
|
60
|
+
- rspec-watchdog-0.1.4.gem
|
59
61
|
- sig/rspec/watchdog.rbs
|
60
62
|
homepage: https://github.com/windmotion-io/rspec-watchdog
|
61
63
|
licenses:
|
@@ -79,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
81
|
- !ruby/object:Gem::Version
|
80
82
|
version: '0'
|
81
83
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
84
|
+
rubygems_version: 3.5.11
|
83
85
|
signing_key:
|
84
86
|
specification_version: 4
|
85
87
|
summary: RSpec performance tracking and metrics
|