marcingminski / sqlwatch

SQL Server Performance Monitor
https://docs.sqlwatch.io
Other
428 stars 168 forks source link

I need a guidance on how to use Pester correctly #353

Closed marcingminski closed 3 years ago

marcingminski commented 3 years ago

Pester documentation says we should not be running any arbitrary code in either Describe, Context or It blocks but how would we then construct the test as some have dependencies? For example, if no Availability Group defined that we should not falling if there is no data in AG tables so in the Describe block, we must run a check for that.

Discovery now takes ~90 seconds even if for a single tag (describe). I suspect that's because it is running all the arbitrary code whilst its discovering?

marcingminski commented 3 years ago

I may have gotten it sorted. The code is in the repo.

marcingminski commented 3 years ago

Well it works quite well now so whether its "correctly" or not it does not matter :)