test-queue 0.6.0 → 0.8.0
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 +42 -42
- data/exe/cucumber-queue +2 -1
- data/exe/minitest-queue +3 -2
- data/exe/rspec-queue +2 -1
- data/exe/testunit-queue +2 -1
- data/lib/test-queue.rb +2 -0
- data/lib/test_queue/iterator.rb +23 -15
- data/lib/test_queue/runner/cucumber.rb +3 -0
- data/lib/test_queue/runner/{sample.rb → example.rb} +30 -9
- data/lib/test_queue/runner/minitest.rb +5 -3
- data/lib/test_queue/runner/minitest4.rb +12 -7
- data/lib/test_queue/runner/minitest5.rb +37 -22
- data/lib/test_queue/runner/puppet_lint.rb +6 -4
- data/lib/test_queue/runner/rspec.rb +15 -4
- data/lib/test_queue/runner/rspec2.rb +24 -24
- data/lib/test_queue/runner/rspec3.rb +11 -11
- data/lib/test_queue/runner/testunit.rb +6 -3
- data/lib/test_queue/runner.rb +93 -103
- data/lib/test_queue/stats.rb +17 -13
- data/lib/test_queue/test_framework.rb +2 -0
- data/lib/test_queue/version.rb +5 -0
- data/lib/test_queue.rb +1 -5
- metadata +7 -42
- data/.github/workflows/test.yml +0 -93
- data/.gitignore +0 -6
- data/Appraisals +0 -35
- data/Gemfile +0 -7
- data/Rakefile +0 -14
- data/gemfiles/cucumber1_3.gemfile +0 -9
- data/gemfiles/cucumber2_4.gemfile +0 -9
- data/gemfiles/minitest4.gemfile +0 -7
- data/gemfiles/minitest5.gemfile +0 -7
- data/gemfiles/rspec2.gemfile +0 -8
- data/gemfiles/rspec3.gemfile +0 -7
- data/gemfiles/testunit.gemfile +0 -7
- data/script/bootstrap +0 -13
- data/spec/stats_spec.rb +0 -79
- data/test/cucumber.bats +0 -57
- data/test/minitest4.bats +0 -34
- data/test/minitest5.bats +0 -194
- data/test/rspec2.bats +0 -46
- data/test/rspec3.bats +0 -56
- data/test/samples/features/bad.feature +0 -5
- data/test/samples/features/sample.feature +0 -25
- data/test/samples/features/sample2.feature +0 -29
- data/test/samples/features/step_definitions/common.rb +0 -19
- data/test/samples/sample_minispec.rb +0 -37
- data/test/samples/sample_minitest4.rb +0 -25
- data/test/samples/sample_minitest5.rb +0 -33
- data/test/samples/sample_rspec_helper.rb +0 -1
- data/test/samples/sample_shared_examples_for_spec.rb +0 -5
- data/test/samples/sample_spec.rb +0 -25
- data/test/samples/sample_split_spec.rb +0 -17
- data/test/samples/sample_testunit.rb +0 -25
- data/test/samples/sample_use_shared_example1_spec.rb +0 -8
- data/test/samples/sample_use_shared_example2_spec.rb +0 -8
- data/test/sleepy_runner.rb +0 -16
- data/test/testlib.bash +0 -89
- data/test/testunit.bats +0 -20
- data/test-queue.gemspec +0 -21
data/lib/test_queue/stats.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module TestQueue
|
2
4
|
class Stats
|
3
5
|
class Suite
|
@@ -19,17 +21,17 @@ module TestQueue
|
|
19
21
|
duration == other.duration &&
|
20
22
|
last_seen_at == other.last_seen_at
|
21
23
|
end
|
22
|
-
|
24
|
+
alias eql? ==
|
23
25
|
|
24
26
|
def to_h
|
25
|
-
{ :
|
27
|
+
{ name: name, path: path, duration: duration, last_seen_at: last_seen_at.to_i }
|
26
28
|
end
|
27
29
|
|
28
30
|
def self.from_hash(hash)
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
new(hash.fetch(:name),
|
32
|
+
hash.fetch(:path),
|
33
|
+
hash.fetch(:duration),
|
34
|
+
Time.at(hash.fetch(:last_seen_at)))
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
@@ -56,7 +58,7 @@ module TestQueue
|
|
56
58
|
def save
|
57
59
|
prune
|
58
60
|
|
59
|
-
File.open(@path,
|
61
|
+
File.open(@path, 'wb') do |f|
|
60
62
|
Marshal.dump(to_h, f)
|
61
63
|
end
|
62
64
|
end
|
@@ -68,15 +70,17 @@ module TestQueue
|
|
68
70
|
def to_h
|
69
71
|
suites = @suites.each_value.map(&:to_h)
|
70
72
|
|
71
|
-
{ :
|
73
|
+
{ version: CURRENT_VERSION, suites: suites }
|
72
74
|
end
|
73
75
|
|
74
76
|
def load
|
75
77
|
data = begin
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
78
|
+
File.open(@path, 'rb') { |f| Marshal.load(f) }
|
79
|
+
rescue Errno::ENOENT, EOFError, TypeError, ArgumentError
|
80
|
+
# noop
|
81
|
+
end
|
82
|
+
return unless data.is_a?(Hash) && data[:version] == CURRENT_VERSION
|
83
|
+
|
80
84
|
data[:suites].each do |suite_hash|
|
81
85
|
suite = Suite.from_hash(suite_hash)
|
82
86
|
@suites[suite.name] = suite
|
@@ -87,7 +91,7 @@ module TestQueue
|
|
87
91
|
|
88
92
|
def prune
|
89
93
|
earliest = Time.now - EIGHT_DAYS_S
|
90
|
-
@suites.delete_if do |
|
94
|
+
@suites.delete_if do |_name, suite|
|
91
95
|
suite.last_seen_at < earliest
|
92
96
|
end
|
93
97
|
end
|
data/lib/test_queue.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: minitest/rspec parallel test runner for CI environments
|
14
14
|
email: ruby@tmm1.net
|
@@ -20,29 +20,18 @@ executables:
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
-
- ".github/workflows/test.yml"
|
24
|
-
- ".gitignore"
|
25
|
-
- Appraisals
|
26
|
-
- Gemfile
|
27
23
|
- LICENSE
|
28
24
|
- README.md
|
29
|
-
- Rakefile
|
30
25
|
- exe/cucumber-queue
|
31
26
|
- exe/minitest-queue
|
32
27
|
- exe/rspec-queue
|
33
28
|
- exe/testunit-queue
|
34
|
-
- gemfiles/cucumber1_3.gemfile
|
35
|
-
- gemfiles/cucumber2_4.gemfile
|
36
|
-
- gemfiles/minitest4.gemfile
|
37
|
-
- gemfiles/minitest5.gemfile
|
38
|
-
- gemfiles/rspec2.gemfile
|
39
|
-
- gemfiles/rspec3.gemfile
|
40
|
-
- gemfiles/testunit.gemfile
|
41
29
|
- lib/test-queue.rb
|
42
30
|
- lib/test_queue.rb
|
43
31
|
- lib/test_queue/iterator.rb
|
44
32
|
- lib/test_queue/runner.rb
|
45
33
|
- lib/test_queue/runner/cucumber.rb
|
34
|
+
- lib/test_queue/runner/example.rb
|
46
35
|
- lib/test_queue/runner/minitest.rb
|
47
36
|
- lib/test_queue/runner/minitest4.rb
|
48
37
|
- lib/test_queue/runner/minitest5.rb
|
@@ -50,39 +39,15 @@ files:
|
|
50
39
|
- lib/test_queue/runner/rspec.rb
|
51
40
|
- lib/test_queue/runner/rspec2.rb
|
52
41
|
- lib/test_queue/runner/rspec3.rb
|
53
|
-
- lib/test_queue/runner/sample.rb
|
54
42
|
- lib/test_queue/runner/testunit.rb
|
55
43
|
- lib/test_queue/stats.rb
|
56
44
|
- lib/test_queue/test_framework.rb
|
57
|
-
-
|
58
|
-
- spec/stats_spec.rb
|
59
|
-
- test-queue.gemspec
|
60
|
-
- test/cucumber.bats
|
61
|
-
- test/minitest4.bats
|
62
|
-
- test/minitest5.bats
|
63
|
-
- test/rspec2.bats
|
64
|
-
- test/rspec3.bats
|
65
|
-
- test/samples/features/bad.feature
|
66
|
-
- test/samples/features/sample.feature
|
67
|
-
- test/samples/features/sample2.feature
|
68
|
-
- test/samples/features/step_definitions/common.rb
|
69
|
-
- test/samples/sample_minispec.rb
|
70
|
-
- test/samples/sample_minitest4.rb
|
71
|
-
- test/samples/sample_minitest5.rb
|
72
|
-
- test/samples/sample_rspec_helper.rb
|
73
|
-
- test/samples/sample_shared_examples_for_spec.rb
|
74
|
-
- test/samples/sample_spec.rb
|
75
|
-
- test/samples/sample_split_spec.rb
|
76
|
-
- test/samples/sample_testunit.rb
|
77
|
-
- test/samples/sample_use_shared_example1_spec.rb
|
78
|
-
- test/samples/sample_use_shared_example2_spec.rb
|
79
|
-
- test/sleepy_runner.rb
|
80
|
-
- test/testlib.bash
|
81
|
-
- test/testunit.bats
|
45
|
+
- lib/test_queue/version.rb
|
82
46
|
homepage: https://github.com/tmm1/test-queue
|
83
47
|
licenses:
|
84
48
|
- MIT
|
85
|
-
metadata:
|
49
|
+
metadata:
|
50
|
+
rubygems_mfa_required: 'true'
|
86
51
|
post_install_message:
|
87
52
|
rdoc_options: []
|
88
53
|
require_paths:
|
@@ -98,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
63
|
- !ruby/object:Gem::Version
|
99
64
|
version: '0'
|
100
65
|
requirements: []
|
101
|
-
rubygems_version: 3.4.
|
66
|
+
rubygems_version: 3.4.10
|
102
67
|
signing_key:
|
103
68
|
specification_version: 4
|
104
69
|
summary: parallel test runner
|
data/.github/workflows/test.yml
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
name: CI
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches:
|
6
|
-
- master
|
7
|
-
pull_request:
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
main:
|
11
|
-
name: >-
|
12
|
-
${{ matrix.ruby }} ${{ matrix.entry.name }}
|
13
|
-
runs-on: ${{ matrix.os }}-latest
|
14
|
-
env:
|
15
|
-
TEST_QUEUE_WORKERS: 2
|
16
|
-
TEST_QUEUE_VERBOSE: 1
|
17
|
-
strategy:
|
18
|
-
fail-fast: false
|
19
|
-
matrix:
|
20
|
-
os: [ubuntu]
|
21
|
-
# Lowest and Latest version.
|
22
|
-
ruby: ['2.7', '3.2']
|
23
|
-
entry:
|
24
|
-
- { name: cucumber1_3, bats: test/cucumber.bats }
|
25
|
-
- { name: cucumber2_4, bats: test/cucumber.bats }
|
26
|
-
- { name: minitest4, bats: test/minitest4.bats }
|
27
|
-
- { name: minitest5, bats: test/minitest5.bats }
|
28
|
-
- { name: rspec3, bats: test/rspec3.bats }
|
29
|
-
- { name: testunit, bats: test/testunit.bats }
|
30
|
-
|
31
|
-
steps:
|
32
|
-
- name: checkout
|
33
|
-
uses: actions/checkout@v3
|
34
|
-
- name: set up Ruby
|
35
|
-
uses: ruby/setup-ruby@v1
|
36
|
-
with:
|
37
|
-
ruby-version: ${{ matrix.ruby }}
|
38
|
-
|
39
|
-
- name: install dependencies
|
40
|
-
run: bundle install --jobs 3 --retry 3
|
41
|
-
- name: setup for Bats
|
42
|
-
run: bundle exec rake setup
|
43
|
-
- name: spec
|
44
|
-
run: bundle exec rake spec
|
45
|
-
- name: install dependencies for ${{ matrix.entry.name }}
|
46
|
-
run: BUNDLE_GEMFILE=gemfiles/${{ matrix.entry.name }}.gemfile bundle install --jobs 3 --retry 3
|
47
|
-
- name: test
|
48
|
-
run: BUNDLE_GEMFILE=gemfiles/${{ matrix.entry.name }}.gemfile vendor/bats/bin/bats ${{ matrix.entry.bats }}
|
49
|
-
|
50
|
-
# RSpec 2 doesn't work with Ruby 3.2:
|
51
|
-
#
|
52
|
-
# /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/rspec-core-2.99.2/lib/rspec/core/ruby_project.rb:27:
|
53
|
-
# in `block in find_first_parent_containing': undefined method `exists?' for File:Class (NoMethodError)
|
54
|
-
#
|
55
|
-
# ascend_until {|path| File.exists?(File.join(path, dir))}
|
56
|
-
# ^^^^^^^^
|
57
|
-
# Did you mean? exist?
|
58
|
-
#
|
59
|
-
# Up to Ruby 3.1 is the supported version for RSpec 2.
|
60
|
-
rspec2:
|
61
|
-
name: >-
|
62
|
-
${{ matrix.ruby }} ${{ matrix.entry.name }}
|
63
|
-
runs-on: ${{ matrix.os }}-latest
|
64
|
-
env:
|
65
|
-
TEST_QUEUE_WORKERS: 2
|
66
|
-
TEST_QUEUE_VERBOSE: 1
|
67
|
-
strategy:
|
68
|
-
fail-fast: false
|
69
|
-
matrix:
|
70
|
-
os: [ubuntu]
|
71
|
-
# Lowest and Latest version.
|
72
|
-
ruby: ['2.7', '3.1']
|
73
|
-
entry:
|
74
|
-
- { name: rspec2, bats: test/rspec2.bats }
|
75
|
-
|
76
|
-
steps:
|
77
|
-
- name: checkout
|
78
|
-
uses: actions/checkout@v3
|
79
|
-
- name: set up Ruby
|
80
|
-
uses: ruby/setup-ruby@v1
|
81
|
-
with:
|
82
|
-
ruby-version: ${{ matrix.ruby }}
|
83
|
-
|
84
|
-
- name: install dependencies
|
85
|
-
run: bundle install --jobs 3 --retry 3
|
86
|
-
- name: setup for Bats
|
87
|
-
run: bundle exec rake setup
|
88
|
-
- name: spec
|
89
|
-
run: bundle exec rake spec
|
90
|
-
- name: install dependencies for ${{ matrix.entry.name }}
|
91
|
-
run: BUNDLE_GEMFILE=gemfiles/${{ matrix.entry.name }}.gemfile bundle install --jobs 3 --retry 3
|
92
|
-
- name: test
|
93
|
-
run: BUNDLE_GEMFILE=gemfiles/${{ matrix.entry.name }}.gemfile vendor/bats/bin/bats ${{ matrix.entry.bats }}
|
data/.gitignore
DELETED
data/Appraisals
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
appraise "cucumber1-3" do
|
2
|
-
gem 'cucumber', '~> 1.3.10'
|
3
|
-
# Pin Rake version to Prevent `NoMethodError: undefined method `last_comment'`.
|
4
|
-
gem 'rake', '< 11.0'
|
5
|
-
end
|
6
|
-
|
7
|
-
appraise "cucumber2-4" do
|
8
|
-
gem 'cucumber', '~> 2.4.0'
|
9
|
-
# Pin Rake version to Prevent `NoMethodError: undefined method `last_comment'`.
|
10
|
-
gem 'rake', '< 11.0'
|
11
|
-
end
|
12
|
-
|
13
|
-
appraise "minitest4" do
|
14
|
-
gem 'rake'
|
15
|
-
gem 'minitest', '~> 4.7'
|
16
|
-
end
|
17
|
-
|
18
|
-
appraise "minitest5" do
|
19
|
-
gem 'rake'
|
20
|
-
gem 'minitest', '5.10.0'
|
21
|
-
end
|
22
|
-
|
23
|
-
appraise "rspec2" do
|
24
|
-
# Pin Rake version to Prevent `NoMethodError: undefined method `last_comment'`.
|
25
|
-
gem 'rake', '< 11.0'
|
26
|
-
gem 'rspec', '~> 2.99'
|
27
|
-
end
|
28
|
-
|
29
|
-
appraise "rspec3" do
|
30
|
-
gem 'rspec', '~> 3.12'
|
31
|
-
end
|
32
|
-
|
33
|
-
appraise "testunit" do
|
34
|
-
gem 'test-unit'
|
35
|
-
end
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
|
-
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
-
|
6
|
-
task :default => [:setup, :spec, :feature]
|
7
|
-
|
8
|
-
task :setup do
|
9
|
-
sh 'script/bootstrap' unless File.exist?("#{Dir.pwd}/vendor/bats/bin/bats")
|
10
|
-
end
|
11
|
-
|
12
|
-
task :feature do
|
13
|
-
sh 'TEST_QUEUE_WORKERS=2 TEST_QUEUE_VERBOSE=1 vendor/bats/bin/bats test'
|
14
|
-
end
|
data/gemfiles/minitest4.gemfile
DELETED
data/gemfiles/minitest5.gemfile
DELETED
data/gemfiles/rspec2.gemfile
DELETED
data/gemfiles/rspec3.gemfile
DELETED
data/gemfiles/testunit.gemfile
DELETED
data/script/bootstrap
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
set -ex
|
4
|
-
|
5
|
-
cd "$(dirname "$0")/.."
|
6
|
-
ROOT=$(pwd)
|
7
|
-
|
8
|
-
rm -rf tmp
|
9
|
-
mkdir tmp
|
10
|
-
mkdir -p vendor/bats
|
11
|
-
curl --silent --location --show-error https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz | tar -xz -C tmp
|
12
|
-
tmp/bats-0.4.0/install.sh "$ROOT/vendor/bats"
|
13
|
-
rm -rf tmp
|
data/spec/stats_spec.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "tempfile"
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
5
|
-
|
6
|
-
require "test_queue/stats"
|
7
|
-
|
8
|
-
RSpec.describe TestQueue::Stats do
|
9
|
-
before do
|
10
|
-
Tempfile.open("test_queue_stats") do |f|
|
11
|
-
@path = f.path
|
12
|
-
f.close!
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
after do
|
17
|
-
FileUtils.rm_f(@path)
|
18
|
-
end
|
19
|
-
|
20
|
-
describe "#initialize" do
|
21
|
-
it "ignores empty stats files" do
|
22
|
-
File.write(@path, "")
|
23
|
-
stats = TestQueue::Stats.new(@path)
|
24
|
-
expect(stats.all_suites).to be_empty
|
25
|
-
end
|
26
|
-
|
27
|
-
it "ignores invalid data in the stats files" do
|
28
|
-
File.write(@path, "this is not marshal data")
|
29
|
-
stats = TestQueue::Stats.new(@path)
|
30
|
-
expect(stats.all_suites).to be_empty
|
31
|
-
end
|
32
|
-
|
33
|
-
it "ignores badly-typed data in the stats file" do
|
34
|
-
File.write(@path, Marshal.dump(["heyyy"]))
|
35
|
-
stats = TestQueue::Stats.new(@path)
|
36
|
-
expect(stats.all_suites).to be_empty
|
37
|
-
end
|
38
|
-
|
39
|
-
it "ignores stats files with a wrong version number" do
|
40
|
-
File.write(@path, Marshal.dump({ :version => 1e8, :suites => "boom" }))
|
41
|
-
stats = TestQueue::Stats.new(@path)
|
42
|
-
expect(stats.all_suites).to be_empty
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
it "can save and load data" do
|
47
|
-
stats = TestQueue::Stats.new(@path)
|
48
|
-
time = truncated_now
|
49
|
-
suites = [
|
50
|
-
TestQueue::Stats::Suite.new("Suite1", "foo.rb", 0.3, time),
|
51
|
-
TestQueue::Stats::Suite.new("Suite2", "bar.rb", 0.5, time + 5),
|
52
|
-
]
|
53
|
-
stats.record_suites(suites)
|
54
|
-
stats.save
|
55
|
-
|
56
|
-
stats = TestQueue::Stats.new(@path)
|
57
|
-
expect(stats.all_suites.sort_by(&:name)).to eq(suites)
|
58
|
-
end
|
59
|
-
|
60
|
-
it "prunes suites not seen in the last 8 days" do
|
61
|
-
stats = TestQueue::Stats.new(@path)
|
62
|
-
time = truncated_now
|
63
|
-
suites = [
|
64
|
-
TestQueue::Stats::Suite.new("Suite1", "foo.rb", 0.3, time),
|
65
|
-
TestQueue::Stats::Suite.new("Suite2", "bar.rb", 0.5, time - (8 * 24 * 60 * 60) - 2),
|
66
|
-
TestQueue::Stats::Suite.new("Suite3", "baz.rb", 0.6, time - (7 * 24 * 60 * 60)),
|
67
|
-
]
|
68
|
-
stats.record_suites(suites)
|
69
|
-
stats.save
|
70
|
-
|
71
|
-
stats = TestQueue::Stats.new(@path)
|
72
|
-
expect(stats.all_suites.map(&:name).sort).to eq(%w[Suite1 Suite3])
|
73
|
-
end
|
74
|
-
|
75
|
-
# Returns Time.now rounded down to the nearest second.
|
76
|
-
def truncated_now
|
77
|
-
Time.at(Time.now.to_i)
|
78
|
-
end
|
79
|
-
end
|
data/test/cucumber.bats
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
load "testlib"
|
2
|
-
|
3
|
-
SCRATCH=tmp/cucumber-tests
|
4
|
-
|
5
|
-
setup() {
|
6
|
-
require_gem "cucumber" ">= 1.0"
|
7
|
-
rm -rf $SCRATCH
|
8
|
-
mkdir -p $SCRATCH
|
9
|
-
}
|
10
|
-
|
11
|
-
teardown() {
|
12
|
-
rm -rf $SCRATCH
|
13
|
-
}
|
14
|
-
|
15
|
-
@test "cucumber-queue succeeds when all features pass" {
|
16
|
-
run bundle exec cucumber-queue test/samples/features --require test/samples/features/step_definitions
|
17
|
-
assert_status 0
|
18
|
-
assert_output_contains "Starting test-queue master"
|
19
|
-
}
|
20
|
-
|
21
|
-
@test "cucumber-queue fails when a feature fails" {
|
22
|
-
export FAIL=1
|
23
|
-
run bundle exec cucumber-queue test/samples/features --require test/samples/features/step_definitions
|
24
|
-
assert_status 2
|
25
|
-
assert_output_contains "Starting test-queue master"
|
26
|
-
assert_output_contains "cucumber test/samples/features/bad.feature:2 # Scenario: failure"
|
27
|
-
assert_output_contains "cucumber test/samples/features/sample2.feature:26 # Scenario: failure"
|
28
|
-
}
|
29
|
-
|
30
|
-
@test "cucumber-queue fails when given a missing feature" {
|
31
|
-
run bundle exec cucumber-queue test/samples/does_not_exist.feature --require test/samples/features/step_definitions
|
32
|
-
assert_status 1
|
33
|
-
assert_output_contains "Aborting: Discovering suites failed."
|
34
|
-
}
|
35
|
-
|
36
|
-
@test "cucumber-queue fails when given a malformed feature" {
|
37
|
-
[ -f README.md ]
|
38
|
-
run bundle exec cucumber-queue README.md --require test/samples/features/step_definitions
|
39
|
-
|
40
|
-
# Cucumber 1 and 2 fail in different ways.
|
41
|
-
refute_status 0
|
42
|
-
assert_output_matches 'Aborting: Discovering suites failed\.|README\.md: Parser errors:'
|
43
|
-
}
|
44
|
-
|
45
|
-
@test "cucumber-queue handles test file being deleted" {
|
46
|
-
cp test/samples/features/*.feature $SCRATCH
|
47
|
-
|
48
|
-
run bundle exec cucumber-queue $SCRATCH --require test/samples/features/step_definitions
|
49
|
-
assert_status 0
|
50
|
-
assert_output_matches "Feature: Foobar$"
|
51
|
-
|
52
|
-
rm $SCRATCH/sample.feature
|
53
|
-
|
54
|
-
run bundle exec cucumber-queue $SCRATCH --require test/samples/features/step_definitions
|
55
|
-
assert_status 0
|
56
|
-
refute_output_matches "Feature: Foobar$"
|
57
|
-
}
|
data/test/minitest4.bats
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
load "testlib"
|
2
|
-
|
3
|
-
setup() {
|
4
|
-
require_gem "minitest" "~> 4.0"
|
5
|
-
}
|
6
|
-
|
7
|
-
@test "minitest-queue succeeds when all tests pass" {
|
8
|
-
run bundle exec minitest-queue ./test/samples/*_minitest4.rb
|
9
|
-
assert_status 0
|
10
|
-
assert_output_contains "Starting test-queue master"
|
11
|
-
}
|
12
|
-
|
13
|
-
@test "minitest-queue fails when a test fails" {
|
14
|
-
export FAIL=1
|
15
|
-
run bundle exec minitest-queue ./test/samples/*_minitest4.rb
|
16
|
-
assert_status 1
|
17
|
-
assert_output_contains "Starting test-queue master"
|
18
|
-
assert_output_contains "1) Failure:"
|
19
|
-
assert_output_contains "MiniTestFailure#test_fail"
|
20
|
-
}
|
21
|
-
|
22
|
-
@test "minitest-queue succeeds when all specs pass" {
|
23
|
-
run bundle exec minitest-queue ./test/samples/*_minispec.rb
|
24
|
-
assert_status 0
|
25
|
-
assert_output_contains "Starting test-queue master"
|
26
|
-
}
|
27
|
-
|
28
|
-
@test "minitest-queue fails when a spec fails" {
|
29
|
-
export FAIL=1
|
30
|
-
run bundle exec minitest-queue ./test/samples/*_minispec.rb
|
31
|
-
assert_status 1
|
32
|
-
assert_output_contains "1) Failure:"
|
33
|
-
assert_output_contains "Meme::when asked about blending possibilities#test_0002_fails"
|
34
|
-
}
|