feat: Allow users to override the timeout#45
Open
shannmu wants to merge 1 commit intoassert-rs:mainfrom
Open
Conversation
epage
reviewed
Aug 29, 2024
src/lib.rs
Outdated
|
|
||
| /// Get the output from typing `input` into the shell | ||
| fn complete(&mut self, input: &str, term: &Term) -> std::io::Result<String>; | ||
| fn complete(&mut self, input: &str, term: &Term, timout: Duration) -> std::io::Result<String>; |
Contributor
There was a problem hiding this comment.
It seems like whether a timeout is needed or not is dependent on the needs of the individual runtime. Should this be a function on them instead?
epage
reviewed
Aug 29, 2024
crates/completest-pty/src/lib.rs
Outdated
| home: PathBuf, | ||
| config: PathBuf, | ||
| timeout: Duration, | ||
| _timeout: Duration, |
Contributor
There was a problem hiding this comment.
if we keep timeout on complete, why would we keep these timeouts?
Pull Request Test Coverage Report for Build 10631733090Details
💛 - Coveralls |
Contributor
|
Please update the name of the commit. A |
epage
reviewed
Aug 30, 2024
Comment on lines
+122
to
+131
| timeout: Duration, | ||
| ) -> std::io::Result<String> { | ||
| let mut command = Command::new("zsh"); | ||
| command.arg("--noglobalrcs"); | ||
| command | ||
| .env("PATH", &self.path) | ||
| .env("TERM", "xterm") | ||
| .env("ZDOTDIR", &self.home); | ||
| let echo = false; | ||
| comptest(command, echo, input, term, self.timeout) | ||
| comptest(command, echo, input, term, timeout) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a testing environment, exposing the timeout to users allows them to better configure their tests and avoid test failures caused by the built-in timeout being too short.