Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
<Import Project="eng\targets\Settings.props" />
<Import Project="eng\targets\NuGet.targets" />


<!-- When Arcade is disabled (e.g. during the test step in CI), replicate the output-path
layout that Arcade would establish so that `dotnet test \-\-no-build` can locate
assemblies that were compiled with Arcade active:
artifacts/bin/<ProjectName>/<Configuration> -->

<PropertyGroup Condition="'$(DisableArcade)' == '1'">
<ArtifactsBinDir>$(MSBuildThisFileDirectory)artifacts\bin\</ArtifactsBinDir>
<BaseOutputPath>$(ArtifactsBinDir)$(MSBuildProjectName)\</BaseOutputPath>
<OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
</PropertyGroup>


<PropertyGroup>
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
Expand Down
4 changes: 2 additions & 2 deletions src/polyglot-notebooks-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"dist"
],
"scripts": {
"compile": "npm run rollup",
"compile": "tsc -p ./ && npm run rollup",
"compile-ci": "rollup -c rollup.config.js --bundleConfigAsCjs",
"test": "mocha tests/**/*.test.ts",
"ciTest": "node ../ensure-testresults-directory.js && npm test -- --reporter mocha-multi-reporters --reporter-options configFile=testConfig.json",
"rollup": "npm run compile-ci -- -i src/index.ts -o dist/dotnet-interactive.js",
"rollup": "npm run compile-ci -- -i dist/index.js -o dist/dotnet-interactive.js",
"watch": "tsc -watch -p ./"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/polyglot-notebooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"url": "https://github.com/dotnet/interactive"
},
"scripts": {
"compile-es-module": "rollup -c rollup.es.config.js -i ./src/webview/activation.ts -o ./dist/activation.js",
"compile-library": "rollup -c rollup.library.config.js -i src/index.ts -o lib/polyglot-notebooks.js",
"compile-es-module": "rollup -c rollup.es.config.js -i ./dist/webview/activation.js -o ./dist/activation.js",
"compile-library": "rollup -c rollup.library.config.js -i dist/index.js -o lib/polyglot-notebooks.js",
"compile": "npm run lint && tsc -p ./ && npm run compile-library && npm run compile-es-module",
"lint": "eslint src --ext ts",
"watch": "tsc -watch -p ./",
Expand Down
37 changes: 26 additions & 11 deletions test-retry-runner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,31 @@ $ErrorActionPreference = "Stop"

if ($IsWindows) {
$projectsToSkip = @(
)
)
}
else
{
$projectsToSkip = @(
"Microsoft.DotNet.Interactive.NetFramework.Tests",
"Microsoft.DotNet.Interactive.NamedPipeConnector.Tests",
"Microsoft.DotNet.Interactive.VisualStudio.Tests"
)
)
}

function ExecuteTestDirectory([string]$testDirectory, [string]$extraArgs = "") {
$testCommand = "dotnet test $testDirectory/ $extraArgs -l trx --no-restore --no-build --blame-hang-timeout 10m --blame-hang-dump-type full --blame-crash -c $buildConfig --results-directory $repoRoot/artifacts/TestResults/$buildConfig"
function Get-SafeFilePart([string]$value) {
if ([string]::IsNullOrWhiteSpace($value)) { return "unknown" }
# Replace characters invalid in filenames and trim long names
$safe = ($value -replace '[<>:"/\\|?*\x00-\x1F]', '_')
if ($safe.Length -gt 120) { $safe = $safe.Substring(0,120) }
return $safe
}

function ExecuteTestDirectory([string]$testDirectory, [string]$extraArgs = "", [string]$trxFileName) {
$resultsDir = Join-Path $repoRoot "artifacts/TestResults/$buildConfig"
New-Item -ItemType Directory -Force -Path $resultsDir | Out-Null

$trxArg = "--logger `"trx;LogFileName=$trxFileName`""
$testCommand = "dotnet test `"$testDirectory/`" $extraArgs $trxArg --no-restore --no-build --blame-hang-timeout 10m --blame-hang-dump-type full --blame-crash -c $buildConfig --results-directory `"$resultsDir`""
Write-Host "Executing $testCommand"
Invoke-Expression $testCommand
}
Expand All @@ -32,9 +44,9 @@ try {
"Microsoft.DotNet.Interactive.Tests",
"Microsoft.DotNet.Interactive.App.Tests",
"Microsoft.DotNet.Interactive.Browser.Tests"
)
$normalTestAssemblyDirectories = Get-ChildItem -Path "$repoRoot/src" -Directory -Filter *.Tests -Recurse | Where-Object { !$flakyTestAssemblyDirectories.contains($_.Name)}
)

$normalTestAssemblyDirectories = Get-ChildItem -Path "$repoRoot/src" -Directory -Filter *.Tests -Recurse | Where-Object { !$flakyTestAssemblyDirectories.contains($_.Name) }

foreach ($testAssemblyDirectory in $normalTestAssemblyDirectories) {
$projectName = $testAssemblyDirectory.Name
Expand All @@ -43,8 +55,9 @@ try {
continue
}
for ($i = 1; $i -le $retryCount; $i++) {
Write-Host "Testing project $projectName, attempt $i"
ExecuteTestDirectory -testDirectory $testAssemblyDirectory
$trxFile = "{0}.attempt{1}.trx" -f (Get-SafeFilePart $projectName), $i
Write-Host "Testing project $projectName, attempt $i (TRX: $trxFile)"
ExecuteTestDirectory -testDirectory $testAssemblyDirectory.FullName -trxFileName $trxFile
if ($LASTEXITCODE -eq 0) {
break
}
Expand All @@ -61,9 +74,11 @@ try {
$distinctTestClasses = $testClasses | Get-Unique

foreach ($testClass in $distinctTestClasses) {
$safeClass = Get-SafeFilePart $testClass
for ($i = 1; $i -le $retryCount; $i++) {
Write-Host "Testing class $testClass, attempt $i"
ExecuteTestDirectory -testDirectory "$repoRoot/src/$flakyTestAssemblyDirectory" -extraArgs "--filter `"FullyQualifiedName~$testClass&Category!=Skip`""
$trxFile = "{0}.{1}.attempt{2}.trx" -f (Get-SafeFilePart $flakyTestAssemblyDirectory), $safeClass, $i
Write-Host "Testing class $testClass, attempt $i (TRX: $trxFile)"
ExecuteTestDirectory -testDirectory "$repoRoot/src/$flakyTestAssemblyDirectory" -extraArgs "--filter `"FullyQualifiedName~$testClass&Category!=Skip`"" -trxFileName $trxFile
if ($LASTEXITCODE -eq 0) {
break
}
Expand Down
Loading