mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-29 06:06:03 +00:00
Filtering the output with grep leads to hard to read log output, e.g. from pull-kubernetes-unit: +++ [0613 15:32:48] Running tests without code coverage and with -race {"Time":"2024-06-13T15:33:47.845457374Z","Action":"output","Package":"k8s.io/kubernetes/cluster/gce/cos","Test":"TestCreateMasterAuditPolicy","Output":" /tmp/configure-helper-test47992121/kube-env: line 1: `}'\n"} {"Time":"2024-06-13T15:33:49.053732803Z","Action":"output","Package":"k8s.io/kubernetes/cluster/gce/cos","Output":"ok \tk8s.io/kubernetes/cluster/gce/cos\t2.906s\n"} We can do better than that. When feeding the output of the "go test" command(s) into gotestsum *while it runs*, we can use --format=standard-quiet (= normal go test output) or --format=standard-verbose (= `go test -v`) when FULL_LOG is requested to get nicer output. This works when testing everything at once. This was said to be not possible when doing coverage profiling. But recent Go no longer has that limitation, so the xargs trick gets removed. All that we need to do for coverage profiling is to add some additional parameters and the conversion to HTML.
Kubernetes hack GuideLines
This document describes how you can use the scripts from hack
directory
and gives a brief introduction and explanation of these scripts.
Overview
The hack
directory contains many scripts that ensure continuous development of kubernetes,
enhance the robustness of the code, improve development efficiency, etc.
The explanations and descriptions of these scripts are helpful for contributors.
For details, refer to the following guidelines.
Key scripts
verify-all.sh
: This script is a vestigial redirection, Please do not add "real" logic. It is equivalent tomake verify
.update-all.sh
: This script is a vestigial redirection, Please do not add "real" logic. Thetrue
target of this makerule ishack/make-rules/update.sh
.It is equivalent tomake update
.
Attention
Note that all scripts must be run from the Kubernetes root directory.
We should run hack/verify-all.sh
before submitting a PR and if anything fails run hack/update-all.sh
.