You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SqlDatabaseObjectPermission: Unit tests throw error relating to incorrect use of 'Microsoft.Management.Infrastructure.CimInstance' with missing Where() method
#1648
Closed
SphenicPaul opened this issue
Dec 12, 2020
· 1 comment
· Fixed by #1649
Details of the scenario you tried and the problem that is occurring
Having forked and cloned the SqlServerDsc repository, and having attempted to run the unit tests (after no changes), there are 12 unit test failures within the DSC_SqlDatabaseObjectPermission.Tests.ps1, tests script, all giving the same failure...
Method invocation failed because [Microsoft.Management.Infrastructure.CimInstance] does not contain a method named 'Where'.
This seems a similar problem/issue as encountered in #1600
Verbose logs showing the problem
N/A
Suggested solution to the issue
Within the tests\Unit\DSC_SqlDatabaseObjectPermission.Tests.ps1 script, replace the references/usages of $comparedReturnValue.Actual.Where to $comparedReturnValue.Actual | Where-Object -FilterScript
The DSC configuration that is used to reproduce the issue (as detailed as possible)
N/A
SQL Server edition and version the target node is running
N/A
SQL Server PowerShell modules present on the target node
N/A
The operating system the target node is running
OsName : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture : 64-bit
WindowsVersion : 2004
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-GB
OsMuiLanguages : {en-GB}
Version and build of PowerShell the target node is running
I've raised PR #1649 that should hopefully resolve this - I've now been able to successfully run these unit tests locally (without error/failures) following these changes.
Details of the scenario you tried and the problem that is occurring
Having forked and cloned the
SqlServerDsc
repository, and having attempted to run the unit tests (after no changes), there are 12 unit test failures within theDSC_SqlDatabaseObjectPermission.Tests.ps1
, tests script, all giving the same failure...Method invocation failed because [Microsoft.Management.Infrastructure.CimInstance] does not contain a method named 'Where'.
This seems a similar problem/issue as encountered in #1600
Verbose logs showing the problem
N/A
Suggested solution to the issue
Within the
tests\Unit\DSC_SqlDatabaseObjectPermission.Tests.ps1
script, replace the references/usages of$comparedReturnValue.Actual.Where
to$comparedReturnValue.Actual | Where-Object -FilterScript
The DSC configuration that is used to reproduce the issue (as detailed as possible)
N/A
SQL Server edition and version the target node is running
N/A
SQL Server PowerShell modules present on the target node
N/A
The operating system the target node is running
OsName : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture : 64-bit
WindowsVersion : 2004
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-GB
OsMuiLanguages : {en-GB}
Version and build of PowerShell the target node is running
PSVersion 5.1.19041.610
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.610
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used
N/A
The text was updated successfully, but these errors were encountered: