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

OSOE-464: Making dotnet test output go to the build output to aid debugging, as well as printing ITestOutputHelper content #101

Merged
merged 43 commits into from
Nov 16, 2022

Conversation

Piedone
Copy link
Member

@Piedone Piedone commented Nov 12, 2022

# Conflicts:
#	.github/workflows/build-and-test-orchard-core.yml

if ($needsGrouping) { Write-Output "::group::Test Failed: $test" }

bash -c "cat test.out | grep -v 'Connection refused \[::ffff:127.0.0.1\]' | grep -v 'ChromeDriver was started successfully'"
Copy link
Member

Choose a reason for hiding this comment

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

Could we still filter out these pointless "Connection refused" and "ChromeDriver" log lines on dotnet test @dotnetTestSwitches?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know or have found a way to live-filter a streaming output, though I only have smallish experience with PS.

The goal here is for the output of the tests to show up in the log continuously (to pinpoint what the last thing was before the runner was killed due to timeout). If there's a file at the end of the dotnet test call then you can grep like this, but we can't wait for a file.

We could still redirect to a file and tail it and that can be filtered but going through a file doesn't seem like the best idea, and we also need to somehow know when the stream actually ended and quit the Wait.

So, I don't know. It seems to me that implementing grouping around the test project if it doesn't have its custom group and letting UI tests group themselves, as well as filtering out such messages need a file. If we have a file, however, we won't have a continuous output.

Do you have any suggestions by chance?

BTW I'm also trying to figure out where the annoying log messages come from and disable them in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

dotnet test @dotnetTestSwitches 2>&1 | ? { $_ -notlike '*Connection refused [[]::ffff:127.0.0.1[]]*' -and $_ -notlike '*ChromeDriver was started successfully*' } should filter it line-by-line as it's passed to the pipe. We can live without the outer grouping until they finally add named groups to the runner.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah nice, so this works like this!

Comment on lines +6 to +10
# Cancelling the workflow in a post-script (like this:
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost; can also be done with
# this action: https://github.com/webiny/action-post-run, see Git history of this file) wouldn't help the status, it
# would still be cancelled. It actually indeed is, but it would be nicer to set it to failed, but there seems to be no
# way to do this.
Copy link
Member Author

Choose a reason for hiding this comment

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

I had some fun experimenting around with this without avail.

But at least I had fun.

image

@sarahelsaig sarahelsaig merged commit 6b7b275 into dev Nov 16, 2022
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.

2 participants