Skip to content

Commit

Permalink
fixup! Use only one runner
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexB52 committed Nov 24, 2024
1 parent b3adbcd commit 3f10e34
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 55 deletions.
14 changes: 7 additions & 7 deletions features/bundler-app/retest/retest_test/file_changes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_modifying_existing_file

modify_file('lib/bundler_app/bottles.rb')

assert_match "Test File Selected: test/bundler_app/test_bottles.rb", @output.read
assert_match "Test file: test/bundler_app/test_bottles.rb", @output.read
assert_match "12 runs, 12 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -30,7 +30,7 @@ def test_modifying_existing_test_file

modify_file('test/bundler_app/test_bottles.rb')

assert_match "Test File Selected: test/bundler_app/test_bottles.rb", @output.read
assert_match "Test file: test/bundler_app/test_bottles.rb", @output.read
assert_match "12 runs, 12 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -39,7 +39,7 @@ def test_creating_a_new_test_file

create_file 'test/bundler_app/test_foo.rb'

assert_match "Test File Selected: test/bundler_app/test_foo.rb", @output.read
assert_match "Test file: test/bundler_app/test_foo.rb", @output.read

ensure
delete_file 'test/bundler_app/test_foo.rb'
Expand All @@ -54,13 +54,13 @@ def test_creating_a_new_file
EXPECTED

create_file 'test/bundler_app/test_foo.rb'
assert_match "Test File Selected: test/bundler_app/test_foo.rb", @output.read
assert_match "Test file: test/bundler_app/test_foo.rb", @output.read

modify_file('lib/bundler_app/bottles.rb')
assert_match "Test File Selected: test/bundler_app/test_bottles.rb", @output.read
assert_match "Test file: test/bundler_app/test_bottles.rb", @output.read

modify_file('lib/bundler_app/foo.rb')
assert_match "Test File Selected: test/bundler_app/test_foo.rb", @output.read
assert_match "Test file: test/bundler_app/test_foo.rb", @output.read

ensure
delete_file 'lib/bundler_app/foo.rb'
Expand All @@ -74,7 +74,7 @@ def test_untracked_file
launch_retest @command

modify_file 'lib/bundler_app/foo.rb'
assert_match "Test File Selected: test/bundler_app/test_foo.rb", @output.read
assert_match "Test file: test/bundler_app/test_foo.rb", @output.read

ensure
delete_file 'lib/bundler_app/foo.rb'
Expand Down
2 changes: 1 addition & 1 deletion features/hanami-app/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_modify_a_file

modify_file 'apps/web/controllers/books/create.rb'

assert_match "Test File Selected: spec/web/controllers/books/create_spec.rb", @output.read
assert_match "Test file: spec/web/controllers/books/create_spec.rb", @output.read
assert_match "4 runs, 7 assertions, 0 failures, 0 errors, 0 skips", @output.read
end
end
Expand Down
2 changes: 1 addition & 1 deletion features/rails-app/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_modify_a_file

modify_file 'app/models/post.rb'

assert_match "Test File Selected: test/models/post_test.rb", @output.read
assert_match "Test file: test/models/post_test.rb", @output.read
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", @output.read
end
end
Expand Down
2 changes: 1 addition & 1 deletion features/rspec-rails/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_modify_a_file

modify_file 'app/models/post.rb'

assert_match "Test File Selected: spec/models/post_spec.rb", @output.read
assert_match "Test file: spec/models/post_spec.rb", @output.read
assert_match "2 examples, 0 failures", @output.read
end
end
Expand Down
14 changes: 7 additions & 7 deletions features/rspec-ruby/retest/retest_test/file_changes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_modifying_existing_file

modify_file('lib/bottles.rb')

assert_match "Test File Selected: spec/bottles_spec.rb", @output.read
assert_match "Test file: spec/bottles_spec.rb", @output.read
assert_match "12 examples, 0 failures", @output.read
end

Expand All @@ -30,7 +30,7 @@ def test_modifying_existing_test_file

modify_file('spec/bottles_spec.rb')

assert_match "Test File Selected: spec/bottles_spec.rb", @output.read
assert_match "Test file: spec/bottles_spec.rb", @output.read
assert_match "12 examples, 0 failures", @output.read
end

Expand All @@ -39,7 +39,7 @@ def test_creating_a_new_test_file

create_file 'foo_spec.rb'

assert_match "Test File Selected: foo_spec.rb", @output.read
assert_match "Test file: foo_spec.rb", @output.read

ensure
delete_file 'foo_spec.rb'
Expand All @@ -54,13 +54,13 @@ def test_creating_a_new_file
EXPECTED

create_file 'foo_spec.rb'
assert_match "Test File Selected: foo_spec.rb", @output.read
assert_match "Test file: foo_spec.rb", @output.read

modify_file('lib/bottles.rb')
assert_match "Test File Selected: spec/bottles_spec.rb", @output.read
assert_match "Test file: spec/bottles_spec.rb", @output.read

modify_file('foo.rb')
assert_match "Test File Selected: foo_spec.rb", @output.read
assert_match "Test file: foo_spec.rb", @output.read

ensure
delete_file 'foo.rb'
Expand All @@ -74,7 +74,7 @@ def test_untracked_file
launch_retest @command

modify_file 'foo.rb'
assert_match "Test File Selected: foo_spec.rb", @output.read
assert_match "Test file: foo_spec.rb", @output.read

ensure
delete_file 'foo.rb'
Expand Down
2 changes: 1 addition & 1 deletion features/rspec-ruby/retest/retest_test/flags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def test_with_no_command

modify_file('lib/bottles.rb')

