Skip to content

[FEATURE]: build buildspecs by test name #1438

@shahzebsiddiqui

Description

@shahzebsiddiqui

Please describe your feature

It would be nice if we can build tests by test name which can be useful if one wants to run a particular test instead of running the buildspec or all the test. This can be useful when fixing a failed test and not having to worry about where the buildspec is though you will most likely be updating the buildspec via editor and just run buildtest bd -b on the file.

We can see all test names in buildspec cache via buildtest bc find --format name --terse and likewise user can show the content of any test via buildtest bc show with tab completion.

Suggest potential solution

I would propose we add a new option buildtest bd -n with long option --name where one select the name of test. This will be tab-completed with list of test names that is buildtest bc find --format name --terse.

So with this one can do something like buildtest bd -n foo_bar -n shell_options to run multiple tests

At the moment we dont have such feature if it were present this is somewhat equivalent to filtering a buildspec by the test name buildtest bd -b file.yml --filter name=foo_bar though we dont have such filter based on name its only the following filters

(buildtest)  ~/Documents/github/buildtest/ [remove_codecov_from_deps] buildtest bd --helpfilter                           
                 Buildtest Filters                  
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Field       ┃ Description                        ┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ tags        │ Filter tests by 'tag' field        │
│ type        │ Filter test by 'type' field        │
│ maintainers │ Filter test by 'maintainers' field │

Additional Information

In the event of exclusion i think we should apply the exclusion after detection of tests in the circumstance one does the following where test foo_bar is defined in foo.yml then this should not run

buildtest bd -n foo_bar -x foo.yml

Similarly with feature #1437 we should apply exclusion by tags after detecting the tests.

Post question in Slack

  • I agree that I posted my question in slack before creating this issue

Is there an existing issue

  • I confirm there is no existing issue for this issue

Metadata

Metadata

Labels

new featureNew Feature in buildtest such as command line or improvement to buildspec

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions