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

Add in-process and out-of-process E2E tests #2315

Merged
merged 52 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f9489f1
Init WPM calls from Nunit
AmelBawa-msft Jun 22, 2022
6a9ba37
Init test file
AmelBawa-msft Jun 23, 2022
ad915b9
Init COM install command tests cases
AmelBawa-msft Jun 23, 2022
a017115
Installer tests
AmelBawa-msft Jun 24, 2022
d72063a
Init COM upgrade command test
AmelBawa-msft Jun 24, 2022
af5d576
Init COM uninstall command test
AmelBawa-msft Jun 25, 2022
0973699
Added projection
AmelBawa-msft Jun 28, 2022
0fab6c4
Updated initializer and added factory methods
AmelBawa-msft Jun 28, 2022
dded477
Update Install tests
AmelBawa-msft Jun 30, 2022
f96a2c9
Update Uninstall tests
AmelBawa-msft Jun 30, 2022
77624f0
Update Upgrade tests
AmelBawa-msft Jul 1, 2022
c0b42f4
removed try/catch
AmelBawa-msft Jul 1, 2022
0792869
Renamed csproj
AmelBawa-msft Jul 6, 2022
ac16a67
Removed ClassObjectinitializer
AmelBawa-msft Jul 6, 2022
d299249
Code refactoring
AmelBawa-msft Jul 6, 2022
902d099
Merge branch 'master' of https://github.com/AmelBawa-msft/winget-cli …
AmelBawa-msft Jul 7, 2022
f3fb79b
Added more comments
AmelBawa-msft Jul 7, 2022
76b0c8c
Omit precompiled header
AmelBawa-msft Jul 7, 2022
b9fc7e1
Renamed classes
AmelBawa-msft Jul 7, 2022
93aa1bb
Updated E2Ecsproj
AmelBawa-msft Jul 7, 2022
731f5a9
Testing testFiltercriteria in vstest
AmelBawa-msft Jul 8, 2022
b2095a4
Fixed typo and testing pipeline
AmelBawa-msft Jul 9, 2022
85d949a
Testing pipeline
AmelBawa-msft Jul 10, 2022
f1a96dd
Testing pipeline
AmelBawa-msft Jul 10, 2022
670c48a
Call GC
AmelBawa-msft Jul 11, 2022
f29230c
Testing pipeline
AmelBawa-msft Jul 11, 2022
eb87acb
Testing pipeline
AmelBawa-msft Jul 11, 2022
650ce4d
Testing pipeline
AmelBawa-msft Jul 11, 2022
4ae402d
Testing pipeline
AmelBawa-msft Jul 11, 2022
57bc6f6
Testing pipeline
AmelBawa-msft Jul 11, 2022
0931d01
Testing pipeline
AmelBawa-msft Jul 11, 2022
bb54721
Testing pipeline
AmelBawa-msft Jul 12, 2022
237dfaa
Testing pipeline
AmelBawa-msft Jul 12, 2022
14fd09f
Testing pipeline
AmelBawa-msft Jul 12, 2022
de497e7
Testing pipeline
AmelBawa-msft Jul 12, 2022
04b7658
Copy windows metadata in pipeline
AmelBawa-msft Jul 12, 2022
5e1481b
Fixed unit test
AmelBawa-msft Jul 12, 2022
590323c
Remove test source on tear down
AmelBawa-msft Jul 14, 2022
e987f6b
Merge branch 'master' into E2E-COM-Test
AmelBawa-msft Jul 14, 2022
fb411ed
Fix build post merge
AmelBawa-msft Jul 14, 2022
2dd80f0
Updated classe name and addressed comments
AmelBawa-msft Jul 15, 2022
6d3a84c
Skip one test for in-proc
AmelBawa-msft Jul 15, 2022
8a39b87
Use interop setup fixture
AmelBawa-msft Jul 15, 2022
c8da912
Skip failing test and created task to investgiate
AmelBawa-msft Jul 17, 2022
cc5815c
Promote vstest to a yml template
AmelBawa-msft Jul 17, 2022
a0ba846
Fixed indentation
AmelBawa-msft Jul 17, 2022
3ac6466
Updated spelling file and other minor changes
AmelBawa-msft Jul 18, 2022
0a0e428
Merge branch 'master' into E2E-COM-Test
AmelBawa-msft Jul 18, 2022
af79723
Addressed spelling bot comment
AmelBawa-msft Jul 18, 2022
1b6cb60
Addressed spelling bot comment
AmelBawa-msft Jul 18, 2022
cf1948d
Addressed comments
AmelBawa-msft Jul 21, 2022
5348b1e
Merge branch 'master' into E2E-COM-Test
AmelBawa-msft Jul 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -128,6 +127,8 @@ fd
fdw
fedorapeople
fileinuse
Filtercriteria
Finalizers
fintimes
Fixfor
flargle
Expand All @@ -142,18 +143,16 @@ FULLMUTEX
FULLWIDTH
fundraiser
fuzzer
FWW
fzanollo
gcpi
GES
GESMBH
GHS
gitlab
gity
Globals
Google
guiddef
hackathon
Hackathon
hashtable
helplib
helplibrary
Expand All @@ -165,17 +164,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 @@ -197,6 +200,7 @@ ISQ
issuecomment
ISVs
itr
IUninstall
IVector
IWeb
IZone
Expand Down Expand Up @@ -228,13 +232,12 @@ localhost
localizationpriority
LPBYTE
LPDWORD
LPITEMIDLIST
lpitemidlist
LPWCH
LPWSTR
LSTATUS
LTDA
lw
lww
lz
malware
maxvalue
Expand All @@ -244,8 +247,8 @@ megamorf
memcpy
middleware
midl
minidump
minexample
minidump
minschema
missingdependency
MMmmbbbb
Expand All @@ -266,7 +269,7 @@ myinstalldir
mylog
mysilent
mysilentwithprogress
mytool
nameof
NESTEDINSTALLER
NETFX
netlify
Expand All @@ -288,13 +291,10 @@ objbase
objidl
ofile
Outptr
OSVERSION
Packagedx
PACL
packageinuse
parametermap
PACL
PARAMETERMAP
pathparts
pathpaths
Patil
pb
PCs
Expand All @@ -305,7 +305,7 @@ pfn
pfxpath
Pherson
pidl
PIDLIST
pidlist
pkgmgr
pkindex
PMS
Expand Down Expand Up @@ -386,7 +386,6 @@ SUSE
swervy
SYD
SYG
symlink
sysrefcomp
Tagit
TCpp
Expand All @@ -405,6 +404,8 @@ TResult
trimstart
TState
TStatus
typeof
typeparam
UCase
ucasemap
UChars
Expand All @@ -413,7 +414,7 @@ uec
uild
uintptr
ul
Uninitialize
uninitialize
uninstallation
uninstaller
uninstallprevious
Expand Down Expand Up @@ -442,13 +443,12 @@ vscode
vstest
vy
wcslen
WDAG
webpages
Webserver
website
WERSJA
wesome
whatif
Whatif
windir
windowsdeveloper
winerror
Expand All @@ -458,7 +458,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