Skip to content

Commit

Permalink
Change path to store the code coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
srbarrios authored and juliogonzalez committed Oct 4, 2024
1 parent bd0a9e4 commit 3790ee2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions testsuite/features/support/code_coverage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion testsuite/features/support/remote_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3790ee2

Please sign in to comment.