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

Force TTY mode for integration test logs #549

Merged
merged 3 commits into from Mar 8, 2022

Conversation

pudelkoM
Copy link
Member

@pudelkoM pudelkoM commented Mar 7, 2022

This will force printing the timestamp, calling function and colors on local runs.
Since test output is not collected by any monitoring system, we can use a more human readable format.

This only affects local runs, GHA already attach a TTY.

Print the timestamp, calling function and use colors. Test output is not collected by any monitoring system, therefor we can use a more human readable format.
@pudelkoM pudelkoM requested a review from osinstom March 7, 2022 20:05
@pudelkoM pudelkoM changed the title Improve clarity of integration test logs Force TTY mode for integration test logs Mar 7, 2022
@pudelkoM
Copy link
Member Author

pudelkoM commented Mar 8, 2022

Some more testing made me confident that it's not a local issue:

docker run -it --rm -v $(pwd):$(pwd) -w $(pwd) golang
make test-bess-integration-native

without these changes results in the usual kv format:

time="2022-03-08T19:58:29Z" level=info msg="Removed connection to 127.0.0.1:48185"
time="2022-03-08T19:58:29Z" level=info msg="Done waiting for PFCPConn completions"
time="2022-03-08T19:58:29Z" level=info msg="Exit function Bess"
time="2022-03-08T19:58:29Z" level=info msg="Shutdown complete for 127.0.0.1:48185"
time="2022-03-08T19:58:29Z" level=info msg="Shutdown complete"

with the changes, it looks like this:

INFO[2022-03-08T20:00:14Z]/home/max/upf-epc/pfcpiface/node.go:145 github.com/omec-project/upf-epc/pfcpiface.(*PFCPNode).Serve() Removed connection to 127.0.0.1:40306
INFO[2022-03-08T20:00:14Z]/home/max/upf-epc/pfcpiface/node.go:149 github.com/omec-project/upf-epc/pfcpiface.(*PFCPNode).Serve() Done waiting for PFCPConn completions
INFO[2022-03-08T20:00:14Z]/home/max/upf-epc/pfcpiface/bess.go:193 github.com/omec-project/upf-epc/pfcpiface.(*bess).exit() Exit function Bess
INFO[2022-03-08T20:00:14Z]/home/max/upf-epc/pfcpiface/node.go:170 github.com/omec-project/upf-epc/pfcpiface.(*PFCPNode).Done() Shutdown complete

In logrus, having colors enabled changes the output format: sirupsen/logrus#1194

@pudelkoM pudelkoM merged commit 43c848b into master Mar 8, 2022
@pudelkoM pudelkoM deleted the integration-tests-log-format branch March 8, 2022 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants