Skip to content

Commit

Permalink
Log launching details from executable instead
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexB52 committed Jan 26, 2025
1 parent 52a376d commit 6c5583a
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bin/test/bundler-app
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ FOLDER="features/bundler-app"

bundle install
bundle exec rake build
cp -R features/support features/bundler-app/retest
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} "$FOLDER/retest.gem"
cp -R features/support $FOLDER/retest
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} $FOLDER/retest.gem

if [[ "$1" == "--no-build" ]]; then
if [[ "$1" == "--nobuild" ]]; then
docker compose -f "$FOLDER/docker-compose.yml" up --exit-code-from retest
else
docker compose -f "$FOLDER/docker-compose.yml" up --build --exit-code-from retest
Expand Down
13 changes: 10 additions & 3 deletions bin/test/rspec-ruby
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/env bash

FOLDER="features/rspec-ruby"

bundle install
bundle exec rake build
cp -R features/support features/rspec-ruby/retest
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} features/rspec-ruby/retest.gem
docker compose -f features/rspec-ruby/docker-compose.yml up --build --exit-code-from retest
cp -R features/support $FOLDER/retest
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} $FOLDER/retest.gem

if [[ "$1" == "--nobuild" ]]; then
docker compose -f "$FOLDER/docker-compose.yml" up --exit-code-from retest
else
docker compose -f "$FOLDER/docker-compose.yml" up --build --exit-code-from retest
fi
4 changes: 2 additions & 2 deletions bin/test/ruby-app
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FOLDER="features/ruby-app"

bundle install
bundle exec rake build
cp -R features/support "$FOLDER/retest"
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} features/ruby-app/retest.gem
cp -R features/support $FOLDER/retest
ls -t pkg | head -n1 | xargs -I {} mv pkg/{} $FOLDER/retest.gem

if [[ "$1" == "--nobuild" ]]; then
docker compose -f "$FOLDER/docker-compose.yml" up --exit-code-from retest
Expand Down
14 changes: 14 additions & 0 deletions exe/retest
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,26 @@ if options.params[:diff]
return
end

# LOGGING LAUNCHING DETAILS

case command
when Retest::Command::Rspec then puts "Setup: [RSPEC]"
when Retest::Command::Rails then puts "Setup: [RAILS]"
when Retest::Command::Rake then puts "Setup: [RAKE]"
when Retest::Command::Ruby then puts "Setup: [RUBY]"
else puts "Setup: [UNKNOWN]"
end

puts "Command: '#{command}'"

if watcher == Retest::Watcher::Watchexec
puts "Watcher: [WATCHEXEC]"
else
puts "Watcher: [LISTEN]"
end

puts # break linke

launching_message = "Launching Retest..."
if options.force_polling?
launching_message = "Launching Retest with polling method..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_start_help
Setup: [RAKE]
Command: 'bundle exec rake test TEST=<test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
Expand Down
2 changes: 2 additions & 0 deletions features/hanami-app/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def test_with_no_command
Setup: [RAKE]
Command: 'bundle exec rake test TEST=<test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand All @@ -90,6 +91,7 @@ def test_with_no_command_all
Setup: [RAKE]
Command: 'bundle exec rake test'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand Down
2 changes: 2 additions & 0 deletions features/rails-app/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_with_no_command
Setup: [RAILS]
Command: 'bin/rails test <test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand All @@ -100,6 +101,7 @@ def test_with_no_command_all
Setup: [RAILS]
Command: 'bin/rails test'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand Down
2 changes: 2 additions & 0 deletions features/rspec-rails/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_with_no_command
Setup: [RSPEC]
Command: 'bundle exec rspec <test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand All @@ -100,6 +101,7 @@ def test_with_no_command_all
Setup: [RSPEC]
Command: 'bundle exec rspec'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand Down
1 change: 1 addition & 0 deletions features/rspec-ruby/retest/retest_test/flags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_with_no_command
Setup: [RSPEC]
Command: 'bundle exec rspec <test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand Down
3 changes: 3 additions & 0 deletions features/ruby-app/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_start_retest
Setup: [RUBY]
Command: 'bundle exec ruby <test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
EXPECTED
Expand All @@ -51,6 +52,7 @@ def test_start_retest
Setup: [RUBY]
Command: 'bundle exec ruby <test>'
Watcher: [WATCHEXEC]
Launching Retest...
Ready to refactor! You can make file changes now
EXPECTED
Expand All @@ -75,6 +77,7 @@ def test_uses_watchexec_when_installed
Setup: [RUBY]
Command: 'bundle exec ruby <test>'
Watcher: [WATCHEXEC]
Launching Retest...
Ready to refactor! You can make file changes now
EXPECTED
Expand Down
1 change: 1 addition & 0 deletions features/ruby-bare/retest/scenarios/auto_flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_start_retest
Setup: [RUBY]
Command: 'ruby <test>'
Watcher: [LISTEN]
Launching Retest...
Ready to refactor! You can make file changes now
OUTPUT
Expand Down

0 comments on commit 6c5583a

Please sign in to comment.