зеркало из https://github.com/dotnet/razor.git
Fix Formatting and On Enter integration tests (#10788)
Since the end of last week, these tests have been failing. Seems like something changed on the platform side, perhaps a default value of a setting. Have started a thread with the editor team to see if we need to do more.
This commit is contained in:
Коммит
156f016fff
|
@ -44,6 +44,9 @@ public abstract class AbstractRazorEditorTest(ITestOutputHelper testOutput) : Ab
|
|||
|
||||
VisualStudioLogging.AddCustomLoggers();
|
||||
|
||||
// Our expected test results have spaces not tabs
|
||||
await TestServices.Shell.SetInsertSpacesAsync(ControlledHangMitigatingCancellationToken);
|
||||
|
||||
_projectFilePath = await CreateAndOpenBlazorProjectAsync(ControlledHangMitigatingCancellationToken);
|
||||
|
||||
await TestServices.SolutionExplorer.RestoreNuGetPackagesAsync(ControlledHangMitigatingCancellationToken);
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualStudio.Razor;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using Microsoft.VisualStudio.TextManager.Interop;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.VisualStudio.Extensibility.Testing;
|
||||
|
||||
|
@ -22,4 +25,16 @@ internal partial class ShellInProcess
|
|||
var documentPath = (string)documentPathObj;
|
||||
return Path.GetFileName(documentPath);
|
||||
}
|
||||
|
||||
public async Task SetInsertSpacesAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var textManager = await GetRequiredGlobalServiceAsync<SVsTextManager, IVsTextManager4>(cancellationToken);
|
||||
|
||||
var langPrefs3 = new LANGPREFERENCES3[] { new LANGPREFERENCES3() { guidLang = RazorConstants.RazorLanguageServiceGuid } };
|
||||
Assert.Equal(VSConstants.S_OK, textManager.GetUserPreferences4(null, langPrefs3, null));
|
||||
|
||||
langPrefs3[0].fInsertTabs = 0;
|
||||
|
||||
Assert.Equal(VSConstants.S_OK, textManager.SetUserPreferences4(null, langPrefs3, null));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,14 @@ internal static class VisualStudioLogging
|
|||
var files = new List<string>();
|
||||
foreach (var feedbackFileProvider in feedbackFileProviders)
|
||||
{
|
||||
files.AddRange(feedbackFileProvider.GetFiles());
|
||||
try
|
||||
{
|
||||
files.AddRange(feedbackFileProvider.GetFiles());
|
||||
}
|
||||
catch
|
||||
{
|
||||
// If one of the providers has issues, we don't want it causing us to not be able to report our stuff properly
|
||||
}
|
||||
}
|
||||
|
||||
_ = CollectFeedbackItemsAsync(files, filePath, expectedFileParts);
|
||||
|
|
Загрузка…
Ссылка в новой задаче