这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
71ab957
improve Peaky tests and environment configuration
jonsequitur Mar 29, 2024
f730def
prebuild console package at app startup
jonsequitur Mar 29, 2024
a54ee36
turn off HTTPS redirection
jonsequitur Apr 1, 2024
fdede36
remove empty cell
jonsequitur Apr 1, 2024
a017473
TrySetException
jonsequitur Apr 2, 2024
a2e508f
cleanup
jonsequitur Apr 2, 2024
8e0050f
improve integration test error output
jonsequitur Apr 2, 2024
ed4652a
remove integration test artifact output from Linux build
jonsequitur Apr 2, 2024
b36aaad
add PocketLogger to integration tests
jonsequitur Apr 4, 2024
3cbcbd6
make Linux integration tests go away
jonsequitur Apr 4, 2024
d428b48
publish all artifacts
jonsequitur Apr 4, 2024
092282d
logging improvements
jonsequitur Apr 4, 2024
4709d30
PocketLogger and logging updates
jonsequitur Apr 5, 2024
748b83c
fix warning
jonsequitur Apr 5, 2024
e07deae
remove separate screenshot publishing step
jonsequitur Apr 6, 2024
6edffd5
Merge branch 'main' into update-peaky-tests-and-add-build-controls
jonsequitur Apr 8, 2024
d21884a
disable PDB converter
jonsequitur Apr 8, 2024
e2035ab
Merge branch 'update-peaky-tests-and-add-build-controls' of https://g…
jonsequitur Apr 8, 2024
ffe90ed
don't publish to symbol server
jonsequitur Apr 8, 2024
8cdd517
update log path
jonsequitur Apr 8, 2024
315f228
Merge branch 'main' into update-peaky-tests-and-add-build-controls
jonsequitur Apr 8, 2024
971d447
remove symbol server parameters
jonsequitur Apr 8, 2024
38f9d49
Pushing up a few changes to see if this helps with investigations
AbhitejJohn Apr 9, 2024
a79d46d
Updating the "signtype=test" set of variables
AbhitejJohn Apr 9, 2024
2709771
Fixing the path?
AbhitejJohn Apr 9, 2024
08556e1
enabling diagnostic logs
AbhitejJohn Apr 9, 2024
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
5 changes: 0 additions & 5 deletions Developer-guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,6 @@
"\n",
"The core of Try .NET is powered by the `CSharpProjectKernel`, which serves as the backend for .NET Interactive."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
22 changes: 12 additions & 10 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Assent" Version="2.3.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
Expand All @@ -12,24 +11,27 @@
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.3" />
<PackageVersion Include="Microsoft.DotNet.Interactive.CSharpProject" Version="1.0.0-beta.24168.2" />
<PackageVersion Include="Microsoft.Playwright" Version="1.41.2" />
<PackageVersion Include="peaky.client" Version="4.0.73" />
<PackageVersion Include="peaky.xunit" Version="4.0.73" />
<PackageVersion Include="Peaky" Version="4.0.77-beta" />
<PackageVersion Include="PocketLogger" Version="0.8.2" />
<PackageVersion Include="Microsoft.DotNet.Interactive.CSharpProject" Version="1.0.0-beta.24205.1" />
<PackageVersion Include="Microsoft.Playwright" Version="1.42.0" />
<PackageVersion Include="peaky.client" Version="4.0.79" />
<PackageVersion Include="peaky.xunit" Version="4.0.79" />
<PackageVersion Include="Peaky" Version="4.0.79-beta" />
<PackageVersion Include="Pocket.Disposable" Version="1.2.0" />
<PackageVersion Include="PocketLogger.For.Xunit" Version="0.9.0" />
<PackageVersion Include="PocketLogger.Subscribe" Version="0.9.0" />
<PackageVersion Include="PocketLogger" Version="0.9.0" />
<PackageVersion Include="Serilog.Sinks.RollingFileAlternate" Version="2.0.9" />
<PackageVersion Include="Serilog" Version="2.10.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.Drawing.Common" Version="8.0.3" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Reactive" Version="6.0.0" />
<PackageVersion Include="System.Security.Cryptography.X509Certificates" Version="4.3.2" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="xunit" Version="2.7.0" />
</ItemGroup>

<ItemGroup Condition="'$(DisableArcade)' == '1'">
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ COPY --from=build-env /App/out .

# Set up to run and expose app on port 80
EXPOSE 80
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://*:80/

