dsccommunity / xPSDesiredStateConfiguration

DSC resources for configuring common operating systems features, files and settings.
https://dsccommunity.org
MIT License
211 stars 135 forks source link

MSFT_xArchive.EndToEnd.Tests.ps1 and MSFT_xArchive.Integration.Tests.ps1: Integration Tests Broken #457

Closed mhendric closed 5 years ago

mhendric commented 6 years ago

Details of the scenario you tried and the problem that is occurring

I'm not yet sure when it began, but all recent pull requests are failing during CI/CD due to issues in 'Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1'. Specifically, it looks like various tests are failing due to file or folder copy issues. I cannot reproduce this issue locally (tried Win 10 / PS 5.1 and Win 2016 / PS 5). It appears something specific with AppVeyor may be causing these to fail.

The following requests and AppVeyor runs all show this issue. In all cases, no Archive related code was checked in, but the tests are failing anyways.

https://github.com/PowerShell/xPSDesiredStateConfiguration/pull/447 / https://ci.appveyor.com/project/PowerShell/xpsdesiredstateconfiguration/builds/19890728

https://github.com/PowerShell/xPSDesiredStateConfiguration/pull/448 / https://ci.appveyor.com/project/PowerShell/xpsdesiredstateconfiguration/builds/19922970

https://github.com/PowerShell/xPSDesiredStateConfiguration/pull/450 https://ci.appveyor.com/project/PowerShell/xpsdesiredstateconfiguration/builds/19669492

Failed run output:

