WahlNetwork / vester

Easily validate and remediate your vSphere configuration
https://wahlnetwork.com
Apache License 2.0
146 stars 45 forks source link

New Function: New-VesterTest #102

Open michaeltlombardi opened 7 years ago

michaeltlombardi commented 7 years ago

Add a public function to the module for creating the necessary skeleton file for a Vester Test.

Expected Behavior

As a user of the Vester module, I should be able to call a command to create the minimum necessary code for editing into a vester-functional test so that I don't have to copy existing tests over and edit them.

Current Behavior

Currently, users copy existing tests and modify them.

Possible Solution

Create a new function which provides the functionality and existing code style used by the project.

Context

This would make writing tests easier/faster for people and help standardize the boilerplate code without requiring people to hopefully copy things correctly.

Your Environment

brianbunke commented 7 years ago

This is really interesting. Not prioritizing right away, but you got the gears turning.

brianbunke commented 7 years ago

As @jeffgreenca mentioned in #106: https://github.com/jeffgreenca/Vester-TestGenerator would be a good jumping-off point to get started here.

jeffgreenca commented 7 years ago

Imagine an interactive tool that walks you through the normal test writing workflow, which for me is:

Menu could be something like:

[1] Update metadata (test name, description, variable format) [2] Create/Update Test code block [3] Create/Update Fix code block [4] Run your test [5] Run your test with Remediate [6] Submit your test to the Github Project

Where steps [4] and [5] automatically build a Config.json with your new test data, run your draft code with Inovke-Vester filtered to only your new test, and then loop back to the menu so you can update code or submit the result.

Some people may rather edit the code files directly, in which case they could still use the tool for initial creation from template, plus options 4 and 5.

Thoughts?

brianbunke commented 7 years ago

I mean... 😍

I should probably be explicit here: I personally won't get around to New-VesterTest anytime soon.

If this is something you're interested in writing, I'd say:

brianbunke commented 7 years ago

I'd like to drag @jpsider's work in issue #181 and PR #182 in here to help consolidate discussion.

I'll attempt to summarize, but feel free to clarify or add on:

Should New-VesterTest programmatically generate individual tests, considering that something like #184 would be the outcome? (Which kind of leads us toward #147 in an open-ended fashion...) Should it do that in addition to the iterative and interactive approach @jeffgreenca uses?

I suspect Jeff's use case is far more common for most, but #182 at least shows us an interesting option. Maybe we end up keeping it but renaming?

jpsider commented 7 years ago

What's sad/Interesting is that I thought I had read through the open issues thoroughly before submitting my issue and PR! Lol clearly I did not read enough!