pester / Pester

Pester is the ubiquitous test and mock framework for PowerShell.
https://pester.dev/
Other
3.09k stars 470 forks source link

Add a new repository for generic tests #523

Closed nohwnd closed 7 years ago

nohwnd commented 8 years ago

I've been asked by @juneb if I could create a sub-repository in the Pester organisation that would hold generic tests that people can take and reuse. One example would be her module help tests that can be reused on any module. Also I saw a similar idea shared on twitter today. The idea is to share generic infrastructure tests that would span as much vendors as possible.

I very much like the idea of bringing tests closer to the framework. But I would like to get some further information, to get the feeling of what people expect from this.

So please share your thoughts on those topics, and anything else that comes to your mind:

rdtechie commented 8 years ago

Great initiative. Here are some of my thoughts:

( ps: I registered pestertesting.com, I'm happy to hand it over to you if you want to ).

vors commented 8 years ago

I think it's a great idea.

  1. DscResource.Tests has the same spirit. This example can provide some insights about distribution model and related challenges.
  2. I personally would love to see "Git"-related tests
    • any project that uses Git would benefit from using consistent tabs, encoding and enforcing "new line" at the end-of-file.
    • examples of such tests is here, here, as you see, it's just a bunch of duplication.
    • the value come from the predictable diffs, hence better history. I.e. PR that accidentally change tabulation would be automatically marked as failed, because test would fail.
kilasuit commented 8 years ago

I'm about to post a blog post (& also a module to the gallery) on my method to build a set of dynamically built generic basic pester tests for existing/old modules that helps me move away from massive psm1 files into a file structure that is easier to work with going forward i.e seperate ps1 files for each function.

Happy to push the examples to a SubRepo if that is a better suggestion from the community

DexterPOSH commented 8 years ago

Agree with @rdtechie, These tests should serve as a template for people to start with and then tailored for their own needs. Can the OVF format for tests be extended here where the generic tests go into simple and more specific test cases fall under Comprehensive ?

irwins commented 8 years ago

Remember the portable script center? A setup like that would be a great starting point. Back in my vbs days this was my goto repository. Like @DexterPOSH said it's a template, much like the script center combine and tailor to your needs!

juneb commented 8 years ago

@irwins What is a portable script center? Sorry, not familiar, but I'm very intrigued.

juneb commented 8 years ago

Discovery might be a challenge. I'll help to write/edit the ReadMe.md. Can we require that everyone who submits a .Tests. file add an entry to a list of tests with a link and a short description. Can we tag them in categories? Or, is this a job for PSGallery?

irwins commented 8 years ago

@juneb The Portable script center was a chm file back when vbs was mainstream. I rather much like the setup of the file. Here's a link to the current gallery: https://gallery.technet.microsoft.com/scriptcenter.

Categories & Tags will be helpful

irwins commented 8 years ago

image

Just an idea how we could categories...

equelin commented 8 years ago

I already have tests written for VMware vSphere infrastructures. I would be happy to share them here !

it-praktyk commented 8 years ago

I like this idea.

Especially for more specific modules/applications tests examples (e.g. Exchange) are very limited and/or dispersed.

devblackops commented 8 years ago

Having a good set of reference tests (distributed as modules on PS Gallery) would be fantastic.

These could serve as simple smoke tests for your core infrastructure services. I think of them as a subset of the tests found in the OpsMgr management packs. Bonus points if the Pester tests are written so users can plugin the parameters for their environment to override the defaults. This would be similar to parameter overrides in OpsMgr.

jonconley commented 8 years ago

Is this still moving along and/or is any assistance needed? I've previously used powershell with vCheck to add several third party plugins for checks and reporting.

Would be glad to get that moved over to a standard pester/OVF format.

dlwyatt commented 8 years ago

I believe @nohwnd set up the new repo recently, though it doesn't have much happening yet. :) https://github.com/pester/Test-library

it-praktyk commented 8 years ago

The first pull request Pester/test-library#3 opened :-)

it-praktyk commented 7 years ago

Based on a lack of responses (the one pull request did by myself - https://github.com/pester/Test-library/pull/3) to Pester/Test-library I declare that the idea is dead and close the current issue.

@nohwnd, can you consider removing the Pester/Test-library?

nohwnd commented 7 years ago

@it-praktyk yeah, that kinda sparked up and died (and I am to blame, at least a bit). Hopefully we can re-visit the idea somewhere in the future. I'll remove the repo.