[00:14:28] Executing script C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1
[00:14:28] 
[00:14:28]   Describing xArchive End to End Tests
[00:14:30] There is no operation running currently. Stop will return without any action.
[00:14:33] 
[00:14:33]     Context Expand an archive to a destination that does not yet exist
[00:14:33]       [+] Destination should not exist before configuration 5.39s
[00:14:33]       [+] Should return false from Test-TargetResource with the same parameters before configuration 102ms
[00:14:33] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:46]       [-] Should compile and run configuration 12.68s
[00:14:46]         Expected no exception to be thrown, but an exception "PowerShell DSC resource MSFT_xArchive  failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: An error occurred while attempting copy from the archive to the destination path C:\Users\appveyor\AppData\Local\Temp\1\cfccbbf2-8300-4b8d-8c69-4ad830892faf\NonExistentDestinationForExpand\Folder1\. ---> System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "The filename, directory name, or volume label syntax is incorrect.
[00:14:46]         " ---> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.
[00:14:46]            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[00:14:46]            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
[00:14:46]            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
[00:14:46]            at System.IO.FileStream..ctor(String path, FileMode mode)
[00:14:46]            --- End of inner exception stack trace ---
[00:14:46]            at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
[00:14:46]            at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
[00:14:46]            at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
[00:14:46]            --- End of inner exception stack trace --- " was thrown from C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1:153 char:17
[00:14:46]             + ...             Start-DscConfiguration -Path $TestDrive -ErrorAction 'Sto ...
[00:14:46]             +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
[00:14:46]         154:             } | Should Not Throw
[00:14:46]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:46]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 150
[00:14:46]       [+] Destination should exist after configuration 152ms
[00:14:46]       [-] File structure of destination should match the file structure of the archive after configuration 101ms
[00:14:46]         Expected $true, but got $false.
[00:14:46]         162:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $true
[00:14:46]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:46]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 162
[00:14:46]       [-] Should return true from Test-TargetResource with the same parameters after configuration 195ms
[00:14:46]         Expected $true, but got $false.
[00:14:46]         166:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:46]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:46]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 166
[00:14:46] 
[00:14:46]     Context Expand an archive to an existing destination with items that are not in the archive
[00:14:47]       [+] Destination should exist before configuration 362ms
[00:14:47]       [+] Other item under destination OtherSubDirectory should exist as a directory before configuration 86ms
[00:14:47]       [+] Other item under destination OtherFile should exist as a file before configuration 92ms
[00:14:47]       [+] Other file under destination OtherFile should have the expected content before configuration 97ms
[00:14:47]       [+] Other item under destination OtherDirectory should exist as a directory before configuration 88ms
[00:14:47]       [+] Should return false from Test-TargetResource with the same parameters before configuration 115ms
[00:14:47] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:48]       [-] Should compile and run configuration 604ms
[00:14:48]         Expected no exception to be thrown, but an exception "PowerShell DSC resource MSFT_xArchive  failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: An error occurred while attempting copy from the archive to the destination path C:\Users\appveyor\AppData\Local\Temp\1\cfccbbf2-8300-4b8d-8c69-4ad830892faf\DestinationWithOtherItemsForExpand\Folder1\. ---> System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "The filename, directory name, or volume label syntax is incorrect.
[00:14:48]         " ---> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.
[00:14:48]            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[00:14:48]            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
[00:14:48]            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
[00:14:48]            at System.IO.FileStream..ctor(String path, FileMode mode)
[00:14:48]            --- End of inner exception stack trace ---
[00:14:48]            at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
[00:14:48]            at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
[00:14:48]            at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
[00:14:48]            --- End of inner exception stack trace --- " was thrown from C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1:235 char:17
[00:14:48]             + ...             Start-DscConfiguration -Path $TestDrive -ErrorAction 'Sto ...
[00:14:48]             +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
[00:14:48]         236:             } | Should Not Throw
[00:14:48]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:48]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 232
[00:14:48]       [+] Destination should exist after configuration 129ms
[00:14:48]       [-] File structure of destination should match the file structure of the archive after configuration 96ms
[00:14:48]         Expected $true, but got $false.
[00:14:48]         244:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $true
[00:14:48]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:48]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 244
[00:14:48]       [+] Other item under destination OtherSubDirectory should exist as a directory after configuration 71ms
[00:14:48]       [+] Other item under destination OtherFile should exist as a file after configuration 56ms
[00:14:48]       [+] Other file under destination OtherFile should have the expected after before configuration 56ms
[00:14:48]       [+] Other item under destination OtherDirectory should exist as a directory after configuration 62ms
[00:14:48]       [-] Should return true from Test-TargetResource with the same parameters after configuration 115ms
[00:14:48]         Expected $true, but got $false.
[00:14:48]         272:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:48]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:48]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 272
[00:14:48] 
[00:14:48]     Context Expand an archive to an existing destination that already contains the same archive files
[00:14:49]       [+] Destination should exist before configuration 647ms
[00:14:49]       [+] File structure of destination should match the file structure of the archive before configuration 133ms
[00:14:49]       [-] Should return true from Test-TargetResource with the same parameters before configuration 145ms
[00:14:49]         Expected $true, but got $false.
[00:14:49]         299:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:49]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:49]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 299
[00:14:49] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:50]       [-] Should compile and run configuration 800ms
[00:14:50]         Expected no exception to be thrown, but an exception "PowerShell DSC resource MSFT_xArchive  failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: An item already exists at C:\Users\appveyor\AppData\Local\Temp\1\cfccbbf2-8300-4b8d-8c69-4ad830892faf\DestinationWithMatchingArchiveForExpand\Folder1\ that does not match the item in the archive at Folder1/, but the Force parameter has not been specified to overwrite this item. " was thrown from C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1:306 char:17
[00:14:50]             + ...             Start-DscConfiguration -Path $TestDrive -ErrorAction 'Sto ...
[00:14:50]             +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
[00:14:50]         307:             } | Should Not Throw
[00:14:50]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:50]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 303
[00:14:50]       [+] Destination should exist after configuration 95ms
[00:14:50]       [+] File structure of destination should match the file structure of the archive after configuration 106ms
[00:14:50]       [-] Should return true from Test-TargetResource with the same parameters after configuration 130ms
[00:14:50]         Expected $true, but got $false.
[00:14:50]         319:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:50]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:50]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 319
[00:14:50] 
[00:14:50]     Context Expand an archive to a destination that contains archive files that do not match by the specified SHA Checksum without Force specified
[00:14:51]       [+] Destination should exist before configuration 411ms
[00:14:51]       [+] File structure of destination should match the file structure of the archive before configuration 98ms
[00:14:51]       [+] File contents of destination should not match the file contents of the archive 85ms
[00:14:51]       [+] Should return false from Test-TargetResource with the same parameters before configuration 234ms
[00:14:51] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:52]       [+] Should compile and run configuration and throw an error for attempting to overwrite files without Force specified 987ms
[00:14:52]       [+] Destination should exist after configuration 62ms
[00:14:52]       [+] File structure of destination should match the file structure of the archive after configuration 89ms
[00:14:52]       [+] File contents of destination should not match the file contents of the archive after configuration 76ms
[00:14:52]       [+] Should return false from Test-TargetResource with the same parameters after configuration 120ms
[00:14:53] 
[00:14:53]     Context Expand an archive to a destination that contains archive files that do not match by the specified SHA Checksum with Force specified
[00:14:53]       [+] Destination should exist before configuration 339ms
[00:14:53]       [+] File structure of destination should match the file structure of the archive before configuration 99ms
[00:14:53]       [+] File contents of destination should not match the file contents of the archive before configuration 85ms
[00:14:53]       [+] Should return false from Test-TargetResource with the same parameters before configuration 143ms
[00:14:53] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:54]       [-] Should compile and run configuration 638ms
[00:14:54]         Expected no exception to be thrown, but an exception "PowerShell DSC resource MSFT_xArchive  failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: An error occurred while attempting copy from the archive to the destination path C:\Users\appveyor\AppData\Local\Temp\1\cfccbbf2-8300-4b8d-8c69-4ad830892faf\DestinationWithMismatchingArchiveWithSHAAndForceForExpand\Folder1\. ---> System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "The filename, directory name, or volume label syntax is incorrect.
[00:14:54]         " ---> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.
[00:14:54]            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[00:14:54]            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
[00:14:54]            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
[00:14:54]            at System.IO.FileStream..ctor(String path, FileMode mode)
[00:14:54]            --- End of inner exception stack trace ---
[00:14:54]            at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
[00:14:54]            at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
[00:14:54]            at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
[00:14:54]            --- End of inner exception stack trace --- " was thrown from C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1:419 char:17
[00:14:54]             + ...             Start-DscConfiguration -Path $TestDrive -ErrorAction 'Sto ...
[00:14:54]             +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
[00:14:54]         420:             } | Should Not Throw
[00:14:54]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:54]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 416
[00:14:54]       [+] Destination should exist after configuration 83ms
[00:14:54]       [-] File structure of destination should match the file structure of the archive after configuration 85ms
[00:14:54]         Expected $true, but got $false.
[00:14:54]         428:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $true
[00:14:54]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:54]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 428
[00:14:54]       [-] File contents of destination should match the file contents of the archive after configuration 106ms
[00:14:54]         Expected $true, but got $false.
[00:14:54]         432:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination -CheckContents | Should Be $true
[00:14:54]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:54]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 432
[00:14:54]       [-] Should return true from Test-TargetResource with the same parameters after configuration 225ms
[00:14:54]         Expected $true, but got $false.
[00:14:54]         436:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:54]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:54]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 436
[00:14:54] 
[00:14:54]     Context Expand an archive to a destination that contains archive files that match by the specified SHA Checksum
[00:14:55]       [+] Destination should exist before configuration 372ms
[00:14:55]       [+] File structure of destination should match the file structure of the archive before configuration 121ms
[00:14:55]       [+] File contents of destination should match the file contents of the archive before configuration 97ms
[00:14:55]       [-] Should return true from Test-TargetResource with the same parameters before configuration 207ms
[00:14:55]         Expected $true, but got $false.
[00:14:55]         470:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:55]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:55]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 470
[00:14:55] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:56]       [-] Should compile and run configuration 761ms
[00:14:56]         Expected no exception to be thrown, but an exception "PowerShell DSC resource MSFT_xArchive  failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: An error occurred while attempting copy from the archive to the destination path C:\Users\appveyor\AppData\Local\Temp\1\cfccbbf2-8300-4b8d-8c69-4ad830892faf\DestinationWithMatchingArchiveWithSHAForExpand\Folder1\. ---> System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "The filename, directory name, or volume label syntax is incorrect.
[00:14:56]         " ---> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.
[00:14:56]            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[00:14:56]            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
[00:14:56]            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
[00:14:56]            at System.IO.FileStream..ctor(String path, FileMode mode)
[00:14:56]            --- End of inner exception stack trace ---
[00:14:56]            at System.Management.Automation.DotNetAdapter.AuxiliaryConstructorInvoke(MethodInformation methodInformation, Object[] arguments, Object[] originalArguments)
[00:14:56]            at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, ConstructorInfo[] constructors, Object[] arguments)
[00:14:56]            at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, ConstructorInfo[] constructors, Object[] args)
[00:14:56]            --- End of inner exception stack trace --- " was thrown from C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1:477 char:17
[00:14:56]             + ...             Start-DscConfiguration -Path $TestDrive -ErrorAction 'Sto ...
[00:14:56]             +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
[00:14:56]         478:             } | Should Not Throw
[00:14:56]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:56]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 474
[00:14:56]       [+] Destination should exist after configuration 95ms
[00:14:56]       [-] File structure of destination should match the file structure of the archive after configuration 94ms
[00:14:56]         Expected $true, but got $false.
[00:14:56]         486:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $true
[00:14:56]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:56]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 486
[00:14:56]       [-] File contents of destination should match the file contents of the archive after configuration 105ms
[00:14:56]         Expected $true, but got $false.
[00:14:56]         490:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination -CheckContents | Should Be $true
[00:14:56]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:56]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 490
[00:14:56]       [-] Should return true from Test-TargetResource with the same parameters after configuration 212ms
[00:14:56]         Expected $true, but got $false.
[00:14:56]         494:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $true
[00:14:56]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:56]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 494
[00:14:56] 
[00:14:56]     Context Remove an expanded archive from an existing destination that contains only the expanded archive
[00:14:57]       [+] Destination should exist before configuration 345ms
[00:14:57]       [+] File structure of destination should match the file structure of the archive before configuration 92ms
[00:14:57]       [-] Should return false from Test-TargetResource with the same parameters before configuration 116ms
[00:14:57]         Expected $false, but got $true.
[00:14:57]         521:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $false
[00:14:57]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:57]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 521
[00:14:57] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:57]       [+] Should compile and run configuration 554ms
[00:14:58]       [+] Destination should exist after configuration 55ms
[00:14:58]       [-] File structure of destination should not match the file structure of the archive after configuration 99ms
[00:14:58]         Expected $false, but got $true.
[00:14:58]         537:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $false
[00:14:58]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:58]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 537
[00:14:58]       [+] Should return true from Test-TargetResource with the same parameters after configuration 118ms
[00:14:58] 
[00:14:58]     Context Remove an expanded archive from an existing destination that contains the expanded archive and other files
[00:14:58]       [+] Destination should exist before configuration 606ms
[00:14:58]       [+] Other item under destination OtherFile should exist as a file before configuration 55ms
[00:14:58]       [+] Other file under destination OtherFile should have the expected content before configuration 56ms
[00:14:59]       [+] Other item under destination OtherSubDirectory should exist as a directory before configuration 57ms
[00:14:59]       [+] Other item under destination OtherDirectory should exist as a directory before configuration 68ms
[00:14:59]       [+] File structure of destination should match the file structure of the archive before configuration 101ms
[00:14:59]       [-] Should return false from Test-TargetResource with the same parameters before configuration 133ms
[00:14:59]         Expected $false, but got $true.
[00:14:59]         609:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $false
[00:14:59]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:14:59]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 609
[00:14:59] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:14:59]       [+] Should compile and run configuration 651ms
[00:15:00]       [+] Destination should exist after configuration 54ms
[00:15:00]       [+] Other item under destination OtherFile should exist as a file before configuration 54ms
[00:15:00]       [+] Other file under destination OtherFile should have the expected content before configuration 55ms
[00:15:00]       [+] Other item under destination OtherSubDirectory should exist as a directory before configuration 64ms
[00:15:00]       [+] Other item under destination OtherDirectory should exist as a directory before configuration 65ms
[00:15:00]       [-] File structure of destination should not match the file structure of the archive after configuration 105ms
[00:15:00]         Expected $false, but got $true.
[00:15:00]         649:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $false
[00:15:00]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:15:00]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 649
[00:15:00]       [+] Should return true from Test-TargetResource with the same parameters after configuration 143ms
[00:15:00] 
[00:15:00]     Context Remove an expanded archive from an existing destination that does not contain any archive files
[00:15:00]       [+] Destination should exist before configuration 256ms
[00:15:00]       [+] File structure of destination should not match the file structure of the archive before configuration 99ms
[00:15:00]       [+] Should return true from Test-TargetResource with the same parameters before configuration 93ms
[00:15:00] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:15:01]       [+] Should compile and run configuration 571ms
[00:15:01]       [+] Destination should exist after configuration 56ms
[00:15:01]       [+] File structure of destination should not match the file structure of the archive after configuration 64ms
[00:15:01]       [+] Should return true from Test-TargetResource with the same parameters after configuration 101ms
[00:15:01] 
[00:15:01]     Context Remove an expanded archive from a destination that does not exist
[00:15:01]       [+] Destination should not exist before configuration 179ms
[00:15:02]       [+] Should return true from Test-TargetResource with the same parameters before configuration 79ms
[00:15:02] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:15:02]       [+] Should compile and run configuration 724ms
[00:15:02]       [+] Destination should not exist after configuration 56ms
[00:15:02]       [+] Should return true from Test-TargetResource with the same parameters after configuration 77ms
[00:15:02] 
[00:15:02]     Context Remove an archive from a destination that contains archive files that do not match by the specified SHA Checksum
[00:15:03]       [+] Destination should exist before configuration 328ms
[00:15:03]       [+] File structure of destination should match the file structure of the archive before configuration 108ms
[00:15:03]       [+] File contents of destination should not match the file contents of the archive before configuration 94ms
[00:15:03]       [+] Should return true from Test-TargetResource with the same parameters before configuration 139ms
[00:15:03] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:15:04]       [+] Should compile and run configuration 681ms
[00:15:04]       [+] Destination should exist after configuration 84ms
[00:15:04]       [+] File structure of destination should match the file structure of the archive after configuration 107ms
[00:15:04]       [+] File contents of destination should not match the file contents of the archive after configuration 89ms
[00:15:04]       [+] Should return true from Test-TargetResource with the same parameters after configuration 168ms
[00:15:04] 
[00:15:04]     Context Remove an archive from a destination that contains archive files that match by the specified SHA Checksum
[00:15:05]       [+] Destination should exist before configuration 513ms
[00:15:05]       [+] File structure and contents of destination should match the file contents of the archive before configuration 102ms
[00:15:05]       [-] Should return false from Test-TargetResource with the same parameters before configuration 203ms
[00:15:05]         Expected $false, but got $true.
[00:15:05]         822:             MSFT_xArchive\Test-TargetResource @archiveParameters | Should Be $false
[00:15:05]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:15:05]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 822
[00:15:05] The 'Microsoft.PowerShell.Management' module was not imported because the 'Microsoft.PowerShell.Management' snap-in was already imported.
[00:15:06]       [+] Should compile and run configuration 657ms
[00:15:06]       [+] Destination should exist after configuration 72ms
[00:15:06]       [-] File structure of destination should not match the file structure of the archive after configuration 104ms
[00:15:06]         Expected $false, but got $true.
[00:15:06]         838:             Test-FileStructuresMatch -SourcePath $script:testArchiveFilePathWithoutExtension -DestinationPath $destination | Should Be $false
[00:15:06]         at Invoke-LegacyAssertion, C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Functions\Assertions\Should.ps1: line 188
[00:15:06]         at <ScriptBlock>, C:\projects\xpsdesiredstateconfiguration\Tests\Integration\MSFT_xArchive.EndToEnd.Tests.ps1: line 838
[00:15:06]       [+] Should return false from Test-TargetResource with the same parameters after configuration 177ms
[00:15:06] There is no operation running currently. Stop will return without any action.
[00:15:06] 

