这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<PropertyGroup>
<!-- These properties are needed so that version number can be same for MLS.Agent.Tools and the libraries that depend on it -->
<NewtonsoftJsonVersion>13.0.1 </NewtonsoftJsonVersion>
<NewtonsoftJsonVersion>13.0.3 </NewtonsoftJsonVersion>
<PocketLoggerVersion>0.3.0</PocketLoggerVersion>
<SystemDiagnosticsProcessVersion>4.3.0</SystemDiagnosticsProcessVersion>
<SystemReactiveVersion>4.3.2</SystemReactiveVersion>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<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.24256.2" />
<PackageVersion Include="Microsoft.DotNet.Interactive.CSharpProject" Version="1.0.0-beta.24263.1" />
<PackageVersion Include="Microsoft.Playwright" Version="1.42.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="peaky.client" Version="4.0.79" />
Expand All @@ -25,7 +25,7 @@
<PackageVersion Include="Serilog" Version="3.1.1" />
<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.Drawing.Common" Version="8.0.4" />
<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" />
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project>
<PropertyGroup>
<!-- opt-out properties -->
<UsingToolPdbConverter>false</UsingToolPdbConverter>
<UsingToolSourceLink>false</UsingToolSourceLink>
<UsingToolXUnit>false</UsingToolXUnit>
<!-- opt-in properties -->
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
<UsingToolXUnit>false</UsingToolXUnit>
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
<UsingToolPdbConverter>false</UsingToolPdbConverter>
<TestRunnerAdditionalArguments>-parallel none</TestRunnerAdditionalArguments>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Playwright;
using Pocket.For.Xunit;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.TryDotNet.IntegrationTests;
Expand All @@ -21,7 +20,7 @@ public TryDotNetJsIntegrationTests(IntegratedServicesFixture services, ITestOutp
{
}

[IntegrationTestFact]
[IntegrationTestFact(Skip = "Flaky in CI")]
public async Task loads_trydotnet_editor()
{
var page = await NewPageAsync();
Expand All @@ -39,12 +38,11 @@ public async Task loads_trydotnet_editor()
var pageUri = new Uri(QueryHelpers.AddQueryString(new Uri(learnRoot,"DocsHost.html").ToString(), param!));
await page.GotoAsync(pageUri.ToString());
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);


await page.FindEditor();
}

[IntegrationTestFact]
[IntegrationTestFact(Skip = "Flaky in CI")]
public async Task can_load_code()
{
var page = await NewPageAsync();
Expand Down Expand Up @@ -75,7 +73,7 @@ public async Task can_load_code()
text.Should().Contain("Console.WriteLine(123);");
}

[IntegrationTestFact]
[IntegrationTestFact(Skip = "Flaky in CI")]
public async Task outputs_are_rendered()
{
var page = await NewPageAsync();
Expand Down
33 changes: 33 additions & 0 deletions src/Microsoft.TryDotNet/PeakyTests/SelfTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,39 @@ public async Task<Prebuild> Console_prebuild_is_ready()
return prebuild;
}

public async Task<object> Can_get_completions()
{
using var kernel = Program.CreateKernel();

await kernel.SendAsync(new OpenProject(new Project(new[] { new ProjectFile("Program.cs", @"// content will be replaced") })));
await kernel.SendAsync(new OpenDocument("Program.cs"));

var code = """
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Text.RegularExpressions;

C|
""";

var result = await kernel.SendAsync(new RequestCompletions(code.Replace("|", ""), new LinePosition(7, 1)));

result.Events.Should().ContainSingle(e => e is CompletionsProduced);

var completionsProduced = result.Events.OfType<CompletionsProduced>().Single();

completionsProduced.Completions.Should().NotBeEmpty();

return new
{
Count = completionsProduced.Completions.Count(),
CompletionsProduced = completionsProduced
};
}

public async Task Can_get_signature_help()
{
using var kernel = Program.CreateKernel();
Expand Down
6 changes: 6 additions & 0 deletions src/Microsoft.TryDotNet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public static async Task<WebApplication> CreateWebApplicationAsync(WebApplicatio
builder.Services.AddCors(
opts => opts.AddPolicy("trydotnet", policy => policy.AllowAnyOrigin()));

builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});

_consolePrebuild = await Prebuild.GetOrCreateConsolePrebuildAsync(enableBuild: false);

switch (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"))
Expand Down Expand Up @@ -99,6 +104,7 @@ public static async Task<WebApplication> CreateWebApplicationAsync(WebApplicatio
app.UsePeaky();
app.UseStaticFiles();
app.MapFallbackToFile("/wasmrunner/{*path:nonfile}", "wasmrunner/index.html");
app.UseResponseCompression();

app.MapGet("/editor", async (HttpRequest request, HttpResponse response) =>
{
Expand Down