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

See if integration tests pass, and if I got my YAML right #9701

Closed
Closed
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 azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variables:
- name: RAZOR_TRACE
value: 'Verbose'
- name: RunIntegrationTests
value: false
value: true
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNetBuilds storage account read tokens
- name: _InternalRuntimeDownloadArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Test.Common.Logging;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.Editor.Razor.Logging;
using Microsoft.VisualStudio.Razor.IntegrationTests.Extensions;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
Expand All @@ -20,22 +17,25 @@ internal partial class OutputInProcess
{
private const string RazorPaneName = "Razor Logger Output";

public async Task SetupIntegrationTestLoggerAsync(ITestOutputHelper testOutputHelper, CancellationToken cancellationToken)
public Task SetupIntegrationTestLoggerAsync(ITestOutputHelper testOutputHelper, CancellationToken cancellationToken)
{
var logger = await TestServices.Shell.GetComponentModelServiceAsync<IOutputWindowLogger>(cancellationToken);
logger.SetTestLogger(new TestOutputLogger(testOutputHelper));
// var logger = await TestServices.Shell.GetComponentModelServiceAsync<IOutputWindowLogger>(cancellationToken);
// logger.SetTestLogger(new TestOutputLogger(testOutputHelper));
return Task.CompletedTask;
}

public async Task ClearIntegrationTestLoggerAsync(CancellationToken cancellationToken)
public Task ClearIntegrationTestLoggerAsync(CancellationToken cancellationToken)
{
var logger = await TestServices.Shell.GetComponentModelServiceAsync<IOutputWindowLogger>(cancellationToken);
logger.SetTestLogger(null);
// var logger = await TestServices.Shell.GetComponentModelServiceAsync<IOutputWindowLogger>(cancellationToken);
// logger.SetTestLogger(null);
return Task.CompletedTask;
}

public async Task LogStatusAsync(string message, CancellationToken cancellationToken)
public Task LogStatusAsync(string message, CancellationToken cancellationToken)
{
var logger = await TestServices.Shell.GetComponentModelServiceAsync<IOutputWindowLogger>(cancellationToken);
logger.LogInformation(message);
// var logger = await TestServices.Shell.GetComponentModelServiceAsync<IOutputWindowLogger>(cancellationToken);
// logger.LogInformation(message);
return Task.CompletedTask;
}

public async Task<bool> HasErrorsAsync(CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Reflection;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Editor.Razor.Logging;
using Microsoft.VisualStudio.Shell;
Expand All @@ -16,12 +15,12 @@ public class LogIntegrationTestAttribute : BeforeAfterTestAttribute
{
public override void Before(MethodInfo methodUnderTest)
{
GetLogger().LogInformation("#### Integration test start: {method}", methodUnderTest.Name);
// GetLogger().LogInformation("#### Integration test start: {method}", methodUnderTest.Name);
}

public override void After(MethodInfo methodUnderTest)
{
GetLogger().LogInformation("#### Integration test end: {method}", methodUnderTest.Name);
// GetLogger().LogInformation("#### Integration test end: {method}", methodUnderTest.Name);
}

private static IOutputWindowLogger GetLogger()
Expand Down
Loading