Set DEBUG for integration test output

This commit is contained in:
Donal McBreen
2025-04-16 16:14:11 +01:00
parent 85320dbc51
commit bd81632439
2 changed files with 9 additions and 9 deletions

View File

@@ -321,7 +321,7 @@ class CliBuildTest < CliTestCase
private private
def run_command(*command, fixture: :with_accessories) 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 end
def stub_dependency_checks def stub_dependency_checks

View File

@@ -11,12 +11,12 @@ class IntegrationTest < ActiveSupport::TestCase
end end
teardown do teardown do
unless passed? if !passed? && ENV["DEBUG"]
# [ :deployer, :vm1, :vm2, :shared, :load_balancer, :registry ].each do |container| [ :deployer, :vm1, :vm2, :shared, :load_balancer, :registry ].each do |container|
# puts puts
# puts "Logs for #{container}:" puts "Logs for #{container}:"
# docker_compose :logs, container docker_compose :logs, container
# end end
end end
docker_compose "down -t 1" docker_compose "down -t 1"
end end
@@ -25,8 +25,8 @@ class IntegrationTest < ActiveSupport::TestCase
def docker_compose(*commands, capture: false, raise_on_error: true) def docker_compose(*commands, capture: false, raise_on_error: true)
command = "TEST_ID=#{ENV["TEST_ID"]} docker compose #{commands.join(" ")}" command = "TEST_ID=#{ENV["TEST_ID"]} docker compose #{commands.join(" ")}"
succeeded = false succeeded = false
if capture if capture || !ENV["DEBUG"]
result = stdouted { succeeded = system("cd test/integration && #{command}") } result = stdouted { stderred { succeeded = system("cd test/integration && #{command}") } }
else else
succeeded = system("cd test/integration && #{command}") succeeded = system("cd test/integration && #{command}")
end end