Skip to content

add caller info to the testHook#5125

Merged
dmcgowan merged 1 commit intocontainerd:masterfrom
Iceber:add-caller-info
Mar 23, 2021
Merged

add caller info to the testHook#5125
dmcgowan merged 1 commit intocontainerd:masterfrom
Iceber:add-caller-info

Conversation

@Iceber
Copy link
Copy Markdown
Member

@Iceber Iceber commented Mar 4, 2021

issue: #5093

It may be inconvenient to have no caller information in the test log when a problem occurs.

output:

=== RUN   TestLogTest
    log_hook.go:40: time="2021-02-27T02:19:31.384471000+08:00" level=info msg="test message" func=logtest.TestLogTest file="/Users/icebergu/workspace/containerd/log/logtest/context_test.go:12"
--- PASS: TestLogTest (0.00s)
PASS
ok      github.com/containerd/containerd/log/logtest    0.008s

@k8s-ci-robot
Copy link
Copy Markdown

Hi @Iceber. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 4, 2021

Build succeeded.

@kzys
Copy link
Copy Markdown
Member

kzys commented Mar 17, 2021

/ok-to-test

Comment thread log/logtest/context.go Outdated
Comment on lines 50 to 55
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var function string
if len(frame.Function) != 0 {
if index := strings.LastIndex(frame.Function, "/"); index >= 0 {
function = frame.Function[index+1:]
}
}
function := filepath.Base(frame.Function)

@Iceber Iceber requested a review from mxpv March 22, 2021 03:15
@Iceber
Copy link
Copy Markdown
Member Author

Iceber commented Mar 22, 2021

/test CI / Linux Integration (io.containerd.runc.v1, runc) (pull_request)

@k8s-ci-robot
Copy link
Copy Markdown

@Iceber: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-containerd-build
  • /test pull-containerd-node-e2e

Use /test all to run all jobs.

Details

In response to this:

/test CI / Linux Integration (io.containerd.runc.v1, runc) (pull_request)

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.

Comment thread log/logtest/context.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure about this part. should we always add +1 ? or just keep it as is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just exclude the information, seems better to return "" than ???:1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it'll be :0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mxpv @dmcgowan updated, use the easiest way. PTAL

@dmcgowan dmcgowan merged commit d54225c into containerd:master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants