New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show test binary version #24770
Show test binary version #24770
Conversation
Each test output should start with version of the test binary. This is useful when using openshift-tests as CSI driver certification suite - the test results should show what version of tests was run.
test/extended/util/test.go
Outdated
@@ -91,7 +91,7 @@ func InitTest(dryRun bool) error { | |||
// Ensure that Kube tests run privileged (like they do upstream) | |||
TestContext.CreateTestingNS = createTestingNS | |||
|
|||
klog.V(2).Infof("Extended test version %s", version.Get().String()) | |||
klog.Infof("Extended test version %s", version.Get().String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the right place to print this. It should only be printed in run suite, and we should print it with fmt.Printf()
(although probably stderr).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworked to openshift-tests run
only and sent to stderr.
@@ -111,6 +112,7 @@ func newRunCommand() *cobra.Command { | |||
SilenceErrors: true, | |||
RunE: func(cmd *cobra.Command, args []string) error { | |||
return mirrorToFile(opt, func() error { | |||
fmt.Fprintln(os.Stderr, "openshift-test version:", version.Get().String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more, sorry. Do not print on dry-run
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with --dry-run
, I get this on stderr anyway:
I0326 18:32:47.828294 369176 test_context.go:419] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, still I think it's quite useless.
@@ -111,6 +112,9 @@ func newRunCommand() *cobra.Command { | |||
SilenceErrors: true, | |||
RunE: func(cmd *cobra.Command, args []string) error { | |||
return mirrorToFile(opt, func() error { | |||
if !opt.DryRun { | |||
fmt.Fprintln(os.Stderr, "openshift-test version:", version.Get().String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space between ':' and version. Then lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openshift-test version: x.y.z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually... should be fmt.Fprintf(os.Stderr, "%s version: %s\n", filepath.Base(os.Args[0]), version.Get().String())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space is added by Fprintln
:
openshift-test version: v4.1.0+d56e7d7-2472-dirty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces are always added between operands and a newline is appended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to your proposal. Now it must be perfect
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, smarterclayton The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
15 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@jsafrane: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Each test output should start with version of the test binary. This is useful when using openshift-tests as CSI driver certification suite - the test results should show what version of tests was run.
On related note, why standard klog arguments are not exposed?