turbo_tests 1.3.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83d546a7efd52f8d3c1e20d6973b3a956c7cbf2f2b51b5e78c7d2ad67819b7db
4
- data.tar.gz: 6f9d1a0841e3121a814c9f98a6ab0ac7146a78506d7a8adec622b9cf6e8e4a53
3
+ metadata.gz: 60c3ddbe013dcaaec1580e1125e053efdd039438a650ccc6c0405c268f32f584
4
+ data.tar.gz: c6d6c1ed7fe70925175ccf477ef9a07f6c4360e187b978f148f7d41cc6418ac0
5
5
  SHA512:
6
- metadata.gz: ad2917d505e40659a07e665523eff5af84f7b3ed9e2dacd8e7e1dd08ecc3eea88e507572f49c31cb973bbc63e1922825ef8a2c690db954689cf3afa071dbcb40
7
- data.tar.gz: 7da1494e59ecaff728dd8a0231e96d83a89f15cc67a0f9a5a67dbc4539fc3c0268cf43824ade7caed0aa2565e8b559e0996d0706e0b210061fd02d8990d71fc1
6
+ metadata.gz: 6f92140b425152f613350967ea189263a197d6dee6b098bc9c33757efde25a12298b2849184273ecf85ffcbad82d862f0adbe2c9c568734aab62290121be44d1
7
+ data.tar.gz: 5fa7338d979a912ae1f880833aa7db32eecbb07198c8024408d608c4380da5ae0b4ebc1d2aead992e4d80714cd09f6f0079d18d2c89282097890439f33d07128
@@ -0,0 +1,54 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v**
7
+
8
+ jobs:
9
+ build:
10
+ name: Build + Publish
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ packages: write
15
+
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Set up Ruby 2.6
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: 2.6
22
+ bundler-cache: true
23
+
24
+ - name: Run tests
25
+ run: |
26
+ bundle exec rake install:local
27
+ bundle install
28
+ bundle exec turbo_tests
29
+
30
+ - uses: actions/upload-artifact@v3
31
+ with:
32
+ name: "ruby-gem"
33
+ path: "pkg/*.gem"
34
+
35
+ - name: Publish to GPR
36
+ run: |
37
+ mkdir -p $HOME/.gem
38
+ touch $HOME/.gem/credentials
39
+ chmod 0600 $HOME/.gem/credentials
40
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
41
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} pkg/*.gem
42
+ env:
43
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
44
+ OWNER: ${{ github.repository_owner }}
45
+
46
+ - name: Publish to RubyGems
47
+ run: |
48
+ mkdir -p $HOME/.gem
49
+ touch $HOME/.gem/credentials
50
+ chmod 0600 $HOME/.gem/credentials
51
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
52
+ gem push pkg/*.gem
53
+ env:
54
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
@@ -20,7 +20,7 @@ jobs:
20
20
  snyk:
21
21
  runs-on: ubuntu-latest
22
22
  steps:
23
- - uses: actions/checkout@v2
23
+ - uses: actions/checkout@v3
24
24
  - name: Run Snyk to check configuration files for security issues
25
25
  # Snyk can be used to break the build when it detects security issues.
26
26
  # In this case we want to upload the issues to GitHub Code Scanning
@@ -1,6 +1,13 @@
1
1
  name: Tests
2
2
 
3
- on: [push, pull_request]
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+
9
+ permissions:
10
+ contents: read
4
11
 
5
12
  jobs:
6
13
  test:
@@ -8,13 +15,11 @@ jobs:
8
15
 
9
16
  strategy:
10
17
  matrix:
11
- ruby:
12
- - 2.6
13
- - 2.7
18
+ ruby: [ 2.6, 2.7, 3.0, 3.1, 3.2 ]
14
19
 
15
20
  steps:
16
- - uses: actions/checkout@v2
17
- - uses: ruby/setup-ruby@master
21
+ - uses: actions/checkout@v3
22
+ - uses: ruby/setup-ruby@v1
18
23
  with:
19
24
  ruby-version: ${{matrix.ruby}}
20
25
  bundler-cache: true
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_tests (1.3.0)
5
- bundler
4
+ turbo_tests (1.4.1)
5
+ bundler (>= 2.1)
6
6
  parallel_tests (~> 3.3)
7
- rspec (~> 3.10)
7
+ rspec (>= 3.10)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  coderay (1.1.3)
13
- diff-lcs (1.4.4)
13
+ diff-lcs (1.5.0)
14
14
  method_source (1.0.0)
15
15
  parallel (1.21.0)
16
16
  parallel_tests (3.7.3)
@@ -19,19 +19,19 @@ GEM
19
19
  coderay (~> 1.1)
20
20
  method_source (~> 1.0)
21
21
  rake (13.0.6)
22
- rspec (3.10.0)
23
- rspec-core (~> 3.10.0)
24
- rspec-expectations (~> 3.10.0)
25
- rspec-mocks (~> 3.10.0)
26
- rspec-core (3.10.1)
27
- rspec-support (~> 3.10.0)
28
- rspec-expectations (3.10.1)
22
+ rspec (3.12.0)
23
+ rspec-core (~> 3.12.0)
24
+ rspec-expectations (~> 3.12.0)
25
+ rspec-mocks (~> 3.12.0)
26
+ rspec-core (3.12.1)
27
+ rspec-support (~> 3.12.0)
28
+ rspec-expectations (3.12.2)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.10.0)
31
- rspec-mocks (3.10.2)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-mocks (3.12.3)
32
32
  diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.10.0)
34
- rspec-support (3.10.2)
33
+ rspec-support (~> 3.12.0)
34
+ rspec-support (3.12.0)
35
35
 
36
36
  PLATFORMS
37
37
  ruby
@@ -42,4 +42,4 @@ DEPENDENCIES
42
42
  turbo_tests!
43
43
 
44
44
  BUNDLED WITH
45
- 2.2.27
45
+ 2.4.4
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # TurboTests
4
4
 
5
- Runner for [`grosser/parallel_tests`](https://github.com/grosser/parallel_tests) with incremental summarized output. Based on [Discourse](https://github.com/discourse/discourse/blob/6b9784cf8a18636bce281a7e4d18e65a0cbc6290/lib/turbo_tests.rb) and [RubyGems](https://github.com/rubygems/rubygems/tree/390335ceb351668cd433bd5bb9823dd021f82533/bundler/tool) work in this area.
5
+ `turbo_tests` is a drop-in replacement for [`grosser/parallel_tests`](https://github.com/grosser/parallel_tests) with incremental summarized output. Source code of this gem is based on [Discourse](https://github.com/discourse/discourse/blob/6b9784cf8a18636bce281a7e4d18e65a0cbc6290/lib/turbo_tests.rb) and [RubyGems](https://github.com/rubygems/rubygems/tree/390335ceb351668cd433bd5bb9823dd021f82533/bundler/tool) work in this area.
6
6
 
7
- This feature [doesn't fit vision of `parallel_tests` author](https://github.com/grosser/parallel_tests/issues/708) and [RSpec doesn't support built-in parallel testing yet](https://github.com/rspec/rspec-rails/issues/2104#issuecomment-658474900). This gem would not be useful once one of the issues above will be implemented.
7
+ Incremental summarized output [doesn't fit vision of `parallel_tests` author](https://github.com/grosser/parallel_tests/issues/708) and [RSpec doesn't support built-in parallel testing yet](https://github.com/rspec/rspec-rails/issues/2104#issuecomment-658474900). This gem will not be useful once one of the issues above will be implemented.
8
8
 
9
9
  ## Why incremental output?
10
10
 
@@ -49,11 +49,15 @@ gem 'turbo_tests'
49
49
 
50
50
  And then execute:
51
51
 
52
- $ bundle install
52
+ ```bash
53
+ $ bundle install
54
+ ```
53
55
 
54
56
  Or install it yourself as:
55
57
 
56
- $ gem install turbo_tests
58
+ ```bash
59
+ $ gem install turbo_tests
60
+ ```
57
61
 
58
62
  ## Usage
59
63
 
@@ -0,0 +1,13 @@
1
+ RSpec.describe "Failing example group" do
2
+ after(:each) do |example|
3
+ example.metadata[:extra_failure_lines] ||= []
4
+
5
+ lines = example.metadata[:extra_failure_lines]
6
+
7
+ lines << "Test info in extra_failure_lines"
8
+ end
9
+
10
+ it "fails" do
11
+ expect(2).to eq(3)
12
+ end
13
+ end
@@ -21,7 +21,9 @@ module TurboTests
21
21
  opts.banner = <<~BANNER
22
22
  Run all tests in parallel, giving each process ENV['TEST_ENV_NUMBER'] ('1', '2', '3', ...).
23
23
 
24
- Uses parallel_tests under the hood, but reports test results incrementally. Based on Discourse and RubyGems work in this area.
24
+ Reports test results incrementally. Uses methods from `parallel_tests` gem to split files to groups.
25
+
26
+ Source code of `turbo_tests` gem is based on Discourse and RubyGems work in this area (see README file of the source repository).
25
27
 
26
28
  Usage: turbo_tests [options]
27
29
 
@@ -141,9 +141,10 @@ module TurboTests
141
141
  shared_group_inclusion_backtrace:
142
142
  example
143
143
  .metadata[:shared_group_inclusion_backtrace]
144
- .map { |frame| stack_frame_to_json(frame) }
144
+ .map { |frame| stack_frame_to_json(frame) },
145
+ extra_failure_lines: example.metadata[:extra_failure_lines],
145
146
  },
146
- location_rerun_argument: example.location_rerun_argument
147
+ location_rerun_argument: example.location_rerun_argument,
147
148
  }
148
149
  end
149
150
 
@@ -50,7 +50,7 @@ module TurboTests
50
50
  @load_count = 0
51
51
  @failure_count = 0
52
52
 
53
- @messages = Queue.new
53
+ @messages = Thread::Queue.new
54
54
  @threads = []
55
55
  @error = false
56
56
  end
@@ -260,7 +260,7 @@ module TurboTests
260
260
  end
261
261
 
262
262
  def fail_fast_met
263
- !@fail_fast.nil? && @fail_fast >= @failure_count
263
+ !@fail_fast.nil? && @failure_count >= @fail_fast
264
264
  end
265
265
 
266
266
  def report_number_of_tests(groups)
@@ -1,3 +1,3 @@
1
1
  module TurboTests
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.1"
3
3
  end
data/turbo_tests.gemspec CHANGED
@@ -3,25 +3,28 @@ require_relative "lib/turbo_tests/version"
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "turbo_tests"
5
5
  spec.version = TurboTests::VERSION
6
- spec.authors = ["Ilya Zub"]
7
- spec.email = ["zaoooza92@gmail.com"]
6
+ spec.platform = Gem::Platform::RUBY
7
+ spec.date = Time.now.strftime('%Y-%m-%d')
8
8
 
9
- spec.summary = "Runner for grosser/parallel_tests with incremental summarized output. Based on Discourse and Rubygems work in this area."
9
+ spec.summary = "`turbo_tests` is a drop-in replacement for `grosser/parallel_tests` with incremental summarized output. Source code of `turbo_test` gem is based on Discourse and Rubygems work in this area (see README file of the source repository)."
10
10
  spec.homepage = "https://github.com/serpapi/turbo_tests"
11
11
  spec.license = "MIT"
12
12
 
13
+ spec.authors = ["Illia Zub"]
14
+ spec.email = ["ilya@serpapi.com"]
15
+
13
16
  spec.metadata["homepage_uri"] = spec.homepage
14
17
  spec.metadata["source_code_uri"] = "https://github.com/serpapi/turbo_tests"
15
18
  spec.metadata["changelog_uri"] = "https://github.com/serpapi/turbo_tests/releases"
16
19
 
17
- spec.required_ruby_version = ">= 2.4"
20
+ spec.required_ruby_version = ">= 2.6"
18
21
 
19
- spec.add_dependency "rspec", "~> 3.10"
22
+ spec.add_dependency "rspec", ">= 3.10"
20
23
  spec.add_dependency "parallel_tests", "~> 3.3"
21
24
 
22
25
  spec.add_development_dependency "pry", "~> 0.14"
23
26
 
24
- spec.add_runtime_dependency "bundler"
27
+ spec.add_runtime_dependency "bundler", ">= 2.1"
25
28
 
26
29
  # Specify which files should be added to the gem when it is released.
27
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
- - Ilya Zub
7
+ - Illia Zub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-04 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.10'
27
27
  - !ruby/object:Gem::Dependency
@@ -58,27 +58,27 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '2.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '2.1'
69
69
  description:
70
70
  email:
71
- - zaoooza92@gmail.com
71
+ - ilya@serpapi.com
72
72
  executables:
73
73
  - turbo_tests
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".github/workflows/gem-push.yml"
77
78
  - ".github/workflows/snyk_ruby-analysis.yml"
78
79
  - ".github/workflows/tests.yml"
79
80
  - ".gitignore"
80
81
  - ".rspec"
81
- - ".travis.yml"
82
82
  - CODE_OF_CONDUCT.md
83
83
  - Gemfile
84
84
  - Gemfile.lock
@@ -87,6 +87,7 @@ files:
87
87
  - Rakefile
88
88
  - bin/turbo_tests
89
89
  - fixtures/rspec/errors_outside_of_examples_spec.rb
90
+ - fixtures/rspec/failing_spec.rb
90
91
  - fixtures/rspec/pending_exceptions_spec.rb
91
92
  - lib/turbo_tests.rb
92
93
  - lib/turbo_tests/cli.rb
@@ -111,16 +112,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
112
  requirements:
112
113
  - - ">="
113
114
  - !ruby/object:Gem::Version
114
- version: '2.4'
115
+ version: '2.6'
115
116
  required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  requirements:
117
118
  - - ">="
118
119
  - !ruby/object:Gem::Version
119
120
  version: '0'
120
121
  requirements: []
121
- rubygems_version: 3.2.27
122
+ rubygems_version: 3.0.3.1
122
123
  signing_key:
123
124
  specification_version: 4
124
- summary: Runner for grosser/parallel_tests with incremental summarized output. Based
125
- on Discourse and Rubygems work in this area.
125
+ summary: "`turbo_tests` is a drop-in replacement for `grosser/parallel_tests` with
126
+ incremental summarized output. Source code of `turbo_test` gem is based on Discourse
127
+ and Rubygems work in this area (see README file of the source repository)."
126
128
  test_files: []
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.3
6
- before_install: gem install bundler -v 2.1.4