Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to narrow test integration interface #1160

Merged
merged 1 commit into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/mutant/integration/minitest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def call(tests)

Result::Test.new(
passed: reporter.passed?,
tests: tests,
runtime: timer.now - start
)
end
Expand Down
5 changes: 2 additions & 3 deletions lib/mutant/integration/null.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ def all_tests
# @param [Enumerable<Mutant::Test>] tests
#
# @return [Result::Test]
def call(tests)
def call(_tests)
Result::Test.new(
passed: true,
runtime: 0.0,
tests: tests
runtime: 0.0
)
end

Expand Down
7 changes: 3 additions & 4 deletions lib/mutant/integration/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ def setup
#
# @return [Result::Test]
def call(tests)
examples = tests.map(&all_tests_index.method(:fetch))
filter_examples(&examples.method(:include?))
examples = tests.map(&all_tests_index)
filter_examples(&examples.public_method(:include?))
start = timer.now
passed = @runner.run_specs(@world.ordered_example_groups).equal?(EXIT_SUCCESS)
Result::Test.new(
passed: passed,
runtime: timer.now - start,
tests: tests
runtime: timer.now - start
)
end

Expand Down
7 changes: 1 addition & 6 deletions lib/mutant/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ def stop?

# Test result
class Test
include Result, Anima.new(
:passed,
:runtime,
:tests
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one was entirely unused. Historic artifact, but transitively referenced lots of objects that where needlessly run through the wire.

)
include Result, Anima.new(:passed, :runtime)

class VoidValue < self
include Singleton
Expand All @@ -137,7 +133,6 @@ def initialize
super(
passed: false,
runtime: 0.0,
tests: []
)
end
end # VoidValue
Expand Down
2 changes: 0 additions & 2 deletions spec/support/shared_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,13 @@ def setup_shared_context

let(:mutation_a_test_result) do
Mutant::Result::Test.new(
tests: [test_a],
passed: false,
runtime: 1.0
)
end

let(:mutation_b_test_result) do
Mutant::Result::Test.new(
tests: [test_a],
passed: false,
runtime: 1.0
)
Expand Down
6 changes: 2 additions & 4 deletions spec/unit/mutant/integration/rspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@
expect(subject).to eql(
Mutant::Result::Test.new(
passed: false,
runtime: 0.0,
tests: tests
runtime: 0.0
)
)
end
Expand All @@ -203,8 +202,7 @@
expect(subject).to eql(
Mutant::Result::Test.new(
passed: true,
runtime: 0.0,
tests: tests
runtime: 0.0
)
)
end
Expand Down
3 changes: 1 addition & 2 deletions spec/unit/mutant/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ def apply
should eql(
Mutant::Result::Test.new(
passed: true,
runtime: 0.0,
tests: tests
runtime: 0.0
)
)
end
Expand Down
3 changes: 1 addition & 2 deletions spec/unit/mutant/result/test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
it 'returns expected attributes' do
expect(described_class.instance.to_h).to eql(
passed: false,
runtime: 0.0,
tests: []
runtime: 0.0
)
end
end
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.minitest.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
mutant (0.10.17)
mutant (0.10.19)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.1)
Expand All @@ -16,9 +16,9 @@ PATH
procto (~> 0.0.2)
unparser (~> 0.5.4)
variable (~> 0.0.1)
mutant-minitest (0.10.17)
mutant-minitest (0.10.19)
minitest (~> 5.11)
mutant (~> 0.10.17)
mutant (= 0.10.19)

GEM
remote: https://rubygems.org/
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.8.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
mutant (0.10.17)
mutant (0.10.19)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.1)
Expand All @@ -16,8 +16,8 @@ PATH
procto (~> 0.0.2)
unparser (~> 0.5.4)
variable (~> 0.0.1)
mutant-rspec (0.10.17)
mutant (~> 0.10.17)
mutant-rspec (0.10.19)
mutant (= 0.10.19)
rspec-core (>= 3.8.0, < 4.0.0)

GEM
Expand Down