RamblingCookieMonster / PSDeploy

Simple PowerShell based deployments
http://ramblingcookiemonster.github.io/PSDeploy-Take-Two/
MIT License
347 stars 69 forks source link

Upgrade YamlDotNet - Closes #121 #130

Open fireflycons opened 5 years ago

fireflycons commented 5 years ago

Borrowing slightly from powershell-yaml, this change upgrades the PSYaml submodule to use YamlDotNet 7.0

It has the following features

  1. DLL provided for .NET 3.5 (PS 1, 2 and 3), .NET 4.5 (PS 4 and 5), NETStandard1.3 (PS 6 Core).
  2. Which one to load is selected at runtime.
  3. Shadow-Copy places the DLL into subdirectory based on version, so running in pwsh doesn't overwrite the shadow for powershell.
  4. If a version of YamlDotNet is already present in the appdomain, then loading is skipped.

Noted an issue while testing. In the build sequence, PSDepends is used to load the current version of PSDeploy from the gallery. This installs its own shadow of YamlDotNet which masks the loading of the newer version due to the logic in the fourth point above. I have run the tests with PSDeploy commented out of the requirements file.

fireflycons commented 5 years ago

I also note that some tests fail locally, when there's no failures in AppVeyor. This was using the version I forked - prior to any edits. Something's leaking into the pipeline?

    Context Deploy Folder to VM (using the YML)
      [-] Should Return Mocked output 60ms
        Expected $true, but got @($true, $true, $true, $true, $true, $true, $true, $true).
        46:                 $Results | Should be $True
        at Invoke-LegacyAssertion, ... WindowsPowerShell\Modules\Pester\4.7.3\Functions\Assertions\Should.ps1: line 169
        at <ScriptBlock>, ... PSDeploy\Tests\Types\CopyVMFile.Tests.ps1: line 46
      [+] Should copy folder to VM 51ms
    Context Deploy Folder to VM (using the DSL)
      [-] Should Return Mocked output 24ms
        Expected $true, but got @($true, $true, $true, $true, $true, $true, $true, $true).
        63:                 $Results | Should be $True
        at Invoke-LegacyAssertion, ... WindowsPowerShell\Modules\Pester\4.7.3\Functions\Assertions\Should.ps1: line 169
        at <ScriptBlock>, ... PSDeploy\Tests\Types\CopyVMFile.Tests.ps1: line 63

    Context Creates External Help
      [+] Should create external Help with PlatyPS 21ms
      [-] Should Return Mocked output 17ms
        Expected $true, but got @($true, $true).
        33:                 $Results | Should be $True
        at Invoke-LegacyAssertion, ... WindowsPowerShell\Modules\Pester\4.7.3\Functions\Assertions\Should.ps1: line 169
        at <ScriptBlock>, ... PSDeploy\Tests\Types\PlatyPS.Tests.ps1: line 33