-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: fix flaky
verdi daemon start
command tests
The `verdi daemon start` command tests that define a specific number of workers, either through a CLI option or through the config, were flaky and failing. The probably cause was that the tests were changing the configuration during the test, which was changing the actual configuration and changes were not undone after the tests. These changes can therefore interfere with other tests. To fix it, the tests are converted to `pytest` style and the tests that manipulate the config use a new fixture that creates a clone of the config before running the test and making sure to restore the original config after the test was done. In addition, it monkeypatches the `Config` class to make sure it doesn't write backups to disk when it is changed which is the default behavior but is not desirable during testing. Finally, a test is added for `verdi daemon status`. It had been broken due to a recent refactor in the CLI logging code but went unnoticed since it is not tested. The actual bug was fixed in the previous commit.
- Loading branch information
Showing
4 changed files
with
128 additions
and
132 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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