PSResourceRepository: Integration test with `-Default` parameter fails
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- powershell
- Domínio
- ci-cd, testing-qa
Direção de pesquisa
O teste que está falhando é tests/Integration/Classes/PSResourceRepository.integration.tests.ps1, por volta das linhas 105 e 122. Comece revisando a configuração do builder com PowerShellGet 2.2.5 e PackageManagement 1.4.8.1 e, em seguida, execute o teste de integração do PSResourceRepository nos runners do Windows afetados. Está concluído quando a configuração com o parâmetro -Default passa sem lançar uma exceção.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem description
When the PSGallery is not present on the builders, adding it fails with the error "Value may not be null". This has been independently tested and the same configuration works, so it seems it is something isolated to the builders. When PowerShellGet 2.2.5 is loaded the error occurs. Removing PSGet 2.2.5 and importing 1.0.0.1 fixes the issue.
Example pipeline failure here:
https://dev.azure.com/dsccommunity/ComputerManagementDsc/_build/results?buildId=6992&view=logs&j=bb95b0b0-86ad-5f35-08c1-35aecf9ab8ed
This is obv low priority since the configuration does work, just not on the builders. It just means we're missing some integration test coverage.
Verbose logs
2022-11-29T16:07:11.9222411Z Context When using configuration PSResourceRepository_Create_Default_Config
2022-11-29T16:07:12.1209743Z VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
2022-11-29T16:07:12.1211373Z SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
2022-11-29T16:07:12.1214705Z root/Microsoft/Windows/DesiredStateConfiguration'.
2022-11-29T16:07:12.1416230Z VERBOSE: An LCM method call arrived from computer WIN-STA3E7J6311 with user sid
2022-11-29T16:07:12.1417625Z S-1-5-21-2690698897-1208728301-426778522-500.
2022-11-29T16:07:12.1418446Z VERBOSE: [WIN-STA3E7J6311]: LCM: [ Start Set ]
2022-11-29T16:07:12.2081315Z VERBOSE: [WIN-STA3E7J6311]: LCM: [ Start Resource ] [[PSResourceRepository]Integration_Test]
2022-11-29T16:07:12.2092695Z VERBOSE: [WIN-STA3E7J6311]: LCM: [ Start Test ] [[PSResourceRepository]Integration_Test]
2022-11-29T16:07:12.2682693Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Determining the current
2022-11-29T16:07:12.2684735Z state for resource 'PSResourceRepository' using the key property '{"Name":"PSGallery"}'. (RB0002)
2022-11-29T16:07:12.2859345Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Getting the current
2022-11-29T16:07:12.2867808Z state for resource 'PSResourceRepository' using the key property '{"Name":"PSGallery"}'. (RB0001)
2022-11-29T16:07:12.2869032Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Return the current
2022-11-29T16:07:12.2869684Z state of the repository 'PSGallery'.
2022-11-29T16:07:12.2975439Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Suppressed Warning No
2022-11-29T16:07:12.2978248Z repository with the name 'PSGallery' was found.
2022-11-29T16:07:12.3032636Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] The repository
2022-11-29T16:07:12.3033830Z 'PSGallery' was not found.
2022-11-29T16:07:12.3694423Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] NOTMATCH: Value (type
2022-11-29T16:07:12.3704967Z 'InstallationPolicy') for property 'InstallationPolicy' does not match. Current state is '' and desired state is
2022-11-29T16:07:12.3706137Z 'Untrusted'. (DRC0021)
2022-11-29T16:07:12.3707099Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] NOTMATCH: Value (type
2022-11-29T16:07:12.3708247Z 'Ensure') for property 'Ensure' does not match. Current state is 'Absent' and desired state is 'Present'. (DRC0021)
2022-11-29T16:07:12.3803132Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] MATCH: Value (type
2022-11-29T16:07:12.3820979Z 'InstallationPolicy') for property 'InstallationPolicy' does match. Current state is 'Untrusted' and desired state is
2022-11-29T16:07:12.3822314Z 'Untrusted'. (DRC0020)
2022-11-29T16:07:12.3826531Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] NOTMATCH: Value (type
2022-11-29T16:07:12.3827840Z 'Ensure') for property 'Ensure' does not match. Current state is 'Absent' and desired state is 'Present'. (DRC0021)
2022-11-29T16:07:12.3829167Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] The current state is
2022-11-29T16:07:12.3829818Z not the desired state. (RB0004)
2022-11-29T16:07:12.3830777Z VERBOSE: [WIN-STA3E7J6311]: LCM: [ End Test ] [[PSResourceRepository]Integration_Test] in 0.1870 seconds.
2022-11-29T16:07:12.3831835Z VERBOSE: [WIN-STA3E7J6311]: LCM: [ Start Set ] [[PSResourceRepository]Integration_Test]
2022-11-29T16:07:12.4529767Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Setting the desired
2022-11-29T16:07:12.4531366Z state for resource 'PSResourceRepository' using the key property '{"Name":"PSGallery"}'. (RB0003)
2022-11-29T16:07:12.4770031Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Getting the current
2022-11-29T16:07:12.4771678Z state for resource 'PSResourceRepository' using the key property '{"Name":"PSGallery"}'. (RB0001)
2022-11-29T16:07:12.4780630Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Return the current
2022-11-29T16:07:12.4781509Z state of the repository 'PSGallery'.
2022-11-29T16:07:12.4891548Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Suppressed Warning No
2022-11-29T16:07:12.4894092Z repository with the name 'PSGallery' was found.
2022-11-29T16:07:12.4949762Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] The repository
2022-11-29T16:07:12.4951517Z 'PSGallery' was not found.
2022-11-29T16:07:12.5300935Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] NOTMATCH: Value (type
2022-11-29T16:07:12.5302357Z 'InstallationPolicy') for property 'InstallationPolicy' does not match. Current state is '' and desired state is
2022-11-29T16:07:12.5304750Z 'Untrusted'. (DRC0021)
2022-11-29T16:07:12.5315508Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] NOTMATCH: Value (type
2022-11-29T16:07:12.5318677Z 'Ensure') for property 'Ensure' does not match. Current state is 'Absent' and desired state is 'Present'. (DRC0021)
2022-11-29T16:07:12.5506527Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] MATCH: Value (type
2022-11-29T16:07:12.5507516Z 'InstallationPolicy') for property 'InstallationPolicy' does match. Current state is 'Untrusted' and desired state is
2022-11-29T16:07:12.5508245Z 'Untrusted'. (DRC0020)
2022-11-29T16:07:12.5539901Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] NOTMATCH: Value (type
2022-11-29T16:07:12.5541256Z 'Ensure') for property 'Ensure' does not match. Current state is 'Absent' and desired state is 'Present'. (DRC0021)
2022-11-29T16:07:12.5557261Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] The property 'Ensure'
2022-11-29T16:07:12.5558000Z will be set to 'Present'. (RB0006)
2022-11-29T16:07:12.5575267Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Registering default
2022-11-29T16:07:12.5578038Z repository 'PSGallery' with -Default parameter.
2022-11-29T16:07:13.7582672Z VERBOSE: [WIN-STA3E7J6311]: [[PSResourceRepository]Integration_Test] Repository details,
2022-11-29T16:07:13.7583704Z Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
2022-11-29T16:07:15.0794188Z [-] Should compile and apply the MOF without throwing 3.11s
2022-11-29T16:07:15.1245751Z Expected no exception to be thrown, but an exception "Value cannot be null." was thrown from D:\a\1\s\tests\Integration\Classes\PSResourceRepository.integration.tests.ps1:122 char:21
2022-11-29T16:07:15.1258227Z + ... Start-DscConfiguration @startDscConfigurationParameters
2022-11-29T16:07:15.1270121Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
2022-11-29T16:07:15.1281625Z 123: } | Should -Not -Throw
2022-11-29T16:07:15.1293625Z at <ScriptBlock>, D:\a\1\s\tests\Integration\Classes\PSResourceRepository.integration.tests.ps1: line 105
DSC configuration
$ConfigurationData = @{
AllNodes = , @{
NodeName = 'localhost'
CertificateFile = $Null
}
NonNodeData = @{
PSResourceRepository_Create_Default_Config = @{
Name = 'PSGallery'
Ensure = 'Present'
Default = $true
}
}
}
configuration PSResourceRepository_Create_Default_Config
{
Import-DscResource -ModuleName 'ComputerManagementDsc'
node $AllNodes.NodeName
{
PSResourceRepository 'Integration_Test'
{
Name = $ConfigurationData.NonNodeData.PSResourceRepository_Create_Default_Config.Name
Ensure = $ConfigurationData.NonNodeData.PSResourceRepository_Create_Default_Config.Ensure
Default = $ConfigurationData.NonNodeData.PSResourceRepository_Create_Default_Config.Default
}
}
}
Suggested solution
Check the build process for the builders themselves.
Operating system the target node is running
The issue occurs on both Windows 2019 and 2022 runners
PowerShell version and build the target node is running
PS C:\Windows\system32> Get-Module packagemanagement
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.4.8.1 PackageManagement {Find-Package, Find-PackageProvider, Get-Package, Get-Pack...
PS C:\Windows\system32> Get-Module powershellget
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.2.5 PowerShellGet {Find-Command, Find-DscResource, Find-Module, Find-RoleCap...
ComputerManagementDsc version
Unreleased 8.6.0
- Linguagem predominante
- PowerShell
- Estrelas
- 338
- Forks
- 80
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de dsccommunity/ComputerManagementDsc
-
chore
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
chore
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 68/100
-
chore
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 64/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 55/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
Todas as issues de dsccommunity/ComputerManagementDsc
Issues semelhantes
-
chore ci
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
🎙️ task - fix(deployer): deploy --env prep runs deploy:dev where the repo declares deploy:prepAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
test(agent): Windows smoke - test_client_disconnect_cancels_the_agent races the LLM-call stepAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
amd/gaia#4420 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
backlog bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
WLAN-Pi/wlanpi-profiler#306 ·
Mantenedores costumam responder em até 1 dia