Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade YamlDotNet - Closes #121 #130

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fireflycons
Copy link

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 added 4 commits October 6, 2019 13:58
- Version 7.0 for NET 3.5, 4.5 and NEtStandard 1.3 (for pswh)
- Change loader to select appropriate DLL
- Change Shadow-Copy  to place DLL into versioned subdirectory so no issues if powershell and pwsh both running.
If the build preinstalls the previous version of PSDeploy, it will mask the loading of the new YamlDotNet version during the test run. It does mean that this build will probably fail at the deploy phase
@fireflycons
Copy link
Author

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
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant