DscResources icon indicating copy to clipboard operation
DscResources copied to clipboard

DSCResource.Tests not running on first call to invoke-pester

Open mbreakey3 opened this issue 9 years ago • 2 comments

If a user downloads a module and then runs invoke-pester, right now the test template is set up to clone DSCResource.Tests into the module where the tests are being run. While the module is successfully being cloned into the module, those common tests will not be run on that first invoke-pester. I think this has to do with how Pester sets up the tests ahead of time before running them and since they're cloned afterwards, they get ignored. Once DSCResource.Tests exists in the module, the tests run smoothly with everything else. It seems this bug hasn't been caught before because when pester is run through appVeyor, the tests are cloned in the appveyor.yml file before pester is run.

mbreakey3 avatar Jun 06 '16 22:06 mbreakey3

@mbreakey3 Not sure how to resolve this. Only option I'm seeing is a guideline how the user get DscResource.Tests downloaded before invoking Invoke-Pester. Would that work?

There are unit tests in DscResource.Tests that tests the test framework which will also run, and the Meta.Tests.ps1 are just tests to verify code compliance against style guideline and best practices. There are no resource specific unit or integration tests in DscResource.Tests. I my though is that they are used to make sure a PR has gone through the "basic" tests (style guideline and best practices).

johlju avatar Apr 17 '18 07:04 johlju

@johlju -Fixing this issue isn't too high on the priority list so I think a guideline would be fine for now.

mbreakey3 avatar Apr 17 '18 14:04 mbreakey3