Skip to content

Allow cats_config.yml and cats_config.yaml #146

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andreww
Copy link
Collaborator

@andreww andreww commented Jun 6, 2025

This change allows us to read configuration data from local files cats_config.yml, cats_config.yaml or config.yml. The first file found (in that order) is read and any others are ignored.

I've also updated the tests to check that this works which involved fun with fixtures. Having thought about it a bit more this could probably be cleaned up with a parameterisation but I'm not sure about extracting the parameter for the test in the fixture ... something for another day.

Still need to update the documentation to match and as well as cleanup in the tests, I'm pretty sure that config_from_file function could be simplified.

Fixes #145

This change allows us to read configuration data from local files
cats_config.yml, cats_config.yaml or config.yml. The first file
found (in that order) is read and any others are ignored.

I've also updated the tests to check that this works which involved
fun with fixtures. Having thought about it a bit more this could
probably be cleaned up with a parameterisation but I'm not sure
about extracting the parameter for the test in the fixture ...
something for another day.
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.80%. Comparing base (b31c56d) to head (11415c8).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
cats/configure.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   87.37%   87.80%   +0.43%     
==========================================
  Files          13       13              
  Lines         602      648      +46     
==========================================
+ Hits          526      569      +43     
- Misses         76       79       +3     

☔ View full report in Codecov by Sentry.
📢 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.

except FileNotFoundError:
logging.warning("CATS_CONFIG_FILE config file not found")
# if no path provided and no env variable, look for `config.yml` in current directory
config_file_names = ["cats_config.yml", "cats_config.yaml", "config.yml"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add config.yaml as well here?

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.

Potential filename clashes with config.yml
2 participants