Add validation tests#63
Conversation
This covers cases that aren't easily tested with golden master tests.
These configurations can now be shared between different tests where appropriate.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 82.53% 85.80% +3.26%
==========================================
Files 27 27
Lines 979 979
==========================================
+ Hits 808 840 +32
+ Misses 171 139 -32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| def test_validate_test_build(tmp_path: Path, configs: Path) -> None: | ||
| # --test-build actually builds the modules into a temporary area and syntax-checks | ||
| # the generated shell entrypoints, so exercise it on a valid shell-only config. | ||
| run_cli( | ||
| "validate", | ||
| "--test-build", | ||
| "--from-scratch", | ||
| tmp_path, | ||
| configs / "valid" / "minimal", | ||
| ) |
There was a problem hiding this comment.
Should these tests which are supposed to build a valid deployment actually check that the module has been built? This test is only really checking that the command runs without raising any exceptions. It doesn't really validate that a valid module has been built
There was a problem hiding this comment.
There is now an explicit check (below this one) that tests the difference between the two flag options. The bash syntax check can only run on a created bash script with the --test-build flag.
The check that "a valid module has been built" is instead part of the golden master tests, but obviously this does not cover the test build.
There was a problem hiding this comment.
Yep, agree we dont want to overlap the golden master tests too much, happy with this
The test build happens in a temporary directory, so it isn't easy to check the files exist directly.
No description provided.