mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
runtime: Remove HTML coverage option from go-test.sh
The html-coverage option to this script doesn't really alter behaviour it just does the same thing as normal coverage, then converts the report to HTML. That conversion is a single command, plus a chmod to make the final output mode 0644. That overrides any umask the user has set, which doesn't seem like a policy decision this script should be making. Nothing in the kata-containers or tests repository uses this, so it doesn't really make sense to keep this logic inside this script. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
7f76914422
commit
04c8b52e04
@ -47,9 +47,6 @@ tmp_coverage_file="${test_coverage_file}.tmp"
|
||||
# Permissions to create coverage files with
|
||||
coverage_file_mode=0644
|
||||
|
||||
# Name of HTML format coverage file
|
||||
html_report_file="coverage.html"
|
||||
|
||||
warn()
|
||||
{
|
||||
local msg="$*"
|
||||
@ -92,7 +89,6 @@ EOF
|
||||
Commands:
|
||||
|
||||
help # Show usage.
|
||||
html-coverage # Run tests and create HTML coverage report.
|
||||
|
||||
EOF
|
||||
}
|
||||
@ -122,16 +118,6 @@ run_as_user()
|
||||
fi
|
||||
}
|
||||
|
||||
# Run the tests and generate an HTML report of the results
|
||||
test_html_coverage()
|
||||
{
|
||||
test_coverage
|
||||
|
||||
go tool cover -html="${test_coverage_file}" -o "${html_report_file}"
|
||||
|
||||
run_as_user "current" chmod "${coverage_file_mode}" "${html_report_file}"
|
||||
}
|
||||
|
||||
# Test a single golang package
|
||||
test_go_package()
|
||||
{
|
||||
@ -246,9 +232,7 @@ main()
|
||||
# KATA_GO_TEST_FLAGS can be set to change the flags passed to "go test".
|
||||
go_test_flags=${KATA_GO_TEST_FLAGS:-"-v $race -timeout $timeout_value -ldflags '$go_ldflags'"}
|
||||
|
||||
if [ "$1" = "html-coverage" ]; then
|
||||
test_html_coverage
|
||||
elif [ "$run_coverage" = yes ]; then
|
||||
if [ "$run_coverage" = yes ]; then
|
||||
test_coverage
|
||||
else
|
||||
test_local
|
||||
|
Loading…
Reference in New Issue
Block a user