removing profiles automatically via buildtest config profiles remove#1585
removing profiles automatically via buildtest config profiles remove#1585shahzebsiddiqui merged 13 commits intobuildtesters:develfrom
Conversation
buildtest/cli/__init__.py
Outdated
| subparsers_config.add_parser("systems", help="List all available systems") | ||
| #buildtest config profile remove | ||
| subparsers_profile_list.add_argument( | ||
| "-y", "--yaml", "rm", "remove", action="store_true", help="List Profile details in YAML Format" |
There was a problem hiding this comment.
@kingxleyy this is not correct. Please refer to add_argument library for reference you can't pass multiple arguments.
Please remove rm and remove. These need to be a subparser similar to list where you can create a command buildtest config profiles remove.
This command should accept a positional argument that is the name of profile so if you want to delete a profile name python you can do
buildtest config profiles rm python
It should technically work with multiple arguments where you can remove two profiles (profile1, profile2)
buildtest config profiles rm profile1 profile2
tests/cli/test_config.py
Outdated
| @pytest.mark.cli | ||
| def test_config_profile_remove(): | ||
| # buildtest config profiles remove | ||
| remove_profiles(configuration) |
There was a problem hiding this comment.
You will want to create a dummy profile first before removing it. The remove_profiles should take an input profile.
The method signature should be something like
def remove_profiles(configuration, names)
The names should be a list of profile names to remove.
Basically you will want to do a for loop over all profiles and remove them from the configuration if they are found.
tests/cli/test_config.py
Outdated
|
|
||
| @pytest.mark.cli | ||
| def test_config_profile_remove(): | ||
| def remove_profiles(configuration, names): |
There was a problem hiding this comment.
This is a regression test method it needs to start with test_ so name it test_profiles_remove.
Remove the arguments it should simply be
def test_profiles_remove()fbba707 to
c8187c5
Compare
…gument to accept one or more profile name to remove. add alias command 'rm'
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## devel #1585 +/- ##
==========================================
- Coverage 78.24% 78.16% -0.08%
==========================================
Files 57 57
Lines 6608 6653 +45
==========================================
+ Hits 5170 5200 +30
- Misses 1438 1453 +15
☔ View full report in Codecov by Sentry. |
No description provided.