assert_match "Test File Selected: spec/bottles_spec.rb", @output.read
assert_match "Test file: spec/bottles_spec.rb", @output.read
end
end
14 changes: 7 additions & 7 deletions features/ruby-app/retest/retest_test/file_changes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_modifying_existing_file

modify_file('lib/bottles.rb')

assert_match "Test File Selected: test/bottles_test.rb", @output.read
assert_match "Test file: test/bottles_test.rb", @output.read
assert_match "12 runs, 12 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -30,7 +30,7 @@ def test_modifying_existing_test_file

modify_file('test/bottles_test.rb')

assert_match "Test File Selected: test/bottles_test.rb", @output.read
assert_match "Test file: test/bottles_test.rb", @output.read
assert_match "12 runs, 12 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -39,7 +39,7 @@ def test_creating_a_new_test_file

create_file 'foo_test.rb'

assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo_test.rb'
Expand All @@ -54,13 +54,13 @@ def test_creating_a_new_file
EXPECTED

create_file 'foo_test.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

modify_file('lib/bottles.rb')
assert_match "Test File Selected: test/bottles_test.rb", @output.read
assert_match "Test file: test/bottles_test.rb", @output.read

modify_file('foo.rb')
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo.rb'
Expand All @@ -74,7 +74,7 @@ def test_untracked_file
launch_retest @command

modify_file 'foo.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo.rb'
Expand Down
2 changes: 1 addition & 1 deletion features/ruby-app/retest/retest_test/flags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def test_with_no_command

modify_file('lib/bottles.rb')

assert_match "Test File Selected: test/bottles_test.rb", @output.read
assert_match "Test file: test/bottles_test.rb", @output.read
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_displaying_options_on_matching_command
launch_retest('retest --ruby')

create_file 'foo_test.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

modify_file('lib/bottles.rb')
assert_match <<~EXPECTED.chomp, @output.read
Expand All @@ -39,7 +39,7 @@ def test_displaying_options_on_matching_command
@input.write "2\n"
wait

assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo_test.rb'
Expand Down
14 changes: 7 additions & 7 deletions features/ruby-bare/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_modifying_existing_file

modify_file('program.rb')

assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -55,7 +55,7 @@ def test_modifying_existing_test_file

modify_file('program_test.rb')

assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -64,7 +64,7 @@ def test_creating_a_new_test_file

create_file 'foo_test.rb'

assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

delete_file 'foo_test.rb'
end
Expand All @@ -78,13 +78,13 @@ def test_creating_a_new_file
EXPECTED

create_file 'foo_test.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

modify_file('program.rb')
assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read

modify_file('foo.rb')
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

delete_file 'foo.rb'
delete_file 'foo_test.rb'
Expand All @@ -97,7 +97,7 @@ def test_untracked_file
launch_retest @command

modify_file 'foo.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

delete_file 'foo.rb'
delete_file 'foo_test.rb'
Expand Down
2 changes: 1 addition & 1 deletion features/ruby-bare/retest/scenarios/auto_flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def test_start_retest

modify_file('program.rb')

assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ def test_file_modification
modify_file('program.rb')

assert_match <<~EXPECTED, @output.read
Files Selected:
- changed: program.rb
- test: program_test.rb
Changed file: program.rb
Test file: program_test.rb
placeholders: program.rb and program_test.rb
EXPECTED
Expand Down
2 changes: 1 addition & 1 deletion features/ruby-bare/retest/scenarios/changed_placeholder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_file_modification
modify_file('program.rb')

assert_match <<~EXPECTED, @output.read
Changed File Selected: program.rb
Changed file: program.rb
file modified: program.rb
EXPECTED
end
Expand Down
14 changes: 7 additions & 7 deletions features/ruby-bare/retest/scenarios/force_polling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_modifying_existing_file

modify_file('program.rb')

assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -30,7 +30,7 @@ def test_modifying_existing_test_file

modify_file('program_test.rb')

assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", @output.read
end

Expand All @@ -39,7 +39,7 @@ def test_creating_a_new_test_file

create_file 'foo_test.rb'

assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo_test.rb'
Expand All @@ -54,13 +54,13 @@ def test_creating_a_new_file
EXPECTED

create_file 'foo_test.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

modify_file('program.rb')
assert_match "Test File Selected: program_test.rb", @output.read
assert_match "Test file: program_test.rb", @output.read

modify_file('foo.rb')
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo.rb'
Expand All @@ -74,7 +74,7 @@ def test_untracked_file
launch_retest @command

modify_file 'foo.rb'
assert_match "Test File Selected: foo_test.rb", @output.read
assert_match "Test file: foo_test.rb", @output.read

ensure
delete_file 'foo.rb'
Expand Down
9 changes: 6 additions & 3 deletions features/ruby-bare/retest/scenarios/multiple_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ def test_file_modification

modify_file('program.rb')

log("Changed file: #{changed_file}")

log("Test file: #{cached_test_file}")

assert_match <<~EXPECTED, @output.read
Files Selected:
- changed: program.rb
- test: program_test.rb
Changed file: program.rb
Test file: program_test.rb
files: program.rb and program_test.rb
hello world
Expand Down
4 changes: 2 additions & 2 deletions lib/retest/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def run(changed_files: [], test_files: [])
print_changed_file_not_found
return
end
log("Changed File Selected: #{changed_file}")
log("Changed file: #{changed_file}")
end

if command.to_s.include?('<test>')
if cached_test_file.nil?
print_test_file_not_found
return
end
log("Test File Selected: #{cached_test_file}")
log("Test file: #{cached_test_file}")
end

system_run command.to_s
Expand Down
Loading

0 comments on commit 3f10e34

Please sign in to comment.