vic
vic copied to clipboard
WIP: Functions for processing PR options [skip ci]
This adds utility functions and unit tests for processing of options embedded in the body of a pull request.
This needs: a. addition of inline single option processing (e.g. parallel-jobs) b. integration-test.sh updating to use them c. figuring out where the scripts should live
Tests requires bats installed: github.com/bats-core/bats-core:
infra/scripts/test$ bats pull-request-options.bats
✓ get pr body from github
✓ get directives - single enabled set
✓ get directives - single disabled set
✓ get directives - multiple enabled, single disabled
✓ get directives - single with parameters
✓ get parameters - get parameters for single directive
✓ get parameters - get parameters for multiple directives
- multiple occurrances - last wins (skipped)
- multiple occurrances - with params and without (skipped)
9 tests, 0 failures, 2 skipped
infra/scripts/test$
TODO:
- [ ] last wins - I've changed my mind on this to be "combined" instead. That allows someone to have distinct sets of tests under the same directive that they can enable/disable.
- [ ] validate pull request template - template includes all directives, and does not include unknown directives.
Can we use their container to run these tests automatically via Drone?
Currently, if you have a typo in the value of a specific ci directive (e.g., [specific ci=Group23-VIC-Machine-Server] instead of [specific ci=Group23-VIC-Machine-Service]), the tests are not run and no error is reported.
This seems like something which could be fixed as a part of this work.
Should be moved to vmware/vic-tools.