# This is a workaround for the fact that the Try .NET website is not yet container-aware
Expand Down
2 changes: 1 addition & 1 deletion PeakyTests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"outputs": [],
"source": [
"var tests = await peakyClient.GetTestsAsync();\n",
"tests"
"tests.Display();"
]
},
{
Expand Down
40 changes: 12 additions & 28 deletions azure-pipelines-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ variables:
value: '8.0.101'
- name: NodeJSVersion
value: '16.13.0'
- name: PocketLoggerLogPath
value: $(Build.SourcesDirectory)/artifacts/logs/pocketlogger.log
- name: TryDotNetPackagesPath
value: $(Build.SourcesDirectory)/artifacts/.trydotnet/packages
- name: RunIntegrationTests
value: true
- name: Codeql.Enabled
value: true

Expand Down Expand Up @@ -86,23 +86,14 @@ extends:
outputParentDirectory: $(Build.SourcesDirectory)/artifacts
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
artifactName: Windows_test_results_and_dumps
displayName: Publish Test results and Blame dumps
condition: failed()
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/bin/Microsoft.TryDotNet.IntegrationTests/$(_BuildConfig)/net8.0/playwright_screenshots
artifactName: Windows_playwright_screenshots
displayName: Publish Playwright screen shots
targetPath: $(Build.SourcesDirectory)/artifacts
artifactName: Windows_artifacts
displayName: Publish Windows artifacts
condition: always()
continueOnError: true
# Packages are not being generated
# - output: pipelineArtifact
# targetPath: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)
# artifactName: packages
# displayName: Publish packages to artifacts container

variables:
- name: RunIntegrationTests
value: true
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Blob-Feed
Expand All @@ -122,10 +113,7 @@ extends:
/p:DotNetPublishToBlobFeed=true
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:PublishToSymbolServer=true
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
Expand Down Expand Up @@ -171,6 +159,7 @@ extends:
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PACKAGES_PATH: $(TryDotNetPackagesPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
Expand Down Expand Up @@ -204,16 +193,10 @@ extends:
outputParentDirectory: $(Build.SourcesDirectory)/artifacts
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
artifactName: Linux_test_results_and_dumps
displayName: Publish Test results and Blame dumps
condition: failed()
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/bin/Microsoft.TryDotNet.IntegrationTests/$(_BuildConfig)/net8.0/playwright_screenshots
artifactName: Linux_playwright_screenshots
displayName: Publish Playwright screen shots
targetPath: $(Build.SourcesDirectory)/artifacts
artifactName: Linux_artifacts
displayName: Publish Linux artifacts
condition: always()
continueOnError: true
variables:
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
Expand Down Expand Up @@ -266,6 +249,7 @@ extends:
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PACKAGES_PATH: $(TryDotNetPackagesPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
Expand Down
50 changes: 16 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ variables:
value: '8.0.101'
- name: NodeJSVersion
value: '16.13.0'
- name: PocketLoggerLogPath
value: $(Build.SourcesDirectory)\artifacts\logs\pocketlogger.log
- name: TryDotNetPackagesPath
value: $(Build.SourcesDirectory)/artifacts/.trydotnet/packages
- name: RunIntegrationTests
value: true
value: $(Build.SourcesDirectory)\artifacts\.trydotnet\packages
- name: Codeql.Enabled
value: true
- name: system.debug
value: true

stages:
- stage: build
Expand All @@ -55,6 +57,8 @@ stages:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2022.amd64
variables:
- name: RunIntegrationTests
value: true
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Blob-Feed
Expand All @@ -78,12 +82,17 @@ stages:
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:PublishToSymbolServer=true
/p:POCKETLOGGER_LOG_PATH=$(PocketLoggerLogPath)
/p:TRYDOTNET_PACKAGES_PATH=$(TryDotNetPackagesPath)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
/p:PublishToSymbolServer=false
/p:POCKETLOGGER_LOG_PATH=$(PocketLoggerLogPath)
/p:TRYDOTNET_PACKAGES_PATH=$(TryDotNetPackagesPath)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths
Expand Down Expand Up @@ -122,8 +131,6 @@ stages:
$(_BuildArgs)
$(_TestArgs)
displayName: Build
env:
TRYDOTNET_PACKAGES_PATH: $(TryDotNetPackagesPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
displayName: Test / Blame
Expand All @@ -138,29 +145,12 @@ stages:
condition: and(ne(variables['KeepDumps'], 'true'), ne(variables['SkipTests'], 'true'))

- task: PublishBuildArtifacts@1
displayName: Publish Test results and Blame dumps
displayName: Publish Windows artifacts
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
artifactName: Windows_test_results_and_dumps
artifactType: container
condition: failed()

- task: PublishBuildArtifacts@1
displayName: Publish Playwright screen shots
inputs:
pathToPublish: $(Build.SourcesDirectory)\artifacts\bin\Microsoft.TryDotNet.IntegrationTests\Release\net8.0\playwright_screenshots
artifactName: Windows_playwright_screenshots
pathToPublish: $(Build.SourcesDirectory)/artifacts/
artifactName: Windows_artifacts
artifactType: container
condition: always()
continueOnError: true

# Packages are not being generated
# - task: PublishBuildArtifacts@1
# displayName: Publish packages to artifacts container
# inputs:
# pathToPublish: $(Build.SourcesDirectory)\artifacts\packages\$(_BuildConfig)
# artifactName: packages
# artifactType: container

- template: /eng/common/templates/jobs/jobs.yml
parameters:
Expand Down Expand Up @@ -225,6 +215,7 @@ stages:
$(_TestArgs)
displayName: Build
env:
POCKETLOGGER_LOG_PATH: $(PocketLoggerLogPath)
TRYDOTNET_PACKAGES_PATH: $(TryDotNetPackagesPath)

- script: dotnet test -l trx --no-build --blame-hang-timeout 15m --blame-hang-dump-type full -c $(_BuildConfig) --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)
Expand All @@ -247,15 +238,6 @@ stages:
artifactType: container
condition: failed()

- task: PublishBuildArtifacts@1
displayName: Publish Playwright screen shots
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/bin/Microsoft.TryDotNet.IntegrationTests/Release/net8.0/playwright_screenshots
artifactName: Linux_playwright_screenshots
artifactType: container
condition: always()
continueOnError: true

#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
#---------------------------------------------------------------------------------------------------------------------#
Expand Down
38 changes: 33 additions & 5 deletions src/Microsoft.TryDotNet.IntegrationTests/AspNetProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Pocket;
using static Pocket.Logger;

namespace Microsoft.TryDotNet.IntegrationTests;

Expand All @@ -16,18 +18,26 @@ public partial class AspNetProcess : IDisposable

public async Task<Uri> Start()
{
using var operation = Log.OnEnterAndConfirmOnExit();

var completionSource = new TaskCompletionSource<Uri>();
var buffer = new StringBuilder();
var uriFound = false;

var allOutput = new StringBuilder();

_process = CommandLine.StartProcess(
"dotnet",
@"Microsoft.TryDotNet.dll --urls=""http://127.0.0.1:0""",
"""
Microsoft.TryDotNet.dll --urls="http://127.0.0.1:0"
""",
new DirectoryInfo(ToolPublishedPath),
output: output =>
{
operation.Info(output);
allOutput.Append(output);

if (!uriFound)
{
buffer.AppendLine(output);
var matches = Regex.Match(output, @"listening on:\s*(?<URI>http(s)?://(\d+\.){3}(\d+)(:\d+)?)");
if (matches.Success)
{
Expand All @@ -39,10 +49,28 @@ public async Task<Uri> Start()
},
error: error =>
{
completionSource.SetException(new Exception(error));
var outputAndError = $"""
{allOutput}

ERROR:
------
{error}
""";

operation.Fail(message: error);

completionSource.TrySetException(new Exception(outputAndError));
});

return (await completionSource.Task.Timeout(TimeSpan.FromMinutes(1), $"ASP.NET Process failed to start. Output =\n{buffer})")).ToLocalHost();
var timeout = Debugger.IsAttached ? TimeSpan.FromDays(1) : TimeSpan.FromMinutes(1);

var readyAtUrl = await completionSource.Task.Timeout(timeout, $"ASP.NET process not ready within {timeout.TotalSeconds}s. Output =\n{allOutput})");

var localHostUrl = readyAtUrl.ToLocalHost();

operation.Succeed();

return localHostUrl;
}

public void Dispose()
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.TryDotNet.IntegrationTests/CommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ private static ConfirmationLogger ConfirmOnExit(
[CallerMemberName] string? operationName = null)
{
return new ConfirmationLogger(
operationName: operationName,
operationName: operationName ?? "",
category: Log.Category,
message: "> {command} {args}",
args: new[] { command, args },
args: [command, args],
logOnStart: true);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
using FluentAssertions;

using Microsoft.Playwright;
using Pocket.For.Xunit;

namespace Microsoft.TryDotNet.IntegrationTests;

[LogToPocketLogger(FileNameEnvironmentVariable = "POCKETLOGGER_LOG_PATH")]
public class EditorTests : PlaywrightTestBase
{
public EditorTests(PlaywrightFixture playwright, TryDotNetFixture tryDotNet) : base(playwright, tryDotNet)
{

}

[IntegrationTestFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ internal class IntegrationTestFactAttribute : FactAttribute
private const string EnvironmentVariableName = "RunIntegrationTests";

public IntegrationTestFactAttribute(string? skipReason = null)

{
var variableValue = Environment.GetEnvironmentVariable(EnvironmentVariableName) ?? "false";
switch (variableValue.ToLowerInvariant())
Expand Down
Loading