Repository navigation
Conversation
There was no kitchen.yml anywhere in the repo and nothing that ran the driver through Test Kitchen. The unit specs build the driver directly and stub the vmware-vra gem, which leaves a lot of code nobody runs: the plugin lookup that turns `name: vra` into this class, the config merging Test Kitchen does before the driver sees a value, required_config validation, the lazy defaults that need an instance to resolve, and every line of vmware-vra that turns a catalog request into HTTP and an HTTP response back into a Resource. spec/integration loads a real kitchen.yml with the real loader, takes the driver Test Kitchen hands back, and runs create, status and destroy against a vRA stubbed at the wire with WebMock -- which has been a development dependency all along without a single spec using it. 23 examples covering a successful build, a deployment that reports CREATE_INPROGRESS before it finishes, a deployment holding resources that are not machines, a blueprint that builds two, a machine vRA reports no address for, a failed request, a deployment destroyed behind our back, and one offering no Delete action. A vRA appliance cannot be stood up in a GitHub runner, but everything on this side of the socket can be, and now is, on every supported Ruby. Also: * kitchen.yml in the root, taking every setting from the environment, so a change can be tried against a real appliance with `kitchen test`. It verifies over the transport, so a green run means the deployment came up and Test Kitchen could log in to it. * A CI job running `kitchen list` and `kitchen diagnose --all`, which proves the gem is something the `kitchen` binary can find and load and that kitchen.yml is a config Test Kitchen accepts. Neither contacts vRA. * rake unit and rake integration, with rake test running both. * CONTRIBUTING gains what the two suites are for, and loses two wrong instructions: a spec path that does not exist, and a bare `cookstyle` that reports a hundred cookbook offenses on a gem. Signed-off-by: Tim Smith <tsmith84@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was no
kitchen.ymlanywhere in this repo and nothing that ran the driver through Test Kitchen at all. The unit specs build the driver directly and stub the vmware-vra gem, which leaves a lot of code nobody runs: the plugin lookup that turnsname: vrainto this class, the config merging Test Kitchen does before the driver ever sees a value,required_configvalidation, the lazy defaults that need an instance to resolve, and every line of vmware-vra that turns a catalog request into HTTP and an HTTP response back into aResource.spec/integration
Loads a real
kitchen.ymlwith the real loader, takes the driver Test Kitchen hands back, and runscreate,statusanddestroyagainst a vRA stubbed at the wire with WebMock — which has been a development dependency all along without a single spec using it.23 examples, covering a successful build, a deployment that reports
CREATE_INPROGRESSbefore it finishes, a deployment holding resources that are not machines, a blueprint that builds two, a machine vRA reports no address for, a failed request, a deployment destroyed behind our back, and one offering no Delete action.A vRA appliance cannot be stood up in a GitHub runner, but everything on this side of the socket can be, and now is, on every supported Ruby.
The rest
kitchen.ymlin the root, taking every setting from the environment so no site details or credentials land in the repo. It verifies over the transport, so a greenkitchen testmeans the deployment came up and Test Kitchen could log in to it — which is the whole of what this driver is responsible for.kitchen listandkitchen diagnose --all. That proves the gem is something thekitchenbinary can find and load, thatname: vraresolves to this driver, and thatkitchen.ymlis a config Test Kitchen accepts. Neither command contacts vRA.rake unitandrake integration, withrake testrunning both — so the shared lint-unit workflow picks up the integration specs with no change on its side.spec/kitchen/driver/vra_spec.rb), and a barecookstylethat reports a hundred cookbook offenses on a gem.bundle exec cookstyle --chefstyle,bundle exec rake test(55 unit + 23 integration), yamllint and markdownlint all pass.