diff --git a/test/cli/build_test.rb b/test/cli/build_test.rb index 76db2924..8690e00b 100644 --- a/test/cli/build_test.rb +++ b/test/cli/build_test.rb @@ -321,7 +321,7 @@ class CliBuildTest < CliTestCase private def run_command(*command, fixture: :with_accessories) - stdouted { Kamal::Cli::Build.start([ *command, "-c", "test/fixtures/deploy_#{fixture}.yml" ]) } + stdouted { stderred { Kamal::Cli::Build.start([ *command, "-c", "test/fixtures/deploy_#{fixture}.yml" ]) } } end def stub_dependency_checks diff --git a/test/integration/integration_test.rb b/test/integration/integration_test.rb index 88c262c9..e6e5520d 100644 --- a/test/integration/integration_test.rb +++ b/test/integration/integration_test.rb @@ -11,12 +11,12 @@ class IntegrationTest < ActiveSupport::TestCase end teardown do - unless passed? - # [ :deployer, :vm1, :vm2, :shared, :load_balancer, :registry ].each do |container| - # puts - # puts "Logs for #{container}:" - # docker_compose :logs, container - # end + if !passed? && ENV["DEBUG"] + [ :deployer, :vm1, :vm2, :shared, :load_balancer, :registry ].each do |container| + puts + puts "Logs for #{container}:" + docker_compose :logs, container + end end docker_compose "down -t 1" end @@ -25,8 +25,8 @@ class IntegrationTest < ActiveSupport::TestCase def docker_compose(*commands, capture: false, raise_on_error: true) command = "TEST_ID=#{ENV["TEST_ID"]} docker compose #{commands.join(" ")}" succeeded = false - if capture - result = stdouted { succeeded = system("cd test/integration && #{command}") } + if capture || !ENV["DEBUG"] + result = stdouted { stderred { succeeded = system("cd test/integration && #{command}") } } else succeeded = system("cd test/integration && #{command}") end