-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Possible to test long time processing CLI actions? #1159
Comments
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Closing this as it has become stale. |
@koddr Does the CreateCLIAction use any functions from cli.Context ? |
@meatballhat Are we planning to have context as an interface in v3 ? |
@koddr There is nothing in the cli library that enforces any time limits or anything. So the command will run till the action function returns. If you are starting your cli app from the shell you can run it in the background and run your next cli app invocation. |
my question is...
Possible to test long time processing CLI actions?
I develop CLI for aggregation of all
create-<NAME>-app
and similar frontend things. Very often the execution of such a command (e.g. installation of dependencies bynpm install
) takes a very long time and exits the tests (e.g. ongocover.io
or locally). That is, they're out of 30 or even 180 seconds limit.This is my project source (without some extra lines of code):
Next, I separated a new CLI instance to
./pkg/mycmd/new.go
file:Action func lives here:
And my question is... how can I test
CreateCLIAction(c *cli.Context)
func on right (recommended) way and without waiting so long time to executenpm
things? Usage example to explain this moment, would be great! 😉Thanks!
The text was updated successfully, but these errors were encountered: