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

Add functions for verbose and with context execution #11

Merged
merged 8 commits into from
Feb 14, 2024

Conversation

farshidtz
Copy link
Member

@farshidtz farshidtz commented Feb 8, 2024

Adding additional functions for verbose execution, as well as support for passing context (for early interruption).

@farshidtz
Copy link
Member Author

@locnnil please feel free to add more comments to the same branch for the remaining refactoring and test implementations.

@locnnil
Copy link
Contributor

locnnil commented Feb 8, 2024

@farshidtz Is there some specific reason to run the tests 100 times?

@farshidtz
Copy link
Member Author

@farshidtz Is there some specific reason to run the tests 100 times?

I remember we had a race condition which was causing a failure around 10-20% of the time. The Go's data race detector wasn't catching it either. I can't recall the specifics, but it should be recorded somewhere. We fixed the bug and continued running the tests that way.

utils/exec_test.go Outdated Show resolved Hide resolved
utils/exec_test.go Outdated Show resolved Hide resolved
utils/exec_test.go Outdated Show resolved Hide resolved
utils/exec_test.go Outdated Show resolved Hide resolved
utils/exec_test.go Outdated Show resolved Hide resolved
utils/exec_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@MonicaisHer MonicaisHer left a comment

Choose a reason for hiding this comment

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

Thank you, it looks good. I also tested the function for verbose execution, and stdout and stderr are now both shown in the testing logs as follow:

utils.ExecVerbose(t, "curl localhost:90)
exec.go:32: [exec] curl localhost:90
exec.go:118: [stderr]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
exec.go:118: [stderr]                                  Dload  Upload   Total   Spent    Left  Speed
exec.go:118: [stdout] <!DOCTYPE html>
exec.go:118: [stdout] <!--
exec.go:118: [stdout]   Copyright 2017 Openthread authors. All rights reserved.

@farshidtz farshidtz merged commit c15a6cd into main Feb 14, 2024
1 check passed
@farshidtz farshidtz deleted the exec-context-verbose branch February 14, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants