Skip to content

removing profiles automatically via buildtest config profiles remove#1585

Merged
shahzebsiddiqui merged 13 commits intobuildtesters:develfrom
kingxleyy:kingsley_buildtest
Aug 28, 2023
Merged

removing profiles automatically via buildtest config profiles remove#1585
shahzebsiddiqui merged 13 commits intobuildtesters:develfrom
kingxleyy:kingsley_buildtest

Conversation

@kingxleyy
Copy link
Collaborator

No description provided.

@kingxleyy kingxleyy linked an issue Aug 8, 2023 that may be closed by this pull request
8 tasks
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"
Copy link
Member

Choose a reason for hiding this comment

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

@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

@pytest.mark.cli
def test_config_profile_remove():
# buildtest config profiles remove
remove_profiles(configuration)
Copy link
Member

Choose a reason for hiding this comment

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

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.


@pytest.mark.cli
def test_config_profile_remove():
def remove_profiles(configuration, names):
Copy link
Member

Choose a reason for hiding this comment

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

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()

@pull-request-size pull-request-size bot added size/M and removed size/S labels Aug 25, 2023
@shahzebsiddiqui shahzebsiddiqui changed the title removing buildtest config profiles list removing profiles automatically via buildtest config profiles remove Aug 25, 2023
@pull-request-size pull-request-size bot added size/L and removed size/M labels Aug 28, 2023
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 48.28% and project coverage change: -0.08% ⚠️

Comparison is base (8033101) 78.24% compared to head (981cbd2) 78.16%.
Report is 43 commits behind head on devel.

❗ Current head 981cbd2 differs from pull request most recent head 1e2a451. Consider uploading reports for the commit 1e2a451 to get more accurate results

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     
Files Changed Coverage Δ
buildtest/executors/cobalt.py 21.51% <ø> (ø)
buildtest/executors/lsf.py 19.28% <0.00%> (ø)
buildtest/executors/pbs.py 21.43% <ø> (ø)
buildtest/cli/compilers.py 25.54% <7.41%> (-2.08%) ⬇️
buildtest/cli/config.py 86.46% <78.95%> (+6.71%) ⬆️
buildtest/cli/__init__.py 98.25% <100.00%> (+0.02%) ⬆️
buildtest/cli/show.py 100.00% <100.00%> (ø)
buildtest/executors/base.py 85.71% <100.00%> (+0.42%) ⬆️

... and 2 files with indirect coverage changes

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

@shahzebsiddiqui shahzebsiddiqui merged commit 63afa41 into buildtesters:devel Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: remove a profile via command line

2 participants