buildtest icon indicating copy to clipboard operation
buildtest copied to clipboard

[FEATURE]: buildtest buildspec find --buildspec-count

Open shahzebsiddiqui opened this issue 1 year ago • 1 comments

Please describe your feature request

This option buildtest buildspec find --buildspec-count can be used to report a count of total valid buildspecs.

(buildtest)  ~/Documents/github/buildtest/ [color_changes_buildtest_hy] buildtest bc summary
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                           │
│     Reading Buildspec Cache File:   /Users/siddiq90/Documents/github/buildtest/var/buildspecs/cache.json  │
│     Total Valid Buildspecs:         48                                                                    │
│     Total Invalid Buildspecs:       3                                                                     │
│     Total Unique Tags:              15                                                                    │
│     Total Maintainers:              3                                                                     │
│                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯

TODO

  • [ ] Add option --buildspec-count in https://github.com/buildtesters/buildtest/blob/devel/buildtest/cli/init.py
  • [ ] Implement Logic in https://github.com/buildtesters/buildtest/blob/devel/buildtest/cli/buildspec.py
  • [ ] Add option to bash completion script
  • [ ] Add regression test to verify option in https://github.com/buildtesters/buildtest/blob/devel/tests/cli/test_buildspec.py

Post question in Slack

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

Is there an existing issue

  • [X] I confirm there is no existing issue for this issue

shahzebsiddiqui avatar Sep 01 '22 15:09 shahzebsiddiqui

@jscook2345 this should be a relatively easy task as a first contribution to buildtest

shahzebsiddiqui avatar Sep 30 '22 19:09 shahzebsiddiqui

If you have a summary command, why do you want to add another command to do the same thing?

jscook2345 avatar Oct 27 '22 17:10 jscook2345

The output of buildtest buildspec summary will summarize the content of the buildspec cache and display several tables which can be quite long. This feature buildtest buildspec find --buildspec-count is basically giving a total count of valid buildspec which should report a raw number in this case the expected output should be 48 based on the output from buildtest buildspec summary.

This option would be useful to know how many buildspecs are valid for a given system without having to run buildtest buildspec summary and mainly used for reporting purposes, lets say an HPC site wants to know how many total tests are valid buildspecs they can just run this option to find out. I can foresee another option to query invalid buildspecs which can be used to find total count of invalid buildspecs.

shahzebsiddiqui avatar Oct 28 '22 15:10 shahzebsiddiqui