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

@@ -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