Skip to content

Add command behaviour tests#60

Open
MJGaughran wants to merge 29 commits into
improve-golden-master-testsfrom
add-command-behaviour-tests
Open

Add command behaviour tests#60
MJGaughran wants to merge 29 commits into
improve-golden-master-testsfrom
add-command-behaviour-tests

Conversation

@MJGaughran

@MJGaughran MJGaughran commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

These test the parts of functionality that are not adequately covered by the golden master tests, such as errors.

Code changes are added for:

  • Consistency in error handling
  • Removal of dead code (to identify coverage issues, indicated with comments)
  • Changed from_scratch -> allow_all in a function where original naming was incorrect

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.48%. Comparing base (22028aa) to head (df673cc).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           improve-golden-master-tests      #60       +/-   ##
================================================================
+ Coverage                        83.59%   99.48%   +15.89%     
================================================================
  Files                               27       27               
  Lines                              957      977       +20     
================================================================
+ Hits                               800      972      +172     
+ Misses                             157        5      -152     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

DEFAULT_VERSION_FILENAME = ".version"

DEPLOYMENT_SNAPSHOT_FILENAME = "deployment.yaml"
PREVIOUS_DEPLOYMENT_SNAPSHOT_FILENAME = "previous-deployment.yaml"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code (now uses git refs)


It should be the Module's name and version as /<config_folder>/<name>/<version>.yaml
"""
if version_path.is_dir() and version_path.suffix == YAML_FILE_SUFFIX:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code as _load_release() already checks if path.is_dir()

@MJGaughran MJGaughran force-pushed the add-command-behaviour-tests branch from e346540 to 5730578 Compare June 30, 2026 14:10
This covers cases that aren't easily tested with golden master tests.
Tests relating to non-existent output dir use the compare function as
otherwise the Typer configuration prevents the exception being raised.
This feature was replaced with the git ref option to the compare
command.
@MJGaughran MJGaughran force-pushed the add-command-behaviour-tests branch from 5730578 to df673cc Compare June 30, 2026 15:56
@MJGaughran MJGaughran changed the title Draft: Add command behaviour tests Add command behaviour tests Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant