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

Move Microsoft.WinGet.Client E2E test to Pester framework #3503

Merged
merged 15 commits into from
Aug 12, 2023
3 changes: 3 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ EFGH
EFile
endregion
ENDSESSION
epth
EQU
errmsg
ERRORONEXIT
ESource
ESRB
ests
etest
etl
execustom
Expand Down Expand Up @@ -173,6 +175,7 @@ hmodule
Howto
hre
hresults
hrow
hwnd
IARP
IAttachment
Expand Down
51 changes: 49 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
variables:
BuildVer: $[counter(dependencies.GetReleaseTag.outputs['GetTag.tag'], 1)]
buildOutDir: $(Build.SourcesDirectory)\src\$(buildPlatform)\$(buildConfiguration)
buildOutDirAnyCpu: $(Build.SourcesDirectory)\src\AnyCPU\$(buildConfiguration)
artifactsDir: $(Build.ArtifactStagingDirectory)\$(buildPlatform)
packageLayoutDir: $(Build.BinariesDirectory)\WingetPackageLayout

Expand Down Expand Up @@ -218,8 +219,8 @@ jobs:

- template: templates/e2e-setup.yml
parameters:
source: $(Build.SourcesDirectory)
buildOutDir: $(buildOutDir)
sourceDir: $(Build.SourcesDirectory)
localhostWebServerArgs: '-BuildRoot $(buildOutDir)\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -LocalSourceJson $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\localsource.json -SourceCert $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\AppInstallerTest.cer'

- template: templates/e2e-test.template.yml
parameters:
Expand Down Expand Up @@ -260,6 +261,20 @@ jobs:
TargetFolder: '$(artifactsDir)\E2ETests\TestData'
condition: succeededOrFailed()

- task: CopyFiles@2
displayName: 'Copy LocalhostWebServer'
inputs:
SourceFolder: '$(buildOutDir)\LocalhostWebServer'
TargetFolder: '$(artifactsDir)\E2ETests\LocalhostWebServer'
condition: succeededOrFailed()

- task: CopyFiles@2
displayName: 'Copy Dev Package Dependencies'
inputs:
SourceFolder: '$(appxPackageDir)\AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\$(buildPlatform)\'
TargetFolder: '$(artifactsDir)\E2ETests\DevPackageDependencies'
condition: succeededOrFailed()

- task: CopyFiles@2
displayName: 'Copy Files: WinGetUtilInterop.UnitTests'
inputs:
Expand Down Expand Up @@ -335,6 +350,13 @@ jobs:
TargetFolder: '$(artifactsDir)\PowerShell'
condition: succeededOrFailed()

- task: CopyFiles@2
displayName: 'Copy PowerShell AnCPU Module Files'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
displayName: 'Copy PowerShell AnCPU Module Files'
displayName: 'Copy PowerShell AnyCPU Module Files'

inputs:
SourceFolder: '$(buildOutDirAnyCpu)\PowerShell'
TargetFolder: '$(artifactsDir)\PowerShell'
condition: succeededOrFailed()

- task: CopyFiles@2
displayName: 'Copy Dev Package (Loose Files)'
inputs:
Expand Down Expand Up @@ -407,7 +429,32 @@ jobs:
Contents: '**\*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PowerShell@2
displayName: Install Tests Dependencies
inputs:
targetType: 'inline'
script: |
Get-ChildItem E2ETests\DevPackageDependencies -Filter *.appx | %{ Add-AppxPackage $_.FullName }
workingDirectory: $(Pipeline.Workspace)\Build.x64release\

- template: templates/e2e-setup.yml
parameters:
sourceDir: $(Build.SourcesDirectory)
localhostWebServerArgs: '-BuildRoot $(Pipeline.Workspace)\Build.x64release\E2ETests\LocalhostWebServer -StaticFileRoot $(Pipeline.Workspace)\Build.x64release\E2ETests\TestLocalIndex -SourceCert $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\AppInstallerTest.cer'

- pwsh: .\RunTests.ps1 -testModulesPath $(Build.ArtifactStagingDirectory) -outputPath $(Pipeline.Workspace)\PesterTest -packageLayoutPath $(Pipeline.Workspace)\Build.x64release\DevPackage
workingDirectory: $(Build.SourcesDirectory)\src\PowerShell\tests\
displayName: Run Tests

- task: PublishTestResults@2
displayName: Publish Pester Test Results
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(Pipeline.Workspace)\PesterTest\Test*.xml'
failTaskOnFailedTests: true

- task: PublishPipelineArtifact@1
displayName: Publish PowerShell Module Artifacts
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
condition: succeededOrFailed()
Loading
Loading