vic icon indicating copy to clipboard operation
vic copied to clipboard

WIP: Functions for processing PR options [skip ci]

Open hickeng opened this issue 7 years ago • 3 comments

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.

hickeng avatar Jun 17 '18 03:06 hickeng

Can we use their container to run these tests automatically via Drone?

zjs avatar Jun 18 '18 17:06 zjs

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.

zjs avatar Jul 03 '18 18:07 zjs

Should be moved to vmware/vic-tools.

zjs avatar Sep 10 '18 18:09 zjs