turbo_tests2 3.1.0 → 3.1.2
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +39 -1
- data/CONTRIBUTING.md +17 -1
- data/LICENSE.md +13 -13
- data/README.md +24 -23
- data/SECURITY.md +1 -1
- data/lib/turbo_tests/cli.rb +29 -10
- data/lib/turbo_tests/json_rows_formatter.rb +23 -23
- data/lib/turbo_tests/reporter.rb +11 -11
- data/lib/turbo_tests/runner.rb +75 -31
- data/lib/turbo_tests/version.rb +1 -1
- data/lib/turbo_tests.rb +7 -7
- data.tar.gz.sig +0 -0
- metadata +22 -23
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f7e32f7c287251c9f42dc998ba6b717d2977f1f8d741de4f1f0fb774089589b
|
|
4
|
+
data.tar.gz: fffd71116b9ce2d824896c779feaa53d467fece2e8e649074690c9e98752a035
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b35cc849e52d2c7963fdfa1f51a558261cd7fc0ee00b63c04c7d4d8170fa515aaf0a51717e9bf1fb1bf2e6b2c8eaa19a67f2aac1f9bbbe7ffacdc20140ed4da
|
|
7
|
+
data.tar.gz: d24ee3ba58ec58d7d942d1f9fc5617fa1d12e34efbc8a65dc5a1db52018af5660a287c7f9c08ce207061ba0d71ecc5727506f92b01bbcc80dda112e0251fb547
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,40 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [3.1.2] - 2026-06-08
|
|
34
|
+
|
|
35
|
+
- TAG: [v3.1.2][3.1.2t]
|
|
36
|
+
- COVERAGE: 94.62% -- 651/688 lines in 16 files
|
|
37
|
+
- BRANCH COVERAGE: 79.33% -- 119/150 branches in 16 files
|
|
38
|
+
- 37.08% documented
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- `turbo_tests2` now generates and reports a global random seed by default,
|
|
43
|
+
passes it to every worker process, and supports `--order defined` /
|
|
44
|
+
`--no-random` for ordered runs without a seed.
|
|
45
|
+
- Worker PID cleanup now uses the `parallel_tests` pid file path captured when the subprocess starts, avoiding JRuby failures after the pid-file environment is restored.
|
|
46
|
+
|
|
47
|
+
## [3.1.1] - 2026-06-02
|
|
48
|
+
|
|
49
|
+
- TAG: [v3.1.1][3.1.1t]
|
|
50
|
+
- COVERAGE: 94.63% -- 634/670 lines in 16 files
|
|
51
|
+
- BRANCH COVERAGE: 78.17% -- 111/142 branches in 16 files
|
|
52
|
+
- 36.78% documented
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- The CLI now honors documented `turbo_tests2:setup` and `turbo_tests2:cleanup`
|
|
57
|
+
Rake hooks, while still falling back to legacy `turbo_tests:*` hooks.
|
|
58
|
+
- Worker processes now receive the full `parallel_tests` environment metadata, so SimpleCov
|
|
59
|
+
defers minimum coverage enforcement to the combined final result instead of checking each
|
|
60
|
+
shard independently.
|
|
61
|
+
|
|
62
|
+
- Restored Ruby 2.4 compatibility for worker wait-thread cleanup.
|
|
63
|
+
- The coverage workflow now runs `kettle-test` through direct RSpec execution,
|
|
64
|
+
so hard coverage thresholds are checked against the complete suite result
|
|
65
|
+
while other gems can still use `turbo_tests2` under `kettle-test`.
|
|
66
|
+
|
|
33
67
|
## [3.1.0] - 2026-05-28
|
|
34
68
|
|
|
35
69
|
- TAG: [v3.1.0][3.1.0t]
|
|
@@ -92,7 +126,11 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
92
126
|
|
|
93
127
|
- Initial release
|
|
94
128
|
|
|
95
|
-
[Unreleased]: https://github.com/galtzo-floss/turbo_tests2/compare/v3.1.
|
|
129
|
+
[Unreleased]: https://github.com/galtzo-floss/turbo_tests2/compare/v3.1.2...HEAD
|
|
130
|
+
[3.1.2]: https://github.com/galtzo-floss/turbo_tests2/compare/v3.1.1...v3.1.2
|
|
131
|
+
[3.1.2t]: https://github.com/galtzo-floss/turbo_tests2/releases/tag/v3.1.2
|
|
132
|
+
[3.1.1]: https://github.com/galtzo-floss/turbo_tests2/compare/v3.1.0...v3.1.1
|
|
133
|
+
[3.1.1t]: https://github.com/galtzo-floss/turbo_tests2/releases/tag/v3.1.1
|
|
96
134
|
[3.1.0]: https://github.com/galtzo-floss/turbo_tests2/compare/v3.0.0...v3.1.0
|
|
97
135
|
[3.1.0t]: https://github.com/galtzo-floss/turbo_tests2/releases/tag/v3.1.0
|
|
98
136
|
[3.0.0]: https://github.com/galtzo-floss/turbo_tests2/compare/7d4064e5b8acc2f53929fccf7be3eb63f8a9f140...v3.0.0
|
data/CONTRIBUTING.md
CHANGED
|
@@ -102,13 +102,29 @@ Git hooks and commit message helpers (exe/kettle-commit-msg)
|
|
|
102
102
|
- GIT_HOOK_FOOTER_SENTINEL: Required when footer append is enabled — a unique first-line sentinel to prevent duplicates
|
|
103
103
|
- GIT_HOOK_FOOTER_APPEND_DEBUG: Extra debug output in the footer template (true/false)
|
|
104
104
|
|
|
105
|
+
Git diff driver setup
|
|
106
|
+
- Local setup writes repository `.gitattributes` entries and local Git `diff.smorg-*` command config so this checkout uses StructuredMerge semantic diffs.
|
|
107
|
+
- Global setup registers `diff.smorg-*` commands once in the user Git config; use it when you work across several StructuredMerge-enabled repositories.
|
|
108
|
+
- Include-file setup writes `.git/smorg/config` and includes it from local Git config, keeping command registrations out of the repository files.
|
|
109
|
+
- Git hosting forges generally ignore external diff drivers, so pull request views may still show raw textual diffs even when local `git diff` uses semantic drivers.
|
|
110
|
+
|
|
111
|
+
```console
|
|
112
|
+
K_JEM_TEMPLATING=true bundle exec kettle-jem install
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Troubleshooting Git diffs
|
|
116
|
+
- Use `git diff --no-ext-diff` to compare against Git's built-in diff output.
|
|
117
|
+
- Use `git diff --no-textconv` when a textconv projection obscures the raw file bytes you need to inspect.
|
|
118
|
+
- If Git reports a missing `smorg-*` executable, rerun `bundle install` and the setup command above, then check `git config --local --get-regexp '^diff\.smorg-'`.
|
|
119
|
+
- To remove managed local entries, run `K_JEM_TEMPLATING=true bundle exec kettle-jem install --undo`; remove global command registrations with `git config --global --unset-all diff.smorg-ruby.command`.
|
|
120
|
+
|
|
105
121
|
For a quick starting point, this repository’s `mise.toml` defines the shared defaults, and `.env.local` can override them locally. Copy `.env.local.example` to `.env.local`, use `KEY=value` lines, and either activate `mise` in your shell or run commands through `mise exec -C /path/to/project -- ...`.
|
|
106
122
|
|
|
107
123
|
## Appraisals
|
|
108
124
|
|
|
109
125
|
From time to time the [appraisal2][🚎appraisal2] gemfiles in `gemfiles/` will need to be updated.
|
|
110
126
|
Generated appraisal and CI workflow floors are controlled by `ruby.test_minimum`
|
|
111
|
-
in `.kettle-jem.yml`; this project was templated with `ruby.test_minimum: 2.4`.
|
|
127
|
+
in `.structuredmerge/kettle-jem.yml`; this project was templated with `ruby.test_minimum: 2.4`.
|
|
112
128
|
That value describes the lowest Ruby version expected to run the test/development
|
|
113
129
|
toolchain, and it may be higher than the gemspec runtime floor.
|
|
114
130
|
|
data/LICENSE.md
CHANGED
|
@@ -7,16 +7,16 @@ Choose the option that best fits your use case:
|
|
|
7
7
|
|
|
8
8
|
## Copyright Notice
|
|
9
9
|
|
|
10
|
-
Copyright (c) 2020-2023 Illia
|
|
11
|
-
Copyright (c) 2020 Ilya Zub
|
|
12
|
-
Copyright (c) 2021 AMHOL
|
|
13
|
-
Copyright (c) 2021 Serge Bedzhyk
|
|
14
|
-
Copyright (c) 2023 Bo Anderson
|
|
15
|
-
Copyright (c) 2023 Dmitiry Zub☀️
|
|
16
|
-
Copyright (c) 2023-2024 Illia
|
|
17
|
-
Copyright (c) 2023 mrudzki
|
|
18
|
-
Copyright (c) 2023-2024 Sebastien Savater
|
|
19
|
-
Copyright (c) 2024 David Rodriguez
|
|
20
|
-
Copyright (c) 2024 Hiroshi SHIBATA
|
|
21
|
-
Copyright (c) 2025 Gareth Jones
|
|
22
|
-
Copyright (c) 2025-2026 Peter H. Boling
|
|
10
|
+
- Copyright (c) 2020-2023 Illia
|
|
11
|
+
- Copyright (c) 2020 Ilya Zub
|
|
12
|
+
- Copyright (c) 2021 AMHOL
|
|
13
|
+
- Copyright (c) 2021 Serge Bedzhyk
|
|
14
|
+
- Copyright (c) 2023 Bo Anderson
|
|
15
|
+
- Copyright (c) 2023 Dmitiry Zub☀️
|
|
16
|
+
- Copyright (c) 2023-2024 Illia
|
|
17
|
+
- Copyright (c) 2023 mrudzki
|
|
18
|
+
- Copyright (c) 2023-2024 Sebastien Savater
|
|
19
|
+
- Copyright (c) 2024 David Rodriguez
|
|
20
|
+
- Copyright (c) 2024 Hiroshi SHIBATA
|
|
21
|
+
- Copyright (c) 2025-2026 Gareth Jones
|
|
22
|
+
- Copyright (c) 2025-2026 Peter H. Boling
|
data/README.md
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[🖼️galtzo-floss-i]: https://logos.galtzo.com/assets/images/galtzo-floss/avatar-192px.svg
|
|
4
|
-
[🖼️galtzo-floss]: https://discord.gg/3qme4XHNKN
|
|
5
|
-
[🖼️ruby-lang-i]: https://logos.galtzo.com/assets/images/ruby-lang/avatar-192px.svg
|
|
6
|
-
[🖼️ruby-lang]: https://www.ruby-lang.org/
|
|
7
|
-
[🖼️galtzo-floss-turbo_tests2-i]: https://logos.galtzo.com/assets/images/galtzo-floss/turbo_tests2/avatar-192px.svg
|
|
8
|
-
[🖼️galtzo-floss-turbo_tests2]: https://github.com/galtzo-floss/turbo_tests2
|
|
1
|
+
<a href="https://github.com/galtzo-floss/turbo_tests2"><img alt="turbo_tests2 Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/turbo_tests2/avatar-128px.svg" width="20%" align="right"/></a>
|
|
9
2
|
|
|
10
3
|
# 🚀 TurboTests
|
|
11
4
|
|
|
12
5
|
[![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
|
|
13
6
|
|
|
14
|
-
`if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][
|
|
7
|
+
`if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][✉️discord-invite], as I may have missed the [discord notification][✉️discord-invite].
|
|
15
8
|
|
|
16
9
|
---
|
|
17
10
|
|
|
@@ -26,7 +19,7 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
|
|
|
26
19
|
|
|
27
20
|
</details>
|
|
28
21
|
|
|
29
|
-
## 🌻 Synopsis
|
|
22
|
+
## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
|
|
30
23
|
|
|
31
24
|
| Hard Fork Note |
|
|
32
25
|
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
@@ -98,8 +91,6 @@ not practical for the current toolchain.
|
|
|
98
91
|
|------------------------------------------------|--------------------------------------------------------|
|
|
99
92
|
| 👟 Check it out! | ✨ [github.com/appraisal-rb/appraisal2][💎appraisal2] ✨ |
|
|
100
93
|
|
|
101
|
-
|
|
102
|
-
|
|
103
94
|
### Federated DVCS
|
|
104
95
|
|
|
105
96
|
<details markdown="1">
|
|
@@ -190,20 +181,28 @@ Usage: turbo_tests2 [options]
|
|
|
190
181
|
turbo_tests2 spec/bar spec/baz/xxx_spec.rb
|
|
191
182
|
|
|
192
183
|
Options:
|
|
193
|
-
-n [PROCESSES]
|
|
184
|
+
-n, -w, --workers [PROCESSES] How many processes to use, default: available CPUs
|
|
194
185
|
-r, --require PATH Require a file.
|
|
195
186
|
-f, --format FORMATTER Choose a formatter. Available formatters: progress (p), documentation (d). Default: progress
|
|
196
187
|
-t, --tag TAG Run examples with the specified tag.
|
|
197
188
|
-o, --out FILE Write output to a file instead of $stdout
|
|
198
189
|
--runtime-log FILE Location of previously recorded test runtimes
|
|
190
|
+
--example-status-log FILE Use RSpec example status persistence timings for grouping
|
|
199
191
|
-v, --verbose More output
|
|
200
192
|
--fail-fast=[N]
|
|
201
193
|
--seed SEED Seed for rspec
|
|
202
|
-
--
|
|
194
|
+
--order ORDER RSpec example order: random (default) or defined
|
|
195
|
+
--no-random Run examples in defined order without passing a seed
|
|
196
|
+
--create Create databases
|
|
203
197
|
--print_failed_group Prints group that had failures in it
|
|
198
|
+
--nice execute test commands with low priority
|
|
204
199
|
```
|
|
205
200
|
|
|
206
|
-
|
|
201
|
+
By default, `turbo_tests2` generates one random RSpec seed, prints it, and passes
|
|
202
|
+
that same seed to every worker process. Use `--seed SEED` to replay a run, or
|
|
203
|
+
`--order defined` / `--no-random` when you want ordered examples without a seed.
|
|
204
|
+
|
|
205
|
+
To pass any options supported by parallel_tests, use `--`:
|
|
207
206
|
|
|
208
207
|
```bash
|
|
209
208
|
bundle exec turbo_tests2 -n 4 -- --only-group 1 --pattern spec/system
|
|
@@ -217,12 +216,12 @@ bundle exec turbo_tests2 -r fuubar -f Fuubar spec/whatever
|
|
|
217
216
|
|
|
218
217
|
### Rake Hooks
|
|
219
218
|
|
|
220
|
-
If Rake is present, the CLI will invoke the tasks `
|
|
219
|
+
If Rake is present, the CLI will invoke the tasks `turbo_tests2:setup` and `turbo_tests2:cleanup` before and after running
|
|
221
220
|
the test suite. These can be used to do work that should only happen once, such as removing files or collating coverage:
|
|
222
221
|
|
|
223
222
|
```ruby
|
|
224
223
|
# lib/tasks/turbo_tests.rake
|
|
225
|
-
namespace :
|
|
224
|
+
namespace :turbo_tests2 do
|
|
226
225
|
task setup: :environment do
|
|
227
226
|
# precompile assets once, to avoid doing it per each process
|
|
228
227
|
Rake::Tasks["assets:precompile"]
|
|
@@ -256,8 +255,8 @@ SimpleCov.start("rails") do
|
|
|
256
255
|
formatter SimpleCov::Formatter::SimpleFormatter
|
|
257
256
|
end
|
|
258
257
|
|
|
259
|
-
# lib/tasks/
|
|
260
|
-
namespace :
|
|
258
|
+
# lib/tasks/turbo_tests2.rake
|
|
259
|
+
namespace :turbo_tests2 do
|
|
261
260
|
task setup: :environment do
|
|
262
261
|
# remove any existing coverage files to avoid false reporting
|
|
263
262
|
FileUtils.rm_rf("coverage/turbo_tests")
|
|
@@ -439,7 +438,7 @@ See [LICENSE.md][📄license] for the official copyright notice.
|
|
|
439
438
|
- Copyright (c) 2023-2024 Sebastien Savater
|
|
440
439
|
- Copyright (c) 2024 David Rodriguez
|
|
441
440
|
- Copyright (c) 2024 Hiroshi SHIBATA
|
|
442
|
-
- Copyright (c) 2025 Gareth Jones
|
|
441
|
+
- Copyright (c) 2025-2026 Gareth Jones
|
|
443
442
|
- Copyright (c) 2025-2026 Peter H. Boling
|
|
444
443
|
|
|
445
444
|
</details>
|
|
@@ -463,6 +462,8 @@ To say "thanks!" ☝️ Join the Discord or 👇️ send money.
|
|
|
463
462
|
|
|
464
463
|
### Please give the project a star ⭐ ♥.
|
|
465
464
|
|
|
465
|
+
Many parts of this project are actively managed by a [kettle-jem](https://github.com/structuredmerge/structuredmerge-ruby/tree/main/gems/kettle-jem) smart template utilizing [StructuredMerge.org](https://structuredmerge.org) merge contracts.
|
|
466
|
+
|
|
466
467
|
Thanks for RTFM. ☺️
|
|
467
468
|
|
|
468
469
|
[⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
|
|
@@ -651,7 +652,7 @@ Thanks for RTFM. ☺️
|
|
|
651
652
|
[📌gitmoji]: https://gitmoji.dev
|
|
652
653
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
653
654
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
654
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
655
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.688-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
655
656
|
[🔐security]: https://github.com/galtzo-floss/turbo_tests2/blob/main/SECURITY.md
|
|
656
657
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
657
658
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
|
@@ -677,9 +678,9 @@ Thanks for RTFM. ☺️
|
|
|
677
678
|
| Field | Value |
|
|
678
679
|
|---|---|
|
|
679
680
|
| Package | turbo_tests2 |
|
|
680
|
-
| Description | 🚀
|
|
681
|
+
| Description | 🚀 turbo_tests2` is a drop-in replacement for `serpapi/turbo_tests` and `grosser/parallel_tests` with incremental summarized output. Source code of `turbo_test2` gem is based on Discourse and Rubygems work in this area (see README.md). |
|
|
681
682
|
| Homepage | https://github.com/galtzo-floss/turbo_tests2 |
|
|
682
|
-
| Source | https://github.com/galtzo-floss/turbo_tests2/tree/v3.
|
|
683
|
+
| Source | https://github.com/galtzo-floss/turbo_tests2/tree/v3.1.1 |
|
|
683
684
|
| License | `MIT` |
|
|
684
685
|
| Funding | https://github.com/sponsors/pboling, https://issuehunt.io/u/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/galtzo-floss, https://patreon.com/galtzo, https://polar.sh/pboling, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/turbo_tests2, https://www.buymeacoffee.com/pboling |
|
|
685
686
|
<!-- kettle-jem:metadata:end -->
|
data/SECURITY.md
CHANGED
data/lib/turbo_tests/cli.rb
CHANGED
|
@@ -21,6 +21,7 @@ module TurboTests
|
|
|
21
21
|
verbose = false
|
|
22
22
|
fail_fast = nil
|
|
23
23
|
seed = nil
|
|
24
|
+
order = nil
|
|
24
25
|
print_failed_group = false
|
|
25
26
|
create = false
|
|
26
27
|
nice = false
|
|
@@ -52,11 +53,11 @@ module TurboTests
|
|
|
52
53
|
opts.on(
|
|
53
54
|
"-f",
|
|
54
55
|
"--format FORMATTER",
|
|
55
|
-
"Choose a formatter. Available formatters: progress (p), documentation (d). Default: progress"
|
|
56
|
+
"Choose a formatter. Available formatters: progress (p), documentation (d). Default: progress"
|
|
56
57
|
) do |name|
|
|
57
58
|
formatters << {
|
|
58
59
|
name: name,
|
|
59
|
-
outputs: []
|
|
60
|
+
outputs: []
|
|
60
61
|
}
|
|
61
62
|
end
|
|
62
63
|
|
|
@@ -68,7 +69,7 @@ module TurboTests
|
|
|
68
69
|
if formatters.empty?
|
|
69
70
|
formatters << {
|
|
70
71
|
name: "progress",
|
|
71
|
-
outputs: []
|
|
72
|
+
outputs: []
|
|
72
73
|
}
|
|
73
74
|
end
|
|
74
75
|
formatters.last[:outputs] << filename
|
|
@@ -89,7 +90,7 @@ module TurboTests
|
|
|
89
90
|
opts.on("--fail-fast=[N]") do |n|
|
|
90
91
|
n = begin
|
|
91
92
|
Integer(n)
|
|
92
|
-
rescue
|
|
93
|
+
rescue
|
|
93
94
|
nil
|
|
94
95
|
end
|
|
95
96
|
fail_fast = (n.nil? || n < 1) ? 1 : n
|
|
@@ -99,6 +100,14 @@ module TurboTests
|
|
|
99
100
|
seed = s
|
|
100
101
|
end
|
|
101
102
|
|
|
103
|
+
opts.on("--order ORDER", "RSpec example order: random (default) or defined") do |value|
|
|
104
|
+
order = value
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
opts.on("--no-random", "Run examples in defined order without passing a seed") do
|
|
108
|
+
order = "defined"
|
|
109
|
+
end
|
|
110
|
+
|
|
102
111
|
opts.on("--create", "Create databases") do
|
|
103
112
|
create = true
|
|
104
113
|
end
|
|
@@ -121,7 +130,7 @@ module TurboTests
|
|
|
121
130
|
if formatters.empty?
|
|
122
131
|
formatters << {
|
|
123
132
|
name: "progress",
|
|
124
|
-
outputs: []
|
|
133
|
+
outputs: []
|
|
125
134
|
}
|
|
126
135
|
end
|
|
127
136
|
|
|
@@ -131,7 +140,7 @@ module TurboTests
|
|
|
131
140
|
|
|
132
141
|
load_rake
|
|
133
142
|
|
|
134
|
-
|
|
143
|
+
invoke_rake_hook("setup")
|
|
135
144
|
|
|
136
145
|
files = @argv.empty? ? ["spec"] : @argv
|
|
137
146
|
parallel_options = {}
|
|
@@ -146,12 +155,13 @@ module TurboTests
|
|
|
146
155
|
fail_fast: fail_fast,
|
|
147
156
|
count: count,
|
|
148
157
|
seed: seed,
|
|
158
|
+
order: order,
|
|
149
159
|
nice: nice,
|
|
150
160
|
print_failed_group: print_failed_group,
|
|
151
|
-
parallel_options: parallel_options
|
|
161
|
+
parallel_options: parallel_options
|
|
152
162
|
)
|
|
153
163
|
|
|
154
|
-
|
|
164
|
+
invoke_rake_hook("cleanup")
|
|
155
165
|
|
|
156
166
|
# From https://github.com/galtzo-floss/turbo_tests2/pull/20/
|
|
157
167
|
exit(exitstatus)
|
|
@@ -187,7 +197,7 @@ module TurboTests
|
|
|
187
197
|
pids = (1..processes).map do |process_id|
|
|
188
198
|
env = {
|
|
189
199
|
"TEST_ENV_NUMBER" => process_id.to_s,
|
|
190
|
-
"PARALLEL_TEST_GROUPS" => processes.to_s
|
|
200
|
+
"PARALLEL_TEST_GROUPS" => processes.to_s
|
|
191
201
|
}
|
|
192
202
|
Process.spawn(env, *args)
|
|
193
203
|
end
|
|
@@ -243,7 +253,7 @@ module TurboTests
|
|
|
243
253
|
def shim_usage(command = nil)
|
|
244
254
|
lines = [
|
|
245
255
|
"Usage: turbo_tests2 shim install [--path PATH]",
|
|
246
|
-
" turbo_tests2 shim remove [--path PATH]"
|
|
256
|
+
" turbo_tests2 shim remove [--path PATH]"
|
|
247
257
|
]
|
|
248
258
|
lines << "Unknown shim command: #{command}" if command && !%w[install remove].include?(command)
|
|
249
259
|
lines.join("\n")
|
|
@@ -270,5 +280,14 @@ module TurboTests
|
|
|
270
280
|
|
|
271
281
|
Rake::Task[name].invoke
|
|
272
282
|
end
|
|
283
|
+
|
|
284
|
+
def invoke_rake_hook(name)
|
|
285
|
+
current_task = "turbo_tests2:#{name}"
|
|
286
|
+
legacy_task = "turbo_tests:#{name}"
|
|
287
|
+
|
|
288
|
+
return invoke_rake_task(current_task) if defined?(Rake) && Rake::Task.task_defined?(current_task)
|
|
289
|
+
|
|
290
|
+
invoke_rake_task(legacy_task)
|
|
291
|
+
end
|
|
273
292
|
end
|
|
274
293
|
end
|
|
@@ -23,7 +23,7 @@ module TurboTests
|
|
|
23
23
|
INTERNAL_BACKTRACE_PATTERNS = [
|
|
24
24
|
%r{/bin/turbo_tests2\b},
|
|
25
25
|
%r{/exe/turbo_tests2\b},
|
|
26
|
-
%r{/lib/turbo_tests(?:\.rb|/)}
|
|
26
|
+
%r{/lib/turbo_tests(?:\.rb|/)}
|
|
27
27
|
].freeze
|
|
28
28
|
|
|
29
29
|
RSpec::Core::Formatters.register(
|
|
@@ -38,7 +38,7 @@ module TurboTests
|
|
|
38
38
|
:message,
|
|
39
39
|
:seed,
|
|
40
40
|
:deprecation,
|
|
41
|
-
:dump_profile
|
|
41
|
+
:dump_profile
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
attr_reader :output
|
|
@@ -50,76 +50,76 @@ module TurboTests
|
|
|
50
50
|
def start(notification)
|
|
51
51
|
output_row(
|
|
52
52
|
type: :load_summary,
|
|
53
|
-
summary: load_summary_to_json(notification)
|
|
53
|
+
summary: load_summary_to_json(notification)
|
|
54
54
|
)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def example_group_started(notification)
|
|
58
58
|
output_row(
|
|
59
59
|
type: :group_started,
|
|
60
|
-
group: group_to_json(notification)
|
|
60
|
+
group: group_to_json(notification)
|
|
61
61
|
)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def example_group_finished(notification)
|
|
65
65
|
output_row(
|
|
66
66
|
type: :group_finished,
|
|
67
|
-
group: group_to_json(notification)
|
|
67
|
+
group: group_to_json(notification)
|
|
68
68
|
)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def example_passed(notification)
|
|
72
72
|
output_row(
|
|
73
73
|
type: :example_passed,
|
|
74
|
-
example: example_to_json(notification.example)
|
|
74
|
+
example: example_to_json(notification.example)
|
|
75
75
|
)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def example_pending(notification)
|
|
79
79
|
output_row(
|
|
80
80
|
type: :example_pending,
|
|
81
|
-
example: example_to_json(notification.example)
|
|
81
|
+
example: example_to_json(notification.example)
|
|
82
82
|
)
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def example_failed(notification)
|
|
86
86
|
output_row(
|
|
87
87
|
type: :example_failed,
|
|
88
|
-
example: example_to_json(notification.example)
|
|
88
|
+
example: example_to_json(notification.example)
|
|
89
89
|
)
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def seed(notification)
|
|
93
93
|
output_row(
|
|
94
94
|
type: :seed,
|
|
95
|
-
seed: notification.seed
|
|
95
|
+
seed: notification.seed
|
|
96
96
|
)
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def close(_notification)
|
|
100
100
|
output_row(
|
|
101
|
-
type: :close
|
|
101
|
+
type: :close
|
|
102
102
|
)
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def message(notification)
|
|
106
106
|
output_row(
|
|
107
107
|
type: :message,
|
|
108
|
-
message: notification.message
|
|
108
|
+
message: notification.message
|
|
109
109
|
)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def deprecation(notification)
|
|
113
113
|
output_row(
|
|
114
114
|
type: :deprecation,
|
|
115
|
-
deprecation: deprecation_to_json(notification)
|
|
115
|
+
deprecation: deprecation_to_json(notification)
|
|
116
116
|
)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
def dump_profile(notification)
|
|
120
120
|
output_row(
|
|
121
121
|
type: :profile,
|
|
122
|
-
profile: profile_to_json(notification)
|
|
122
|
+
profile: profile_to_json(notification)
|
|
123
123
|
)
|
|
124
124
|
end
|
|
125
125
|
|
|
@@ -129,7 +129,7 @@ module TurboTests
|
|
|
129
129
|
{
|
|
130
130
|
duration: notification.duration,
|
|
131
131
|
number_of_examples: notification.number_of_examples,
|
|
132
|
-
examples: notification.examples.map { |example| example_to_json(example) }
|
|
132
|
+
examples: notification.examples.map { |example| example_to_json(example) }
|
|
133
133
|
}
|
|
134
134
|
end
|
|
135
135
|
|
|
@@ -138,7 +138,7 @@ module TurboTests
|
|
|
138
138
|
deprecated: notification.deprecated,
|
|
139
139
|
message: notification.message,
|
|
140
140
|
replacement: notification.replacement,
|
|
141
|
-
call_site: notification.call_site
|
|
141
|
+
call_site: notification.call_site
|
|
142
142
|
}
|
|
143
143
|
end
|
|
144
144
|
|
|
@@ -149,7 +149,7 @@ module TurboTests
|
|
|
149
149
|
class_name: exception.class.name.to_s,
|
|
150
150
|
backtrace: filtered_backtrace(exception.backtrace),
|
|
151
151
|
message: exception.message,
|
|
152
|
-
cause: exception_to_json(exception.cause)
|
|
152
|
+
cause: exception_to_json(exception.cause)
|
|
153
153
|
}
|
|
154
154
|
end
|
|
155
155
|
|
|
@@ -166,14 +166,14 @@ module TurboTests
|
|
|
166
166
|
status: result.status,
|
|
167
167
|
pending_fixed?: result.pending_fixed?,
|
|
168
168
|
exception: exception_to_json(result.exception || result.pending_exception),
|
|
169
|
-
run_time: result.respond_to?(:run_time) ? result.run_time : nil
|
|
169
|
+
run_time: result.respond_to?(:run_time) ? result.run_time : nil
|
|
170
170
|
}
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
def stack_frame_to_json(frame)
|
|
174
174
|
{
|
|
175
175
|
shared_group_name: frame.shared_group_name,
|
|
176
|
-
inclusion_location: frame.inclusion_location
|
|
176
|
+
inclusion_location: frame.inclusion_location
|
|
177
177
|
}
|
|
178
178
|
end
|
|
179
179
|
|
|
@@ -188,24 +188,24 @@ module TurboTests
|
|
|
188
188
|
example
|
|
189
189
|
.metadata[:shared_group_inclusion_backtrace]
|
|
190
190
|
.map { |frame| stack_frame_to_json(frame) },
|
|
191
|
-
extra_failure_lines: example.metadata[:extra_failure_lines]
|
|
191
|
+
extra_failure_lines: example.metadata[:extra_failure_lines]
|
|
192
192
|
},
|
|
193
|
-
location_rerun_argument: example.location_rerun_argument
|
|
193
|
+
location_rerun_argument: example.location_rerun_argument
|
|
194
194
|
}
|
|
195
195
|
end
|
|
196
196
|
|
|
197
197
|
def load_summary_to_json(notification)
|
|
198
198
|
{
|
|
199
199
|
count: notification.count,
|
|
200
|
-
load_time: notification.load_time
|
|
200
|
+
load_time: notification.load_time
|
|
201
201
|
}
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
def group_to_json(notification)
|
|
205
205
|
{
|
|
206
206
|
group: {
|
|
207
|
-
description: notification.group.description
|
|
208
|
-
}
|
|
207
|
+
description: notification.group.description
|
|
208
|
+
}
|
|
209
209
|
}
|
|
210
210
|
end
|
|
211
211
|
|
data/lib/turbo_tests/reporter.rb
CHANGED
|
@@ -75,7 +75,7 @@ module TurboTests
|
|
|
75
75
|
delegate_to_formatters(:seed, RSpec::Core::Notifications::SeedNotification.new(@seed, @seed_used))
|
|
76
76
|
delegate_to_formatters(
|
|
77
77
|
:start,
|
|
78
|
-
RSpec::Core::Notifications::StartNotification.new(expected_example_count, @load_time)
|
|
78
|
+
RSpec::Core::Notifications::StartNotification.new(expected_example_count, @load_time)
|
|
79
79
|
)
|
|
80
80
|
end
|
|
81
81
|
|
|
@@ -132,7 +132,7 @@ module TurboTests
|
|
|
132
132
|
deprecated: deprecation[:deprecated],
|
|
133
133
|
message: deprecation[:message],
|
|
134
134
|
replacement: deprecation[:replacement],
|
|
135
|
-
call_site: deprecation[:call_site]
|
|
135
|
+
call_site: deprecation[:call_site]
|
|
136
136
|
)
|
|
137
137
|
delegate_to_formatters(:deprecation, notification)
|
|
138
138
|
end
|
|
@@ -143,7 +143,7 @@ module TurboTests
|
|
|
143
143
|
profile[:duration],
|
|
144
144
|
examples,
|
|
145
145
|
profile[:number_of_examples],
|
|
146
|
-
{}
|
|
146
|
+
{}
|
|
147
147
|
)
|
|
148
148
|
delegate_to_formatters(:dump_profile, notification)
|
|
149
149
|
end
|
|
@@ -158,14 +158,14 @@ module TurboTests
|
|
|
158
158
|
delegate_to_formatters(
|
|
159
159
|
:dump_pending,
|
|
160
160
|
RSpec::Core::Notifications::ExamplesNotification.new(
|
|
161
|
-
self
|
|
162
|
-
)
|
|
161
|
+
self
|
|
162
|
+
)
|
|
163
163
|
)
|
|
164
164
|
delegate_to_formatters(
|
|
165
165
|
:dump_failures,
|
|
166
166
|
RSpec::Core::Notifications::ExamplesNotification.new(
|
|
167
|
-
self
|
|
168
|
-
)
|
|
167
|
+
self
|
|
168
|
+
)
|
|
169
169
|
)
|
|
170
170
|
delegate_to_formatters(
|
|
171
171
|
:dump_summary,
|
|
@@ -175,15 +175,15 @@ module TurboTests
|
|
|
175
175
|
@failed_examples,
|
|
176
176
|
@pending_examples,
|
|
177
177
|
@load_time,
|
|
178
|
-
@errors_outside_of_examples_count
|
|
179
|
-
)
|
|
178
|
+
@errors_outside_of_examples_count
|
|
179
|
+
)
|
|
180
180
|
)
|
|
181
181
|
delegate_to_formatters(
|
|
182
182
|
:seed,
|
|
183
183
|
RSpec::Core::Notifications::SeedNotification.new(
|
|
184
184
|
@seed,
|
|
185
|
-
@seed_used
|
|
186
|
-
)
|
|
185
|
+
@seed_used
|
|
186
|
+
)
|
|
187
187
|
)
|
|
188
188
|
ensure
|
|
189
189
|
delegate_to_formatters(:close, RSpec::Core::Notifications::NullNotification)
|
data/lib/turbo_tests/runner.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
4
|
require "parallel_tests/rspec/runner"
|
|
5
|
+
require "tempfile"
|
|
5
6
|
|
|
6
7
|
require_relative "../utils/hash_extension"
|
|
7
8
|
|
|
@@ -33,8 +34,10 @@ module TurboTests
|
|
|
33
34
|
verbose = opts.fetch(:verbose, false)
|
|
34
35
|
fail_fast = opts.fetch(:fail_fast, nil)
|
|
35
36
|
count = opts.fetch(:count, nil)
|
|
37
|
+
order = normalize_order(opts.fetch(:order, nil))
|
|
36
38
|
seed = opts.fetch(:seed, nil)
|
|
37
|
-
seed_used =
|
|
39
|
+
seed_used = order != "defined"
|
|
40
|
+
seed = generate_seed if seed_used && seed.nil?
|
|
38
41
|
print_failed_group = opts.fetch(:print_failed_group, false)
|
|
39
42
|
nice = opts.fetch(:nice, false)
|
|
40
43
|
|
|
@@ -66,10 +69,11 @@ module TurboTests
|
|
|
66
69
|
count: count,
|
|
67
70
|
seed: seed,
|
|
68
71
|
seed_used: seed_used,
|
|
72
|
+
order: order,
|
|
69
73
|
print_failed_group: print_failed_group,
|
|
70
74
|
use_runtime_info: use_runtime_info,
|
|
71
75
|
parallel_options: parallel_options,
|
|
72
|
-
nice: nice
|
|
76
|
+
nice: nice
|
|
73
77
|
).run
|
|
74
78
|
end
|
|
75
79
|
|
|
@@ -87,6 +91,18 @@ module TurboTests
|
|
|
87
91
|
File.write(path, runtimes.sort.map { |file, runtime| "#{file}:#{runtime}" }.join("\n"))
|
|
88
92
|
path
|
|
89
93
|
end
|
|
94
|
+
|
|
95
|
+
def normalize_order(order)
|
|
96
|
+
order = order.to_s.strip.downcase
|
|
97
|
+
return "random" if order.empty?
|
|
98
|
+
return order if %w[random defined].include?(order)
|
|
99
|
+
|
|
100
|
+
raise ArgumentError, "Unsupported order #{order.inspect}; use random or defined"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def generate_seed
|
|
104
|
+
(Random.new_seed % 65_535).to_s
|
|
105
|
+
end
|
|
90
106
|
end
|
|
91
107
|
|
|
92
108
|
def initialize(**opts)
|
|
@@ -100,6 +116,7 @@ module TurboTests
|
|
|
100
116
|
@count = opts[:count]
|
|
101
117
|
@seed = opts[:seed]
|
|
102
118
|
@seed_used = opts[:seed_used]
|
|
119
|
+
@order = opts[:order]
|
|
103
120
|
@nice = opts[:nice]
|
|
104
121
|
@use_runtime_info = opts[:use_runtime_info]
|
|
105
122
|
|
|
@@ -125,42 +142,44 @@ module TurboTests
|
|
|
125
142
|
def run
|
|
126
143
|
@num_processes = [
|
|
127
144
|
ParallelTests.determine_number_of_processes(@count),
|
|
128
|
-
ParallelTests::RSpec::Runner.tests_with_size(@files, {}).size
|
|
145
|
+
ParallelTests::RSpec::Runner.tests_with_size(@files, {}).size
|
|
129
146
|
].min
|
|
130
147
|
|
|
131
148
|
tests_in_groups =
|
|
132
149
|
ParallelTests::RSpec::Runner.tests_in_groups(
|
|
133
150
|
@files,
|
|
134
151
|
@num_processes,
|
|
135
|
-
**@parallel_options
|
|
152
|
+
**@parallel_options
|
|
136
153
|
)
|
|
137
154
|
@tests_in_groups = tests_in_groups
|
|
138
155
|
|
|
139
156
|
subprocess_opts = {
|
|
140
|
-
record_runtime: @record_runtime
|
|
157
|
+
record_runtime: @record_runtime
|
|
141
158
|
}
|
|
142
159
|
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
ParallelTests.with_pid_file do
|
|
161
|
+
@reporter.report(tests_in_groups) do |_reporter|
|
|
162
|
+
old_signal = Signal.trap(:INT) { handle_interrupt }
|
|
145
163
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
164
|
+
@wait_threads = tests_in_groups.map.with_index do |tests, process_id|
|
|
165
|
+
start_regular_subprocess(tests, process_id + 1, **subprocess_opts)
|
|
166
|
+
end.compact
|
|
167
|
+
@interrupt_handled = false
|
|
150
168
|
|
|
151
|
-
|
|
169
|
+
handle_messages
|
|
152
170
|
|
|
153
|
-
|
|
171
|
+
@threads.each(&:join)
|
|
154
172
|
|
|
155
|
-
|
|
173
|
+
report_failed_group(tests_in_groups) if @print_failed_group
|
|
156
174
|
|
|
157
|
-
|
|
175
|
+
Signal.trap(:INT, old_signal)
|
|
158
176
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
177
|
+
if @reporter.failed_examples.empty? && @wait_threads.map(&:value).all?(&:success?)
|
|
178
|
+
0
|
|
179
|
+
else
|
|
180
|
+
# From https://github.com/galtzo-floss/turbo_tests2/pull/20/
|
|
181
|
+
@wait_threads.map { |thread| thread.value.exitstatus }.max
|
|
182
|
+
end
|
|
164
183
|
end
|
|
165
184
|
end
|
|
166
185
|
end
|
|
@@ -188,11 +207,15 @@ module TurboTests
|
|
|
188
207
|
|
|
189
208
|
def start_regular_subprocess(tests, process_id, **opts)
|
|
190
209
|
start_subprocess(
|
|
191
|
-
{
|
|
210
|
+
{
|
|
211
|
+
"TEST_ENV_NUMBER" => process_id.to_s,
|
|
212
|
+
"PARALLEL_TEST_GROUPS" => @num_processes.to_s,
|
|
213
|
+
"PARALLEL_PID_FILE" => parallel_pid_file_path
|
|
214
|
+
},
|
|
192
215
|
@tags.map { |tag| "--tag=#{tag}" },
|
|
193
216
|
tests,
|
|
194
217
|
process_id,
|
|
195
|
-
**opts
|
|
218
|
+
**opts
|
|
196
219
|
)
|
|
197
220
|
end
|
|
198
221
|
|
|
@@ -200,7 +223,7 @@ module TurboTests
|
|
|
200
223
|
if tests.empty?
|
|
201
224
|
@messages << {
|
|
202
225
|
type: "exit",
|
|
203
|
-
process_id: process_id
|
|
226
|
+
process_id: process_id
|
|
204
227
|
}
|
|
205
228
|
|
|
206
229
|
nil
|
|
@@ -224,7 +247,7 @@ module TurboTests
|
|
|
224
247
|
"--format",
|
|
225
248
|
"ParallelTests::RSpec::RuntimeLogger",
|
|
226
249
|
"--out",
|
|
227
|
-
@runtime_log
|
|
250
|
+
@runtime_log
|
|
228
251
|
]
|
|
229
252
|
else
|
|
230
253
|
[]
|
|
@@ -232,7 +255,11 @@ module TurboTests
|
|
|
232
255
|
|
|
233
256
|
seed_option = if @seed_used
|
|
234
257
|
[
|
|
235
|
-
"--seed", @seed
|
|
258
|
+
"--seed", @seed
|
|
259
|
+
]
|
|
260
|
+
elsif @order
|
|
261
|
+
[
|
|
262
|
+
"--order", @order
|
|
236
263
|
]
|
|
237
264
|
else
|
|
238
265
|
[]
|
|
@@ -248,20 +275,22 @@ module TurboTests
|
|
|
248
275
|
"TurboTests::JsonRowsFormatter",
|
|
249
276
|
*record_runtime_options,
|
|
250
277
|
*spec_opts,
|
|
251
|
-
*tests
|
|
278
|
+
*tests
|
|
252
279
|
]
|
|
253
280
|
command.unshift("nice") if @nice
|
|
254
281
|
|
|
255
282
|
if @verbose
|
|
256
283
|
command_str = [
|
|
257
284
|
env.map { |k, v| "#{k}=#{v}" }.join(" "),
|
|
258
|
-
command.join(" ")
|
|
285
|
+
command.join(" ")
|
|
259
286
|
].select { |x| x.size > 0 }.join(" ")
|
|
260
287
|
|
|
261
288
|
warn("Process #{process_id}: #{command_str}")
|
|
262
289
|
end
|
|
263
290
|
|
|
291
|
+
pid_file_path = env["PARALLEL_PID_FILE"] || parallel_pid_file_path
|
|
264
292
|
stdin, stdout, stderr, wait_thr = Open3.popen3(env, *command)
|
|
293
|
+
track_parallel_pid(wait_thr.pid, pid_file_path)
|
|
265
294
|
stdin.close
|
|
266
295
|
|
|
267
296
|
# rubocop:disable ThreadSafety/NewThread
|
|
@@ -290,7 +319,12 @@ module TurboTests
|
|
|
290
319
|
|
|
291
320
|
# rubocop:disable ThreadSafety/NewThread
|
|
292
321
|
@threads << Thread.new do
|
|
293
|
-
|
|
322
|
+
begin
|
|
323
|
+
status = wait_thr.value
|
|
324
|
+
@messages << {type: "error"} unless status.success?
|
|
325
|
+
ensure
|
|
326
|
+
untrack_parallel_pid(wait_thr.pid, pid_file_path)
|
|
327
|
+
end
|
|
294
328
|
end
|
|
295
329
|
# rubocop:enable ThreadSafety/NewThread
|
|
296
330
|
|
|
@@ -298,6 +332,18 @@ module TurboTests
|
|
|
298
332
|
end
|
|
299
333
|
end
|
|
300
334
|
|
|
335
|
+
def parallel_pid_file_path
|
|
336
|
+
ENV["PARALLEL_PID_FILE"]
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
def track_parallel_pid(pid, pid_file_path = parallel_pid_file_path)
|
|
340
|
+
ParallelTests::Pids.new(pid_file_path).add(pid) if pid && pid_file_path
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def untrack_parallel_pid(pid, pid_file_path = parallel_pid_file_path)
|
|
344
|
+
ParallelTests::Pids.new(pid_file_path).delete(pid) if pid && pid_file_path
|
|
345
|
+
end
|
|
346
|
+
|
|
301
347
|
def start_copy_thread(src, dst)
|
|
302
348
|
# rubocop:disable ThreadSafety/NewThread
|
|
303
349
|
Thread.new do
|
|
@@ -356,9 +402,7 @@ module TurboTests
|
|
|
356
402
|
@reporter.deprecation(message[:deprecation])
|
|
357
403
|
when "profile"
|
|
358
404
|
@reporter.profile(message[:profile])
|
|
359
|
-
when "seed"
|
|
360
|
-
when "close"
|
|
361
|
-
when "error"
|
|
405
|
+
when "seed", "close", "error"
|
|
362
406
|
# Do nothing
|
|
363
407
|
nil
|
|
364
408
|
when "exit"
|
data/lib/turbo_tests/version.rb
CHANGED
data/lib/turbo_tests.rb
CHANGED
|
@@ -39,7 +39,7 @@ module TurboTests
|
|
|
39
39
|
klass.new(
|
|
40
40
|
obj[:backtrace],
|
|
41
41
|
obj[:message],
|
|
42
|
-
FakeException.from_obj(obj[:cause])
|
|
42
|
+
FakeException.from_obj(obj[:cause])
|
|
43
43
|
)
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -52,7 +52,7 @@ module TurboTests
|
|
|
52
52
|
:pending_fixed?,
|
|
53
53
|
:exception,
|
|
54
54
|
:pending_exception,
|
|
55
|
-
:run_time
|
|
55
|
+
:run_time
|
|
56
56
|
)
|
|
57
57
|
class FakeExecutionResult
|
|
58
58
|
class << self
|
|
@@ -64,7 +64,7 @@ module TurboTests
|
|
|
64
64
|
obj[:pending_fixed?],
|
|
65
65
|
FakeException.from_obj(obj[:exception]),
|
|
66
66
|
FakeException.from_obj(obj[:exception]),
|
|
67
|
-
obj[:run_time]
|
|
67
|
+
obj[:run_time]
|
|
68
68
|
)
|
|
69
69
|
end
|
|
70
70
|
end
|
|
@@ -76,7 +76,7 @@ module TurboTests
|
|
|
76
76
|
:description,
|
|
77
77
|
:full_description,
|
|
78
78
|
:metadata,
|
|
79
|
-
:location_rerun_argument
|
|
79
|
+
:location_rerun_argument
|
|
80
80
|
)
|
|
81
81
|
class FakeExample
|
|
82
82
|
class << self
|
|
@@ -86,7 +86,7 @@ module TurboTests
|
|
|
86
86
|
metadata[:shared_group_inclusion_backtrace].map! do |frame|
|
|
87
87
|
RSpec::Core::SharedExampleGroupInclusionStackFrame.new(
|
|
88
88
|
frame[:shared_group_name],
|
|
89
|
-
frame[:inclusion_location]
|
|
89
|
+
frame[:inclusion_location]
|
|
90
90
|
)
|
|
91
91
|
end
|
|
92
92
|
|
|
@@ -98,14 +98,14 @@ module TurboTests
|
|
|
98
98
|
obj[:description],
|
|
99
99
|
obj[:full_description],
|
|
100
100
|
metadata,
|
|
101
|
-
obj[:location_rerun_argument]
|
|
101
|
+
obj[:location_rerun_argument]
|
|
102
102
|
)
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def notification
|
|
107
107
|
RSpec::Core::Notifications::ExampleNotification.for(
|
|
108
|
-
self
|
|
108
|
+
self
|
|
109
109
|
)
|
|
110
110
|
end
|
|
111
111
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: turbo_tests2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Illia
|
|
@@ -92,7 +92,7 @@ dependencies:
|
|
|
92
92
|
version: '1.1'
|
|
93
93
|
- - ">="
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 1.1.
|
|
95
|
+
version: 1.1.11
|
|
96
96
|
type: :runtime
|
|
97
97
|
prerelease: false
|
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -102,27 +102,27 @@ dependencies:
|
|
|
102
102
|
version: '1.1'
|
|
103
103
|
- - ">="
|
|
104
104
|
- !ruby/object:Gem::Version
|
|
105
|
-
version: 1.1.
|
|
105
|
+
version: 1.1.11
|
|
106
106
|
- !ruby/object:Gem::Dependency
|
|
107
107
|
name: kettle-dev
|
|
108
108
|
requirement: !ruby/object:Gem::Requirement
|
|
109
109
|
requirements:
|
|
110
110
|
- - "~>"
|
|
111
111
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: '2.
|
|
112
|
+
version: '2.1'
|
|
113
113
|
- - ">="
|
|
114
114
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: 2.
|
|
115
|
+
version: 2.1.1
|
|
116
116
|
type: :development
|
|
117
117
|
prerelease: false
|
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
|
120
120
|
- - "~>"
|
|
121
121
|
- !ruby/object:Gem::Version
|
|
122
|
-
version: '2.
|
|
122
|
+
version: '2.1'
|
|
123
123
|
- - ">="
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: 2.
|
|
125
|
+
version: 2.1.1
|
|
126
126
|
- !ruby/object:Gem::Dependency
|
|
127
127
|
name: bundler-audit
|
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -177,20 +177,20 @@ dependencies:
|
|
|
177
177
|
requirements:
|
|
178
178
|
- - "~>"
|
|
179
179
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: '3.
|
|
180
|
+
version: '3.1'
|
|
181
181
|
- - ">="
|
|
182
182
|
- !ruby/object:Gem::Version
|
|
183
|
-
version: 3.
|
|
183
|
+
version: 3.1.1
|
|
184
184
|
type: :development
|
|
185
185
|
prerelease: false
|
|
186
186
|
version_requirements: !ruby/object:Gem::Requirement
|
|
187
187
|
requirements:
|
|
188
188
|
- - "~>"
|
|
189
189
|
- !ruby/object:Gem::Version
|
|
190
|
-
version: '3.
|
|
190
|
+
version: '3.1'
|
|
191
191
|
- - ">="
|
|
192
192
|
- !ruby/object:Gem::Version
|
|
193
|
-
version: 3.
|
|
193
|
+
version: 3.1.1
|
|
194
194
|
- !ruby/object:Gem::Dependency
|
|
195
195
|
name: kettle-test
|
|
196
196
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -200,7 +200,7 @@ dependencies:
|
|
|
200
200
|
version: '2.0'
|
|
201
201
|
- - ">="
|
|
202
202
|
- !ruby/object:Gem::Version
|
|
203
|
-
version: 2.0.
|
|
203
|
+
version: 2.0.3
|
|
204
204
|
type: :development
|
|
205
205
|
prerelease: false
|
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -210,7 +210,7 @@ dependencies:
|
|
|
210
210
|
version: '2.0'
|
|
211
211
|
- - ">="
|
|
212
212
|
- !ruby/object:Gem::Version
|
|
213
|
-
version: 2.0.
|
|
213
|
+
version: 2.0.3
|
|
214
214
|
- !ruby/object:Gem::Dependency
|
|
215
215
|
name: ruby-progressbar
|
|
216
216
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -254,7 +254,7 @@ dependencies:
|
|
|
254
254
|
version: '2.0'
|
|
255
255
|
- - ">="
|
|
256
256
|
- !ruby/object:Gem::Version
|
|
257
|
-
version: 2.0.
|
|
257
|
+
version: 2.0.1
|
|
258
258
|
type: :development
|
|
259
259
|
prerelease: false
|
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -264,11 +264,10 @@ dependencies:
|
|
|
264
264
|
version: '2.0'
|
|
265
265
|
- - ">="
|
|
266
266
|
- !ruby/object:Gem::Version
|
|
267
|
-
version: 2.0.
|
|
268
|
-
description: "\U0001F680
|
|
267
|
+
version: 2.0.1
|
|
268
|
+
description: "\U0001F680 turbo_tests2` is a drop-in replacement for `serpapi/turbo_tests`
|
|
269
269
|
and `grosser/parallel_tests` with incremental summarized output. Source code of
|
|
270
|
-
`turbo_test2` gem is based on Discourse and Rubygems work in this area (see README
|
|
271
|
-
file of the source repository)."
|
|
270
|
+
`turbo_test2` gem is based on Discourse and Rubygems work in this area (see README.md)."
|
|
272
271
|
email:
|
|
273
272
|
- floss@galtzo.com
|
|
274
273
|
executables:
|
|
@@ -312,10 +311,10 @@ licenses:
|
|
|
312
311
|
- MIT
|
|
313
312
|
metadata:
|
|
314
313
|
homepage_uri: https://turbo-tests2.galtzo.com
|
|
315
|
-
source_code_uri: https://github.com/galtzo-floss/turbo_tests2/tree/v3.1.
|
|
316
|
-
changelog_uri: https://github.com/galtzo-floss/turbo_tests2/blob/v3.1.
|
|
314
|
+
source_code_uri: https://github.com/galtzo-floss/turbo_tests2/tree/v3.1.2
|
|
315
|
+
changelog_uri: https://github.com/galtzo-floss/turbo_tests2/blob/v3.1.2/CHANGELOG.md
|
|
317
316
|
bug_tracker_uri: https://github.com/galtzo-floss/turbo_tests2/issues
|
|
318
|
-
documentation_uri: https://www.rubydoc.info/gems/turbo_tests2/3.1.
|
|
317
|
+
documentation_uri: https://www.rubydoc.info/gems/turbo_tests2/3.1.2
|
|
319
318
|
funding_uri: https://github.com/sponsors/pboling
|
|
320
319
|
wiki_uri: https://github.com/galtzo-floss/turbo_tests2/wiki
|
|
321
320
|
news_uri: https://www.railsbling.com/tags/turbo_tests2
|
|
@@ -323,7 +322,7 @@ metadata:
|
|
|
323
322
|
rubygems_mfa_required: 'true'
|
|
324
323
|
rdoc_options:
|
|
325
324
|
- "--title"
|
|
326
|
-
- "turbo_tests2 - \U0001F680
|
|
325
|
+
- "turbo_tests2 - \U0001F680 turbo_tests2` is a drop-in replacement for `serpapi/turbo_tests`
|
|
327
326
|
and `grosser/parallel_tests` with incremental summarized output"
|
|
328
327
|
- "--main"
|
|
329
328
|
- README.md
|
|
@@ -347,6 +346,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
347
346
|
requirements: []
|
|
348
347
|
rubygems_version: 4.0.10
|
|
349
348
|
specification_version: 4
|
|
350
|
-
summary: "\U0001F680
|
|
349
|
+
summary: "\U0001F680 turbo_tests2` is a drop-in replacement for `serpapi/turbo_tests`
|
|
351
350
|
and `grosser/parallel_tests` with incremental summarized output"
|
|
352
351
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|