vester icon indicating copy to clipboard operation
vester copied to clipboard

New Function: New-VesterTest

Open michaeltlombardi opened this issue 7 years ago • 6 comments

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

  • Module version used: Vester 1.0.1
  • Operating System: Windows 10.0.14393
  • PowerShell version: 5.1.14393.693

michaeltlombardi avatar Mar 17 '17 15:03 michaeltlombardi

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

brianbunke avatar Mar 17 '17 17:03 brianbunke

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

brianbunke avatar Mar 18 '17 15:03 brianbunke

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

  • Run adhoc cmdlets until I know how to manage the setting I am trying to configure
  • Copy code template and fill out initial test name, description, data type, etc.
  • Draft an initial Test block
  • Try it out, tweak until it works
  • Draft an initial Fix block
  • Try it out, tweak until it works

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?

jeffgreenca avatar Sep 13 '17 16:09 jeffgreenca

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:

  • That idea sounds great
  • I would be ecstatic if anyone contributed this
  • and I'm happy to help with questions along the way, if needed!

brianbunke avatar Sep 20 '17 04:09 brianbunke

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?

brianbunke avatar Sep 26 '17 04:09 brianbunke

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!

jpsider avatar Sep 26 '17 10:09 jpsider