Skip to content
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

Collect logs from all containers and add log to test properties. #306

Merged
merged 6 commits into from
May 11, 2022

Conversation

wanlin31
Copy link
Collaborator

@wanlin31 wanlin31 commented Apr 21, 2022

This PR updated the infrastructure to save logs to file from all existing container which produces logs. We have also separate the property generation of name property and log properties to avoid dependencies.

We also add the log link to the Xunit reports when there are pod logs.

@wanlin31 wanlin31 force-pushed the update-logger-for-multiple-container branch from 259d61c to f3cf442 Compare April 21, 2022 17:12
@wanlin31 wanlin31 requested a review from paulosjca April 21, 2022 17:40
@wanlin31 wanlin31 self-assigned this Apr 21, 2022
@wanlin31 wanlin31 added the release notes: no Indicates that PR should not be in release notes label Apr 21, 2022
@wanlin31 wanlin31 marked this pull request as ready for review April 21, 2022 17:40
Copy link
Collaborator

@paulosjca paulosjca left a comment

Choose a reason for hiding this comment

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

I think we should collect logs for all containers. Later we should also add links to the logs to the properties stored in the xUnit report.

@wanlin31 wanlin31 changed the title Specify loggsaver in the runner to collect log from main container. Specify loggsaver in the runner to collect logs from all container. Apr 21, 2022
This commit specifies the container to collect the logs from when
there are more than one run contaienrs exit.
This commit updates the logics to save logs from all containers to
the original directory. The name of the logs follows the format:
pod-name-container-name.log. This commit also add log url to the
properties if the log url prefix is provided.
@wanlin31 wanlin31 force-pushed the update-logger-for-multiple-container branch from f3cf442 to 24fdf4d Compare April 25, 2022 22:10
@wanlin31 wanlin31 changed the title Specify loggsaver in the runner to collect logs from all container. Collect logs from all container and add log to test properties. Apr 25, 2022
@wanlin31 wanlin31 changed the title Collect logs from all container and add log to test properties. Collect logs from all containers and add log to test properties. Apr 25, 2022
@wanlin31 wanlin31 added release notes: yes Indicates that PR needs to be in release notes and removed release notes: no Indicates that PR should not be in release notes labels Apr 26, 2022
@wanlin31
Copy link
Collaborator Author

I think we should collect logs for all containers. Later we should also add links to the logs to the properties stored in the xUnit report.

Updated the pr per comment.

Verified by running experimental CI, details can be found in the bug. Also verified that not providing the log-url-prefix flag would not result in test failure.

tools/cmd/runner/main.go Outdated Show resolved Hide resolved
tools/cmd/runner/main.go Outdated Show resolved Hide resolved
tools/cmd/runner/main.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/runner.go Outdated Show resolved Hide resolved
@wanlin31 wanlin31 force-pushed the update-logger-for-multiple-container branch 3 times, most recently from 0c8bdc4 to ffe8a5e Compare April 29, 2022 22:12
@wanlin31 wanlin31 force-pushed the update-logger-for-multiple-container branch from ffe8a5e to 65ccbc9 Compare April 29, 2022 22:13
@wanlin31 wanlin31 requested a review from paulosjca April 29, 2022 22:29
Copy link
Collaborator

@paulosjca paulosjca left a comment

Choose a reason for hiding this comment

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

Remember to update the PR description.

tools/cmd/runner/main.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
tools/runner/runner.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
tools/runner/runner.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
tools/runner/properties.go Outdated Show resolved Hide resolved
@wanlin31 wanlin31 force-pushed the update-logger-for-multiple-container branch from ee5cef9 to 02bc620 Compare May 4, 2022 22:55
@wanlin31 wanlin31 force-pushed the update-logger-for-multiple-container branch from 02bc620 to a89bad8 Compare May 4, 2022 23:01
@wanlin31 wanlin31 requested a review from paulosjca May 5, 2022 16:08
tools/runner/client.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
tools/runner/logsaver.go Outdated Show resolved Hide resolved
@wanlin31 wanlin31 requested a review from paulosjca May 10, 2022 19:06
@wanlin31 wanlin31 merged commit 582ae93 into grpc:master May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: yes Indicates that PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants