Skip to content
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

project keyword improvements in config.yml #232

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

abhaasgoyal
Copy link

@abhaasgoyal abhaasgoyal commented Jan 18, 2024

Fixes #231 , #246

Merge Message

  • In case the user provides the project keyword, use the corresponding value as ID, otherwise use $PROJECT.
  • Added skippable tests for validating against existing project groups.
  • Modularized test cases for config module.

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (5b6c6fa) 59.13% compared to head (e3f1f9e) 59.65%.
Report is 8 commits behind head on main.

Files Patch % Lines
tests/test_benchcab.py 59.25% 11 Missing ⚠️
benchcab/benchcab.py 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
+ Coverage   59.13%   59.65%   +0.51%     
==========================================
  Files          29       30       +1     
  Lines        2129     2191      +62     
==========================================
+ Hits         1259     1307      +48     
- Misses        870      884      +14     

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

@abhaasgoyal
Copy link
Author

abhaasgoyal commented Jan 25, 2024

@ccarouge @SeanBryan51 right now the CI test is failing due to not having $PROJECT. I was wondering about how to go about this in terms of best practices of writing unit tests:

  1. Unit tests should be independent of environment variable -> So in the unit test itself I could add a condition that if it's run on Gadi, only then look for existing $PROJECT, else define it on os.environ before running the test function
  2. I could add an environment variable in Github for actions, but that would mean that any machine would need to define $PROJECT first, or define project in every config.yaml
  3. Use a fallback project by default, providing user with different messages on verbose on whether it's using the Gadi machine or not (could define the environment variable in __init__.py)

@abhaasgoyal
Copy link
Author

Ok so for now I've created a mock test environment variable within the test-config module using monkeypatch. This will clear out all environment variables and reset $PROJECT before running each test.

@abhaasgoyal abhaasgoyal changed the title DRAFT: Make project keyword optional in config.yml Make project keyword optional in config.yml Jan 29, 2024
@abhaasgoyal abhaasgoyal changed the title Make project keyword optional in config.yml Improvements to project keyword in config.yml Jan 29, 2024
@abhaasgoyal abhaasgoyal changed the title Improvements to project keyword in config.yml project keyword improvements in config.yml Jan 29, 2024
@abhaasgoyal abhaasgoyal marked this pull request as draft January 29, 2024 11:42
@abhaasgoyal abhaasgoyal linked an issue Jan 29, 2024 that may be closed by this pull request
@abhaasgoyal abhaasgoyal force-pushed the 231-optional-project-keyword-config branch from 9daf322 to 3ec5d15 Compare January 30, 2024 03:11
@abhaasgoyal abhaasgoyal marked this pull request as ready for review January 31, 2024 04:40
@abhaasgoyal abhaasgoyal requested review from ccarouge and removed request for SeanBryan51 January 31, 2024 04:47
Copy link
Collaborator

@ccarouge ccarouge left a comment

Choose a reason for hiding this comment

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

I'm not approving simply because I have a question about the ordering of the validation and setting the default values of optional keys.

The other changes are quite simple.

docs/user_guide/config_options.md Outdated Show resolved Hide resolved
benchcab/internal.py Outdated Show resolved Hide resolved
benchcab/config.py Outdated Show resolved Hide resolved
tests/test_config.py Outdated Show resolved Hide resolved
@abhaasgoyal abhaasgoyal force-pushed the 231-optional-project-keyword-config branch 3 times, most recently from 28779b5 to 45630e8 Compare February 2, 2024 01:40
Make `project` keyword optional in `config.yml`

Improve documentation for config

Move checks for optional project keyword, add documentation and tests

Add tests for optional project key

Remove comment for adding validation checks for project and move to another issue
@abhaasgoyal abhaasgoyal force-pushed the 231-optional-project-keyword-config branch from 45630e8 to e3f1f9e Compare February 2, 2024 01:44
Copy link
Collaborator

@ccarouge ccarouge left a comment

Choose a reason for hiding this comment

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

All good.

@abhaasgoyal abhaasgoyal merged commit 2dfc9f8 into main Feb 7, 2024
5 checks passed
@abhaasgoyal abhaasgoyal deleted the 231-optional-project-keyword-config branch February 7, 2024 12:26
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.

Make project keyword optional in config.yml
2 participants