EvotecIT / Testimo

Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests
MIT License
519 stars 55 forks source link

Results meet expected values, but test listed as failure in 0.0.79 #165

Closed decopaper closed 2 years ago

decopaper commented 2 years ago

After upgrading to 0.0.79 (from 0.0.78), several tests are now failing, even though the Found value meets the testing criteria.

For example:

Expected value (Less Or Equal): 4000, Found value: 469.07 Expected value (Less Than): 7/7/2022 4:01:19 AM, Found value: 1/3/2022 6:02:33 AM Expected value (Less Or Equal): 0, Found value: -184

This change... https://github.com/EvotecIT/Testimo/blob/6a070fb6d4cef011266e24f4e7bc358da1376b61/Private/Test-StepTwo.ps1#L43-L45

...causes the following tests (which use ExpectedValue instead of ExpectedCount) to fail in certain cases because they're being compared as strings instead of their native types: https://github.com/EvotecIT/Testimo/blob/4c40f9843ddba41e24383f461288fa0109760ae7/Private/SourcesDomainControllers/Ldap.ps1#L108-L121 https://github.com/EvotecIT/Testimo/blob/4c40f9843ddba41e24383f461288fa0109760ae7/Private/SourcesDomainControllers/Ldap.ps1#L136-L149 https://github.com/EvotecIT/Testimo/blob/4c40f9843ddba41e24383f461288fa0109760ae7/Private/SourcesDomainControllers/EventLogs.ps1#L113-L122

All of them have basetypes of ValueType:

> (Get-Date).GetType().BaseType.Name
ValueType
> $asdf = -184; $asdf.GetType().BaseType.Name
ValueType
> $asdf = 469.07; $asdf.GetType().BaseType.Name
ValueType

There may be more tests with this issue, they're just not failing in my environment.

PrzemyslawKlys commented 2 years ago

My bad.