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
Details of the scenario you tried and the problem that is occurring
Tests in 'Tests\Integration\MSFT_xScriptResource.Integration.Tests.ps1' currently fail when run from outside of AppVeyor. These tests should be adjusted to run on any supported system.
Verbose logs showing the problem
Executing script C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\Tests\Integration\MSFT_xScriptResource.Integration.Tests.ps1
WARNING: There is no operation running currently. Stop will return without any action.
Describing xScript Integration Tests
Context Get, set, and test scripts specified and Credential not specified
[+] Should have removed test file before config runs 2ms
[+] Should compile and apply the MOF without throwing 428ms
[+] Should have created the test file 2ms
[+] Should have set file content correctly 4ms
Context Get, set, and test scripts specified and Credential specified
[-] Error occurred in Context block 0ms
COMException: The group name could not be found.
ExtendedTypeSystemException: The following exception occurred while retrieving member "SetPassword": "The group name could not be found.
"
at Get-AppVeyorAdministratorCredential, C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\Tests\CommonTestHelper.psm1: line 685
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\Tests\Integration\MSFT_xScriptResource.Integration.Tests.ps1: line 96
at DescribeImpl, C:\Program Files\WindowsPowerShell\Modules\Pester\4.7.1\Functions\Describe.ps1: line 199
WARNING: There is no operation running currently. Stop will return without any action.
I'm willing to work on this one (and the other AppVeyor related issues I opened), but would like to discuss what the best approach to this is. It seems that multiple Tests rely on using admin credentials and knowing the password. Part of this assumes that the tests are running on AppVeyor, which implies a known administrator account name. So the tests go in and randomly change the password on this account, and then create a credential object using that randomly generated password. There's a few problems with this:
It relies on running on AppVeyor
It relies on a known Administrator account name (which is different than Administrator in the case of AppVeyor)
The password is not stored between scripts, so all tests that have to use credentials in a job will reset the password for that particular script.
One potential partial solution to this would be to have the test create a new account with Administrator privs, with a randomly generated password, and use that instead of relying on an existing account.
I'm not sure what the best way to re-use those credentials throughout the job is though. A Global variable comes to mind, but I know that's frowned upon.
Tagging @PlagueHO , @johlju , and @tmeckel for comment. Open to comments from the rest of the community too though.
In the integration test template it was added the possibility of using a JSON file for real scenario testing. It would be great if there were a way to pass in the correct admin and password and the configuration creates the account. Not sure how to pass in an already existing account to use in the real scenario testing (outside of AppVeyor)
Details of the scenario you tried and the problem that is occurring
Tests in 'Tests\Integration\MSFT_xScriptResource.Integration.Tests.ps1' currently fail when run from outside of AppVeyor. These tests should be adjusted to run on any supported system.
Verbose logs showing the problem
The operating system the target node is running
PS C:> Get-ComputerInfo -Property @(
'OsName',
'OsOperatingSystemSKU',
'OSArchitecture',
'WindowsVersion',
'WindowsBuildLabEx',
'OsLanguage',
'OsMuiLanguages')
OsName : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsVersion : 1809
WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
PS C:> $PSVersionTable
Name Value
PSVersion 5.1.17763.316
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.316
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
dev
The text was updated successfully, but these errors were encountered: