Replace Pester submodule by download from the gallery#4618
Replace Pester submodule by download from the gallery#4618vors wants to merge 2 commits intoPowerShell:masterfrom
Conversation
|
Travis failures are due to Did pester 4 output to become more verbose? |
|
I see dll not found error: |
|
Also |
|
I work to achieve Pester compatibility with Linux, macOS and PSCore on Windows. The current status you can follow pester/Pester#639. The error with not loading is resolved in my development branch now. |
|
Thank you @it-praktyk ! |
|
@vors, Pester 4.x introduced some breaking changes and our tests need to be updated before we can start relying on 4.x |
|
The migration process is described at Pester wiki Migrating from Pester 3 to Pester 4. |
|
@it-praktyk thanks, but we're aware of the work involved, just a matter of prioritization and doing it :) Currently planned to be addressed after 6.0.0 release. |
|
@SteveL-MSFT, I just updated some of them - I'll open PR to @vors's branch. |
e3f58e3 to
7c99ff3
Compare
|
Can we close this because #5623 was merged? |
|
@iSazonov isn't this PR about using the PS gallery Pester vs psl-pester? We removed the sub module, but i believe this project still relies on psl-pester. |
|
#3002 I don't understand who really works on this @vors or @JamesWTruher ? |
psl-pester means Pester what is it currently bundled with PowerShell code? I think, because of Pester since v. 4.1.0 is supported on PSCore 6.0, bundling of other/older version with PowerShell is not necessary. |
|
OK, I answer myself - without editing my previous comment. I think that using official Pester is the better idea than using a fork of old code. Of course, some work needs to be done to update and verify tests. I prepared the pull request that resolves braking changes between Pester 3.x and 4.x vors@039194d . |
Fix CommandDiscovery.Tests.ps1 to use Should BeIn
|
@it-praktyk awesome, thank you! I cherry-picked your changes to the branch head instead of merging it thru github, because it required one more rebase on master for
As @markekraus said: this one is different and should remove dependency on the old and devirgent fork of pester (aka psl-pester).
Not sure, I would not say I working actively to move this forward. My hope was that it would be a simple change with a drop-in replacement. Hopefully @it-praktyk just fixed all the migration problems, we will see when CI finishes the build. |
Now, I'm in progress of local tests and after that, I'll publish some conclusion. The first "draft" of them for a build of the current state of PowerShell made and tested on Ubuntu 16.04 in headless mode. psl-pester Pester 4.2.0-alpha3 |
|
Failures are https://travis-ci.org/PowerShell/PowerShell/jobs/326257638#L3384 |
|
Also on AppVeyor the produced log is sparse, looks like we loose information along the way: I didn't see it in other projects that use Pester 4, so it's probably caused by some wrappers from |
|
I didn't analyze it yet deeply but changes my for psl-pester can be related to your last comment. |
|
Summary of my tests on Ubuntu Linux 16.04. OS: Ubuntu 16.04 x64 - Vagrant bento/ubuntu-16.04 - v201801.02.0 - provider: vmware_workstation bashsudo su
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
apt-get update
apt-get install -y powershell
cd /vagrant/
git clone https://github.com/PowerShell/PowerShell.git
cd PowerShell/
git submodule init
git submodule update
pwshpwshcd /vagrant/PowerShell
ipmo ./build.psm1
Start-PSBootstrap
Start-PSBuild
Restore-PSPester
Start-PSPester -PassThru | Export-Clixml /vagrant/psl-pester-20180117a.xml
cd ..
git clone https://github.com/Pester/Pester.git
cd /vagrant/PowerShell/src/powershell-unix/bin/Linux/netcoreapp2.0/linux-x64/publish/Modules/
mv Pester psl-pester
ln -s /vagrant/Pester ./Pester
cd /vagrant/PowerShell/
git remote add vors https://github.com/vors/PowerShell
git fetch vors
git log vors/replace-pester
git cherry-pick c75e2f3ac14e25fc27efa0f9f37ed285e16850b2
Start-PSPester -PassThru | Export-Clixml /vagrant/pester-4.0.2-alpha3-20180117a.xml
(Import-Clixml /vagrant/psl-pester-20180117a.xml).TestResult | Where { $_.Result -eq 'Failed'} | Out-File psl-pester-failed-20180117a.xml
(Import-Clixml /vagrant/pester-4.0.2-alpha3-20180117a.xml).TestResult | Where { $_.Result -eq 'Failed'} | Out-File pester-4.0.2-alpha3-failed-20180117a.xml Files with results of failed tests were published as a gist. Under execution of tests using Pester 4.2.0-alpha3 I observed that execution of tests stopped and wait for an interactive input. Executing script /home/vagrant/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1
<OUTPUT_PARTIALY_OMITTED>
Describing Handling of globbing patterns
Context Handling of Unix [ab] globbing patterns in literal paths
cmdlet AfterEach at command pipeline position 1
Supply values for the following parameters:
Scriptblock:
<ENTER_FROM_A_KEYBOARD>
[-] Error occurred in Context block 179.58s
PSInvalidCastException: Cannot convert the "" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
ArgumentTransformationMetadataException: Cannot convert the "" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
ParameterBindingArgumentTransformationException: Cannot process argument transformation on parameter 'Scriptblock'. Cannot convert the "" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
at <ScriptBlock>, /home/vagrant/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1: line 381
at DescribeImpl, /home/vagrant/PowerShell/src/powershell-unix/bin/Linux/netcoreapp2.0/linux-x64/publish/Modules/Pester/Functions/Describe.ps1: line 161
|
I think the reason is that the curly brace is moved to the next line |
|
@iSazonov, the very good suggestion. Should I prepare a pull request for this small update for the PowerShell/master branch or do you prefer to update this via the vors/replace-pester branch? |
|
@it-praktyk feel free to take over this work and open a new PR. You can cherry-pick the |
|
@it-praktyk It would be great if you took this job. (It seems @vors is very busy in other projects) |
|
There was a big change to build.psm1 which was just merged which will have to be resolved. |
|
@TravisEz13, thank you for heads-up. I just analyze what was changed. @vors, @iSazonov I'll try to continue work on this subject. I hope to share something valuable soon. |
|
This is fixed by #6064 |
|
Awesome! I think |
|
Restore-PSPester is useful to get pester for testing. We are still not shipping pester. |
|
Restore-GitModule was removed. |
Trying to see can we fix #1371 earlier
According to pester/Pester#639 (comment) pester 4.0.6 has some limitations on linux and mac, but so does the https://github.com/PowerShell/psl-pester
I did few local tests on mac and didn't encounter any problems so far, let see how CI will like this.