Skip to content

Commit

Permalink
Add in-process and out-of-process E2E tests (microsoft#2315)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmelBawa-msft authored Jul 21, 2022
1 parent 90f1393 commit 156282c
Show file tree
Hide file tree
Showing 34 changed files with 1,697 additions and 143 deletions.
51 changes: 25 additions & 26 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
abcd
accepteula
acl
activatable
adjacents
adml
admx
Expand All @@ -12,7 +11,7 @@ aicli
AICLIC
ajor
alreadyinstalled
amd
Amd
amrutha
anonymized
APARTMENTTHREADED
Expand All @@ -21,7 +20,6 @@ apicontract
apiset
appinstallertest
appname
Archs
arget
argumentlist
ARMNT
Expand Down Expand Up @@ -76,6 +74,8 @@ ci
cinq
CLIE
cloudapp
cls
clsctx
clsid
COINIT
COMGLB
Expand Down Expand Up @@ -105,15 +105,14 @@ diskfull
dllimport
dnld
Dobbeleer
dsc
Dsc
dustojnikhummer
dvinns
dw
ecfr
ecfrbrowse
efgh
EFGH
endian
enr
enums
EQU
ERANGE
Expand All @@ -129,6 +128,8 @@ fd
fdw
fedorapeople
fileinuse
Filtercriteria
Finalizers
fintimes
Fixfor
flargle
Expand All @@ -143,18 +144,16 @@ FULLMUTEX
FULLWIDTH
fundraiser
fuzzer
FWW
fzanollo
gcpi
GES
GESMBH
GHS
gitlab
gity
Globals
Google
guiddef
hackathon
Hackathon
hashtable
helplib
helplibrary
Expand All @@ -166,17 +165,21 @@ hmodule
hre
hresults
htm
IAttachment
IARP
IAttachment
IConfiguration
ICreate
idx
IEnum
IFACEMETHODIMP
IFile
IFind
IGlobal
IHelp
IHost
IID
iid
IInstall
IInstance
IISOn
img
IMutable
Expand All @@ -198,6 +201,7 @@ ISQ
issuecomment
ISVs
itr
IUninstall
IVector
IWeb
IZone
Expand Down Expand Up @@ -229,13 +233,12 @@ localhost
localizationpriority
LPBYTE
LPDWORD
LPITEMIDLIST
lpitemidlist
LPWCH
LPWSTR
LSTATUS
LTDA
lw
lww
lz
malware
maxvalue
Expand All @@ -245,8 +248,8 @@ megamorf
memcpy
middleware
midl
minidump
minexample
minidump
minschema
missingdependency
MMmmbbbb
Expand All @@ -267,7 +270,7 @@ myinstalldir
mylog
mysilent
mysilentwithprogress
mytool
nameof
NESTEDINSTALLER
NETFX
netlify
Expand All @@ -289,13 +292,10 @@ objbase
objidl
ofile
Outptr
OSVERSION
Packagedx
PACL
packageinuse
parametermap
PACL
PARAMETERMAP
pathparts
pathpaths
Patil
pb
PCs
Expand All @@ -306,7 +306,7 @@ pfn
pfxpath
Pherson
pidl
PIDLIST
pidlist
pkgmgr
pkindex
PMS
Expand Down Expand Up @@ -387,7 +387,6 @@ SUSE
swervy
SYD
SYG
symlink
sysrefcomp
Tagit
TCpp
Expand All @@ -406,6 +405,8 @@ TResult
trimstart
TState
TStatus
typeof
typeparam
UCase
ucasemap
UChars
Expand All @@ -414,7 +415,7 @@ uec
uild
uintptr
ul
Uninitialize
uninitialize
uninstallation
uninstaller
uninstallprevious
Expand Down Expand Up @@ -443,13 +444,12 @@ vscode
vstest
vy
wcslen
WDAG
webpages
Webserver
website
WERSJA
wesome
whatif
Whatif
windir
windowsdeveloper
winerror
Expand All @@ -459,7 +459,6 @@ winreg
withstarts
wn
Workflows
wsb
wsl
wsv
wto
Expand Down
58 changes: 43 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,50 @@ jobs:
CleanTargetFolder: false
OverWrite: true

- task: VSTest@2
displayName: Run E2E Tests Packaged
- template: templates/e2e-test.template.yml
parameters:
title: "E2E Tests Packaged"
isPackaged: true
filter: "TestCategory!=InProcess&TestCategory!=OutOfProcess"

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (In-process)"
isPackaged: false
filter: "TestCategory=InProcess"

- task: PowerShell@2
displayName: 'Set program files directory'
inputs:
testRunTitle: 'E2E Packaged'
testSelector: 'testAssemblies'
testAssemblyVer2: '$(buildOutDir)\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll'
runSettingsFile: '$(buildOutDir)\AppInstallerCLIE2ETests\Test.runsettings'
overrideTestrunParameters: '-PackagedContext true
-AICLIPackagePath $(System.DefaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)
-AICLIPath AppInstallerCLI\winget.exe
-LooseFileRegistration true
-InvokeCommandInDesktopPackage true
-StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex
-MsixTestInstallerPath $(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix
-ExeTestInstallerPath $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe
-PackageCertificatePath $(AppInstallerTest.secureFilePath)'
targetType: 'inline'
script: |
if ("$(buildPlatform)" -eq "x86") {
Write-Host "##vso[task.setvariable variable=platformProgramFiles;]${env:ProgramFiles(x86)}"
} else {
Write-Host "##vso[task.setvariable variable=platformProgramFiles;]${env:ProgramFiles}"
}
# Winmd accessed by test runner process (dotnet.exe)
- task: CopyFiles@2
displayName: 'Copy winmd to dotnet directory'
inputs:
SourceFolder: '$(buildOutDir)\Microsoft.Management.Deployment'
TargetFolder: '$(platformProgramFiles)\dotnet'
Contents: Microsoft.Management.Deployment.winmd

# Winmd accessed by WinGetServer process (WindowsPackageManagerServer.exe)
- task: CopyFiles@2
displayName: 'Copy winmd to Package Output'
inputs:
SourceFolder: '$(buildOutDir)\Microsoft.Management.Deployment'
TargetFolder: 'src\AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)'
Contents: Microsoft.Management.Deployment.winmd

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (Out-of-process)"
isPackaged: true
filter: "TestCategory=OutOfProcess"

- task: CopyFiles@2
displayName: 'Copy E2E Tests Package Log to artifacts folder'
Expand Down
28 changes: 28 additions & 0 deletions src/AppInstallerCLI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COMServer", "COMServer\COMS
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Management.Deployment.InProc", "Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.vcxproj", "{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Management.Deployment.Projection", "Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj", "{0B104762-5CD8-47EE-A904-71C1C3F84DCD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UndockedRegFreeWinRT", "UndockedRegFreeWinRT\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxproj", "{31ED69A8-5310-45A9-953F-56C351D2C3E1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detours", "UndockedRegFreeWinRT\detours\detours.vcxproj", "{787EC629-C0FB-4BA9-9746-4A82CD06B73E}"
Expand Down Expand Up @@ -1030,6 +1032,32 @@ Global
{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x64.Build.0 = Release|x64
{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.ActiveCfg = Release|Win32
{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.Build.0 = Release|Win32
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|Any CPU.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM64.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x64.ActiveCfg = Debug|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x64.Build.0 = Debug|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x86.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x86.Build.0 = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|Any CPU.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|Any CPU.Build.0 = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|ARM.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|ARM64.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|x64.ActiveCfg = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|x86.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|Any CPU.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|ARM.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|ARM64.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x64.ActiveCfg = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x64.Build.0 = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x86.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x86.Build.0 = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|Any CPU.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|Any CPU.Build.0 = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|ARM.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|ARM64.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|x64.ActiveCfg = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|x86.ActiveCfg = Release|x86
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|Any CPU.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|ARM.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|ARM64.ActiveCfg = Debug|Win32
Expand Down
18 changes: 18 additions & 0 deletions src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
<ItemGroup>
<PackageReference Include="Microsoft.Msix.Utils" Version="2.0.3" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.6.4" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
</ItemGroup>

<!-- CsWinRT properties -->
<PropertyGroup>
<CsWinRTWindowsMetadata>10.0.17763.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<Content Include="TestData\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -30,6 +36,13 @@

<ItemGroup>
<ProjectReference Include="..\IndexCreationTool\IndexCreationTool.csproj" />
<ProjectReference Include="..\Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj" />
<ProjectReference Include="..\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.vcxproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\WindowsPackageManager\WindowsPackageManager.vcxproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -38,4 +51,9 @@
</None>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<!-- Rename dll to align with the expected search pattern performed by CsWinRT -->
<Copy SourceFiles="$(TargetDir)..\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll" DestinationFiles="$(TargetDir)Microsoft.Management.Deployment.dll" />
<Copy SourceFiles="$(TargetDir)..\WindowsPackageManager\WindowsPackageManager.dll" DestinationFiles="$(TargetDir)WindowsPackageManager.dll" />
</Target>
</Project>
9 changes: 2 additions & 7 deletions src/AppInstallerCLIE2ETests/BaseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace AppInstallerCLIE2ETests
{
using System;
using System.IO;
using System.Threading;
using Newtonsoft.Json.Linq;
using NUnit.Framework;

Expand All @@ -20,16 +19,12 @@ public void BaseSetup()
[OneTimeTearDown]
public void BaseTeardown()
{
TestCommon.RunAICLICommand("source reset", "--force");
TestCommon.TearDownTestSource();
}

public void ResetTestSource()
{
TestCommon.RunAICLICommand("source reset", "--force");
TestCommon.RunAICLICommand("source remove", Constants.DefaultWingetSourceName);
TestCommon.RunAICLICommand("source remove", Constants.DefaultMSStoreSourceName);
TestCommon.RunAICLICommand("source add", $"{Constants.TestSourceName} {Constants.TestSourceUrl}");
Thread.Sleep(2000);
TestCommon.SetupTestSource();
}

public void ConfigureFeature(string featureName, bool status)
Expand Down
Loading

0 comments on commit 156282c

Please sign in to comment.