Skip to content

Commit

Permalink
Helix Testing (#6992)
Browse files Browse the repository at this point in the history
Use the Helix testing orchestration framework to run our Terminal LocalTests and Console Host UIA tests.

## References
#### Creates the following new issues:
- #7281 - re-enable local tests that were disabled to turn on Helix
- #7282 - re-enable UIA tests that were disabled to turn on Helix
- #7286 - investigate and implement appropriate compromise solution to how Skipped is handled by MUX Helix scripts

#### Consumes from:
- #7164 - The update to TAEF includes wttlog.dll. The WTT logs are what MUX's Helix scripts use to track the run state, convert to XUnit format, and notify both Helix and AzDO of what's going on.

#### Produces for:
- #671 - Making Terminal UIA tests is now possible
- #6963 - MUX's Helix scripts are already ready to capture PGO data on the Helix machines as certain tests run. Presuming we can author some reasonable scenarios, turning on the Helix environment gets us a good way toward automated PGO.

#### Related:
- #4490 - We lost the AzDO integration of our test data when I moved from the TAEF/VSTest adapter directly back to TE. Thanks to the WTTLog + Helix conversion scripts to XUnit + new upload phase, we have it back!

## PR Checklist
* [x] Closes #3838
* [x] I work here.
* [x] Literally adds tests.
* [ ] Should I update a testing doc in this repo?
* [x] Am core contributor. Hear me roar.
* [ ] Correct spell-checking the right way before merge.

## Detailed Description of the Pull Request / Additional comments
We have had two classes of tests that don't work in our usual build-machine testing environment:
1. Tests that require interactive UI automation or input injection (a.k.a. require a logged in user)
2. Tests that require the entire Windows Terminal to stand up (because our Xaml Islands dependency requires 1903 or later and the Windows Server instance for the build is based on 1809.)

The Helix testing environment solves both of these and is brought to us by our friends over in https://github.com/microsoft/microsoft-ui-xaml.

This PR takes a large portion of scripts and pipeline configuration steps from the Microsoft-UI-XAML repository and adjusts them for Terminal needs.
You can see the source of most of the files in either https://github.com/microsoft/microsoft-ui-xaml/tree/master/build/Helix or https://github.com/microsoft/microsoft-ui-xaml/tree/master/build/AzurePipelinesTemplates

Some of the modifications in the files include (but are not limited to) reasons like:
- Our test binaries are named differently than MUX's test binaries
- We don't need certain types of testing that MUX does.
- We use C++ and C# tests while MUX was using only C# tests (so the naming pattern and some of the parsing of those names is different e.g. :: separators in C++ and . separators in C#)
- Our pipeline phases work a bit differently than MUX and/or we need significantly fewer pieces to the testing matrix (like we don't test a wide variety of OS versions).

The build now runs in a few stages:
1. The usual build and run of unit tests/feature tests, packaging verification, and whatnot. This phase now also picks up and packs anything required for running tests in Helix into an artifact. (It also unifies the artifact name between the things Helix needs and the existing build outputs into the single `drop` artifact to make life a little easier.)
2. The Helix preparation build runs that picks up those artifacts, generates all the scripts required for Helix to understand the test modules/functions from our existing TAEF tests, packs it all up, and queues it on the Helix pool.
3. Helix generates a VM for our testing environment and runs all the TAEF tests that require it. The orchestrator at helix.dot.net watches over this and tracks the success/fail and progress of each module and function. The scripts from our MUX friends handle installing dependencies, making the system quiet for better reliability, detecting flaky tests and rerunning them, and coordinating all the log uploads (including for the subruns of tests that are re-run.)
4. A final build phase is run to look through the results with the Helix API and clean up the marking of tests that are flaky, link all the screenshots and console output logs into the AzDO tests panel, and other such niceities.

We are set to run Helix tests on the Feature test policy of only x64 for now. 

Additionally, because the set up of the Helix VMs takes so long, we are *NOT* running these in PR trigger right now as I believe we all very much value our 15ish minute PR turnaround (and the VM takes another 15 minutes to just get going for whatever reason.) For now, they will only run as a rolling build on master after PRs are merged. We should still know when there's an issue within about an hour of something merging and multiple PRs merging fast will be done on the rolling build as a batch run (not one per).

In addition to setting up the entire Helix testing pipeline for the tests that require it, I've preserved our classic way of running unit and feature tests (that don't require an elaborate environment) directly on the build machines. But with one bonus feature... They now use some of the scripts from MUX to transform their log data and report it to AzDO so it shows up beautifully in the build report. (We used to have this before I removed the MStest/VStest wrapper for performance reasons, but now we can have reporting AND performance!) See https://dev.azure.com/ms/terminal/_build/results?buildId=101654&view=ms.vss-test-web.build-test-results-tab for an example. 

I explored running all of the tests on Helix but.... the Helix setup time is long and the resources are more expensive. I felt it was better to preserve the "quick signal" by continuing to run these directly on the build machine (and skipping the more expensive/slow Helix setup if they fail.) It also works well with the split between PR builds not running Helix and the rolling build running Helix. PR builds will get a good chunk of tests for a quick turn around and the rolling build will finish the more thorough job a bit more slowly.

## Validation Steps Performed
- [x] Ran the updated pipelines with Pull Request configuration ensuring that Helix tests don't run in the usual CI
- [x] Ran with simulation of the rolling build to ensure that the tests now running in Helix will pass. All failures marked for follow on in reference issues.
  • Loading branch information
miniksa committed Aug 18, 2020
1 parent 97c52c6 commit 5d082ff
Show file tree
Hide file tree
Showing 40 changed files with 2,299 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/actions/spell-check/dictionary/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ EXPCMDFLAGS
EXPCMDSTATE
fullkbd
futex
Hashtable
href
IAsync
IBind
Expand Down Expand Up @@ -41,10 +42,13 @@ rfind
roundf
RSHIFT
rx
serializer
SIZENS
spsc
STDCPP
syscall
tmp
tx
userenv
XDocument
XElement
19 changes: 19 additions & 0 deletions .github/actions/spell-check/dictionary/microsoft.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
ACLs
altform
appendwttlogging
backplating
DACL
DACLs
dotnetfeed
DWINRT
enablewttlogging
LKG
mfcribbon
microsoft
microsoftonline
netcore
osgvsowi
pgc
pgo
pgosweep
powerrename
powershell
pscustomobject
robocopy
SACLs
Shobjidl
Skype
sysnative
systemroot
taskkill
tasklist
tdbuildteamid
vcruntime
visualstudio
wlk
wslpath
wtl
wtt
wttlog

This file was deleted.

3 changes: 3 additions & 0 deletions .github/actions/spell-check/expect/alphabet.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
abcd
abcde
abcdef
ABCDEFG
Expand All @@ -10,6 +11,8 @@ abcdefghijklmnopqrstuvwxyz
ABE
BBGGRR
BBBBBBBBBBBBBBDDDD
EFG
EFGh
QQQQQQQQQQABCDEFGHIJ
QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQ
QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQQ
Expand Down
35 changes: 35 additions & 0 deletions .github/actions/spell-check/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ABCDEFGHIJKLMNO
ABCG
abf
abi
ACCESSTOKEN
acec
acf
acidev
Expand All @@ -23,6 +24,7 @@ addressof
ADDSTRING
ADDTOOL
AEnd
aef
AFew
AFill
AFX
Expand Down Expand Up @@ -71,6 +73,7 @@ apps
APPWINDOW
appx
appxbundle
appxerror
appxmanifest
APrep
apsect
Expand Down Expand Up @@ -188,6 +191,7 @@ buffersize
buflen
bugfix
buildtransitive
BUILDURI
burriter
BValue
byref
Expand Down Expand Up @@ -293,6 +297,7 @@ codepage
codepoint
codeproject
COINIT
COLLECTIONURI
colorizing
colororacle
colorref
Expand Down Expand Up @@ -507,6 +512,7 @@ dealloc
debian
debolden
debounce
debugbreak
DECALN
DECANM
DECAUPSS
Expand Down Expand Up @@ -594,6 +600,7 @@ df
DFactory
DFMT
dh
dhandler
dialogbox
diffing
DINLINE
Expand All @@ -616,6 +623,8 @@ dllmain
DLLVERSIONINFO
DLOAD
DLOOK
dmp
dnceng
DOCTYPE
docx
DONTCARE
Expand All @@ -638,6 +647,7 @@ DROPDOWNLIST
DROPFILES
drv
dsm
dst
DSwap
DTest
dtor
Expand Down Expand Up @@ -680,6 +690,7 @@ Elems
elif
elseif
emacs
EMPTYBOX
enabledelayedexpansion
endian
endif
Expand All @@ -703,6 +714,7 @@ errno
errorlevel
esa
ETB
etcoreapp
ETW
ETX
EUDC
Expand Down Expand Up @@ -885,6 +897,7 @@ GETWHEELSCROLLCHARACTERS
GETWHEELSCROLLCHARS
GETWHEELSCROLLLINES
getwriter
GFEh
Gfun
gfx
gh
Expand Down Expand Up @@ -1150,6 +1163,7 @@ iwch
IWin
IWindow
IXaml
IXMP
jconcpp
JOBOBJECT
JOBOBJECTINFOCLASS
Expand Down Expand Up @@ -1232,6 +1246,7 @@ linputfile
Linq
linux
listbox
listproperties
listptr
listptrsize
lk
Expand All @@ -1252,6 +1267,7 @@ locstudio
Loewen
LOGFONT
LOGFONTW
logissue
Loremipsumdolorsitamet
lowercased
loword
Expand Down Expand Up @@ -1376,6 +1392,7 @@ mimetype
mincore
mindbogglingly
mingw
minimizeall
minkernel
minwin
minwindef
Expand Down Expand Up @@ -1537,6 +1554,7 @@ NOYIELD
NOZORDER
NPM
npos
nrcs
NSTATUS
ntapi
ntcon
Expand Down Expand Up @@ -1779,6 +1797,7 @@ prect
prefast
prefilled
prefs
preinstalled
PRELOAD
PREMULTIPLIED
prepopulated
Expand Down Expand Up @@ -1924,6 +1943,7 @@ REGSTR
reingest
Relayout
RELBINPATH
Remoting
renderengine
rendersize
reparent
Expand All @@ -1939,6 +1959,7 @@ resheader
resizable
resmimetype
restrictedcapabilities
restrictederrorinfo
resw
resx
retval
Expand Down Expand Up @@ -1979,6 +2000,7 @@ roundtrip
rparen
RRF
RRRGGGBB
rsas
rtcore
RTEXT
rtf
Expand All @@ -1995,6 +2017,7 @@ runformat
runft
RUNFULLSCREEN
runsettings
runtests
runtimeclass
runuia
runut
Expand Down Expand Up @@ -2037,6 +2060,7 @@ SCROLLSCALE
SCROLLSCREENBUFFER
Scrollup
Scrolluppage
Scs
scursor
sddl
sdeleted
Expand Down Expand Up @@ -2142,6 +2166,7 @@ SND
SOLIDBOX
Solutiondir
somefile
SOURCEBRANCH
sourced
SOURCESDIRECTORY
SPACEBAR
Expand Down Expand Up @@ -2215,6 +2240,7 @@ subspan
substr
subsystemconsole
subsystemwindows
suiteless
svg
swapchain
swapchainpanel
Expand Down Expand Up @@ -2266,6 +2292,7 @@ tcommandline
tcommands
tcon
TDP
TEAMPROJECT
tearoff
Teb
techcommunity
Expand All @@ -2280,6 +2307,7 @@ TERMINALSCROLLING
terminfo
TEs
testapp
testbuildplatform
testcon
testd
testdlls
Expand All @@ -2288,11 +2316,15 @@ testlab
testlist
testmd
testmddefinition
testmode
testname
testnameprefix
TESTNULL
testpass
testpasses
testtestabc
testtesttesttesttest
testtimeout
TEXCOORD
texel
TExpected
Expand Down Expand Up @@ -2449,6 +2481,7 @@ unpause
Unregister
Unregistering
unte
untests
untextured
untimes
UPDATEDISPLAY
Expand Down Expand Up @@ -2682,6 +2715,7 @@ WNull
workarea
workaround
workflow
workitem
wostream
WOutside
WOWARM
Expand Down Expand Up @@ -2770,6 +2804,7 @@ XSubstantial
xtended
xterm
XTest
xunit
xutr
xvalue
XVIRTUALSCREEN
Expand Down
5 changes: 5 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

<!-- Use our own NuGet Feed -->
<add key="TerminalDependencies" value="https://pkgs.dev.azure.com/ms/terminal/_packaging/TerminalDependencies/nuget/v3/index.json" />

<!-- Temporarily? use the feeds from our friends in MUX for Helix test stuff -->
<add key="dotnetfeed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dnceng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="MUX-Dependencies" value="https://pkgs.dev.azure.com/ms/microsoft-ui-xaml/_packaging/MUX-Dependencies/nuget/v3/index.json" />

<!-- Internal NuGet feeds that may not be accessible outside Microsoft corporate network -->
<!--<add key="TAEF - internal" value="https://microsoft.pkgs.visualstudio.com/DefaultCollection/_packaging/Taef/nuget/v3/index.json" />
Expand Down
32 changes: 32 additions & 0 deletions build/Helix/AzurePipelinesHelperScripts.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function GetAzureDevOpsBaseUri
{
Param(
[string]$CollectionUri,
[string]$TeamProject
)

return $CollectionUri + $TeamProject
}

function GetQueryTestRunsUri
{
Param(
[string]$CollectionUri,
[string]$TeamProject,
[string]$BuildUri,
[switch]$IncludeRunDetails
)

if ($IncludeRunDetails)
{
$includeRunDetailsParameter = "&includeRunDetails=true"
}
else
{
$includeRunDetailsParameter = ""
}

$baseUri = GetAzureDevOpsBaseUri -CollectionUri $CollectionUri -TeamProject $TeamProject
$queryUri = "$baseUri/_apis/test/runs?buildUri=$BuildUri$includeRunDetailsParameter&api-version=5.0"
return $queryUri
}
Loading

0 comments on commit 5d082ff

Please sign in to comment.