You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ConfigReader is one of the most critical components of Sceptre. However, it's unit tests are loaded with patches and seem to have been largely copied and pasted over and over again. There are even patches covering internal private methods within the ConfigReader. Furthermore, there is reliance upon existing files in the file system, which can make for odd behavior in tests and relies upon the working directory when running tests to be set to the root directory.
We really could use a new, refactored suite of tests on the ConfigReader that provide better coverage, better maintainability, and better readability without relying so heavily on patching.
We should make good use of tools and patterns such as:
Dependency injection (might require some slight modifications to reader code itself to make this possible)
Fake filesystems when needing to simulate files (e.g. pyfakefs)
The end result of this refactoring should be a series of concise, well-named tests that generally have a single assertion per test.
The text was updated successfully, but these errors were encountered:
For the record, I'd be willing to help anyone who picks this up by consulting them on what sorts of things ought to be tested and good unit test practices and such, if they would like it.
The ConfigReader is one of the most critical components of Sceptre. However, it's unit tests are loaded with patches and seem to have been largely copied and pasted over and over again. There are even patches covering internal private methods within the ConfigReader. Furthermore, there is reliance upon existing files in the file system, which can make for odd behavior in tests and relies upon the working directory when running tests to be set to the root directory.
We really could use a new, refactored suite of tests on the ConfigReader that provide better coverage, better maintainability, and better readability without relying so heavily on patching.
We should make good use of tools and patterns such as:
The end result of this refactoring should be a series of concise, well-named tests that generally have a single assertion per test.
The text was updated successfully, but these errors were encountered: