-
Notifications
You must be signed in to change notification settings - Fork 359
Conversation
Tests that used to invoke methods on a `*expect.Console` instance now invoke same-named methods that have error handling built in so that the associated test is properly aborted if any of the methods happen to fail. This kind of error handling was easier to add than adding explicit error handling to every `c.Expect*()` and `c.Send*()` call site.
* Upgrade go-expect and associated libraries * Explicitly test with supported Go versions * Install a Go problem matcher * Have skipped tests show up as warnings in Actions annotations * Disable some flakey tests
This PR has now increased considerably in size since I've merged a nested PR that upgrades go-expect and associated libraries and marked a few tests as flakey. The test suite still fails intermittently, but I think this is progress towards a better test suite. I still cannot figure out some prompts are hanging and causing timeouts. So far, a lot of the tests intermittently failing (locally and on CI) are related to #327 |
Following this with a lot of interest. I don't have timeout issues as in this PR, but I have timing issues (Ubuntu 21.10 only as well) where I see duplicated output for confirm prompt : On Ubuntu I sometimes see this two lines with a confirm prompt :
On Mac OS it is always
My tests are setup exactly as in https://github.com/AlecAivazis/survey/blob/master/survey_posix_test.go#L15 |
The test fails with: select_test.go:209: SendLine("") = write /dev/ptmx: input/output error I cannot reproduce this failure on macOS locally. https://github.com/AlecAivazis/survey/runs/5222853435
@AlecAivazis This is now ready, although:
|
Sorry for lagging on this - changes look good to me! |
@AlecAivazis Thanks for the approval! I'm still unable to merge this PR due to |
yea no problem at all |
I tried to find the setting to make you an admin but couldn't locate it. do you know where that is by chance? |
@AlecAivazis Unfortunately, there is no way to add additional admins to a personal repository. |
@AlecAivazis You could perhaps remove the branch protection rules so it's easier for me to merge changes even if "required" changes are not passing. Sometimes there is a flaky test blocking the merge, even after all the work I've done in this PR :(( https://github.com/AlecAivazis/survey/runs/5479779404?check_suite_focus=true Also, if it's fine with you, I'd like to be able to merge my own PRs even without your approval, in case you are away for longer periods of time! 🙇 |
Ping @AlecAivazis ☝️ there are still PRs that I'm unable to merge due to the above |
Ah damn, sorry about that - fixing it now |
@mislav you should be good now |
@AlecAivazis Thanks; CI checks are not blocking me anymore. The review requirement is still blocking my own PRs, though. Example: #397 If you do not intend to review each one of my PRs in a timely manner, which is absolutely fine, you could consider removing the review requirement. I promise I won't be making outrageous or incompatible changes to the library. |
Whoops, i was hoping you would be able to be one of the people who could review it, but i guess not. I've lifted the requirement - let me know if there's anything else I need to do |
Currently, the test suite is flakey, impeding the merge of PRs due to intermittent failures of required jobs. Example: https://github.com/AlecAivazis/survey/runs/4952430024?check_suite_focus=true
I'm trying to track down the cause of flakes, but it's not easy due to a lot of them being caused by test suite timeouts (and thus, no specific test in particular). So I made a pass of strengthening error handling, particularly when it comes to tests:
golangci-lint
tool locally to find and address violations, mostly those were it pointed out that errors are not handled. In cases when we want to explicitly ignore the error, I use the_ = foo()
assignment.expect.Console
methods were never checked for error return values. I've made a light wrapper aroundexpect.Console
that transparently reports test failures for any error encountered. This is a step in ensuring that no test is broken and stuck on I/O until it times out.t.Helper()
calls to test helper functions so that they are excluded from being reported as a source of a test failure. We're more interested in where the failure originates in the test itself.