From ee9447f56ce3348a7a7933917a460212fecb2fc5 Mon Sep 17 00:00:00 2001 From: Oscar Barrios Date: Thu, 3 Oct 2024 17:19:11 +0200 Subject: [PATCH] Change path to store the code coverage report --- testsuite/features/support/code_coverage.rb | 9 +++++---- testsuite/features/support/remote_node.rb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/testsuite/features/support/code_coverage.rb b/testsuite/features/support/code_coverage.rb index 02965cc5c2d3..902a08e6f237 100644 --- a/testsuite/features/support/code_coverage.rb +++ b/testsuite/features/support/code_coverage.rb @@ -21,6 +21,7 @@ def close # # @param feature_name [String] The name of the feature. def push_feature_coverage(feature_name) + $stdout.puts("Pushing coverage for #{feature_name} into Redis") filename = "/tmp/jacoco-#{feature_name}.xml" begin xml = File.read(filename, mode: 'r') @@ -62,9 +63,9 @@ def jacoco_dump(feature_name, html = false, xml = true, source = false) xml_report = xml ? "--xml /srv/www/htdocs/pub/jacoco-#{feature_name}.xml" : '' sourcefiles = source ? '--sourcefiles /tmp/uyuni-master/java/code/src' : '' classfiles = '--classfiles /srv/tomcat/webapps/rhn/WEB-INF/lib/rhn.jar' - dump_path = "/tmp/jacoco-#{feature_name}.exec" - get_target('server').run("#{cli} dump --address localhost --destfile #{dump_path} --port 6300 --reset") - get_target('server').run("#{cli} report #{dump_path} #{html_report} #{xml_report} #{sourcefiles} #{classfiles}") - file_extract(get_target('server'), "/srv/www/htdocs/pub/jacoco-#{feature_name}.xml", "/tmp/jacoco-#{feature_name}.xml") + dump_path = "/var/cache/jacoco-#{feature_name}.exec" + get_target('server').run("#{cli} dump --address localhost --destfile #{dump_path} --port 6300 --reset", verbose: true) + get_target('server').run("#{cli} report #{dump_path} #{html_report} #{xml_report} #{sourcefiles} #{classfiles}", verbose: true) + get_target('server').extract("/srv/www/htdocs/pub/jacoco-#{feature_name}.xml", "/tmp/jacoco-#{feature_name}.xml") end end diff --git a/testsuite/features/support/remote_node.rb b/testsuite/features/support/remote_node.rb index 11d4c2e85ef6..7d1c71ee5a02 100644 --- a/testsuite/features/support/remote_node.rb +++ b/testsuite/features/support/remote_node.rb @@ -199,7 +199,7 @@ def inject(test_runner_file, remote_node_file) def extract(remote_node_file, test_runner_file) if @has_mgrctl tmp_file = File.join('/tmp/', File.basename(remote_node_file)) - _out, code = run_local("mgrctl cp server:#{remote_node_file} #{tmp_file}") + _out, code = run_local("mgrctl cp server:#{remote_node_file} #{tmp_file}", verbose: true) raise ScriptError, "Failed to extract #{remote_node_file} from container" unless code.zero? success = get_target('localhost').scp_download(tmp_file, test_runner_file, host: @full_hostname)