Version of the DSC module that was used ('dev' if using current dev branch)

dev

mhendric commented 6 years ago

As best as I can tell, these tests broke midway between #445 and #447. All tests passed for #445 (https://ci.appveyor.com/project/PowerShell/xpsdesiredstateconfiguration/build/6.0.1165.0), but started failing in #447 on, even though nothing in xArchive changed. Did something happen on the AppVeyor side between these two?

mhendric commented 6 years ago

Adding default resource maintainers (@kwirkykat and @mbreakey3), plus @johlju . Is there a way to log into a VM that's created as part of the AppVeyor build environment so that some manual debugging can be done? Since this issue can't be reproduced locally (at least as far as I can tell), it seems like a good way to debug this would be to get on one of these VM's and debug from there. Thanks.

johlju commented 6 years ago

It can be enabled in the AppVeyor.yml. https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ Easiest is to add the fork as a project in AppVeyor, then when sending in a branch it will see it and start the tests (no need to send in a PR). If using your own fork, you can rebuild the same commit over and over if needed. The build worker is terminated after 60 minutes.

mhendric commented 6 years ago

Ok, I setup an AppVeyor project and did some testing with my Fork. First I tried manually opening PowerShell on the build VM and running the problem Integration tests, and they run just fine. I then tried importing the AppVeyor module, and running Invoke-AppveyorTestScriptTask as per the AppVeyor.yml. The tests ran fine within that too. It seems the issue only occurs when the tests are running within/underneath 'Appveyor.BuildAgent.Interactive.exe'. I'm not really sure how to troubleshoot this further though. Any ideas?

mhendric commented 6 years ago

Reaching out to the community to get opinions on how to proceed with this issue while its being troubleshooted, as it's currently blocking a number of Pull Requests from getting merged, even though it's unrelated to those PR's. Should we continue to block all PR's until this is resolved? Should we ignore these and merge the PR's anyways? Should we disable the corresponding tests until we have a fix for them (that would be my vote)? Any other suggestions?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

PlagueHO commented 5 years ago

It looks like my fix (improve how we detect if an archive is a folder or not) has resolved the integration test issues:

https://ci.appveyor.com/project/PlagueHO/xpsdesiredstateconfiguration/builds/21565643?fullLog=true#L2825

But we really need to go through and start cleaning up this whole module and adopting the correct standards. Even though this isn't HQRM I still think the coding style should meet guidelines. So there is a lot of work to be done in that department (just check all the PSSA warnings).

PlagueHO commented 5 years ago

I've raised an issue over in PSDscResources to forward port these issues/fixes over there: https://github.com/PowerShell/PSDscResources/issues/126

PlagueHO commented 5 years ago

:rage: Turns out that this issue had already been resolved over in PSDscResources at some point (can't track down the issue), but the fix never back ported over here. So I've updated my fix to be a back port of that change.