From 512a9eac47840518b1a45eb3d4459ac386ac3833 Mon Sep 17 00:00:00 2001 From: Petr Date: Wed, 19 Apr 2023 14:42:10 +0200 Subject: [PATCH 01/25] An extra integration test for GTD --- eng/Versions.props | 2 +- .../GoToDefinitionTests.cs | 56 ++++++++++++ .../InProcess/SolutionExplorerInProcess.cs | 32 ------- .../SolutionExplorerInProcess_Files.cs | 88 +++++++++++++++++++ 4 files changed, 145 insertions(+), 33 deletions(-) create mode 100644 vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess_Files.cs diff --git a/eng/Versions.props b/eng/Versions.props index 8cb0ebaf00a..9a57897d2ad 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -160,7 +160,7 @@ $(VisualStudioEditorPackagesVersion) $(VisualStudioEditorPackagesVersion) 5.6.0 - 0.1.149-beta + 0.1.169-beta $(MicrosoftVisualStudioExtensibilityTestingVersion) $(MicrosoftVisualStudioExtensibilityTestingVersion) diff --git a/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs b/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs index debbdf12029..66bb33eccd9 100644 --- a/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs +++ b/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs @@ -35,4 +35,60 @@ module Test Assert.Contains(expectedText, actualText); } + + [IdeFact] + public async Task FsiAndFsFilesGoToCorrespondentDefinitions() + { + var template = WellKnownProjectTemplates.FSharpNetCoreClassLibrary; + + var fsi = """ +module Module + +type SomeType = +| Number of int +| Letter of char + +val id: t: SomeType -> SomeType +"""; + var fs = """ +module Module + +type SomeType = + | Number of int + | Letter of char + +let id (t: SomeType) = t +"""; + + await SolutionExplorer.CreateSingleProjectSolutionAsync("Library", template, TestToken); + await SolutionExplorer.RestoreNuGetPackagesAsync(TestToken); + + // hack: when asked to add a file, VS API seems to insert it in the alphabetical order + // so adding Module.fsi and Module.fs we'll end up having signature file below the code file + // and this won't work. But it's possible to achieve having the right file order via their renaming + await SolutionExplorer.AddFileAsync("Library", "AModule.fsi", fsi, TestToken); + await SolutionExplorer.AddFileAsync("Library", "Module.fs", fs, TestToken); + await SolutionExplorer.RenameFileAsync("Library", "AModule.fsi", "Module.fsi", TestToken); + await SolutionExplorer.BuildSolutionAsync(TestToken); + + await SolutionExplorer.OpenFileAsync("Library", "Module.fsi", TestToken); + await Editor.PlaceCaretAsync("SomeType ->", TestToken); + await Shell.ExecuteCommandAsync(VSStd97CmdID.GotoDefn, TestToken); + var expectedText = "type SomeType ="; + var expectedWindow = "Module.fsi"; + var actualText = await Editor.GetCurrentLineTextAsync(TestToken); + var actualWindow = await Shell.GetActiveWindowCaptionAsync(TestToken); + Assert.Equal(expectedText, actualText); + Assert.Equal(expectedWindow, actualWindow); + + await SolutionExplorer.OpenFileAsync("Library", "Module.fs", TestToken); + await Editor.PlaceCaretAsync("SomeType)", TestToken); + await Shell.ExecuteCommandAsync(VSStd97CmdID.GotoDefn, TestToken); + expectedText = "type SomeType ="; + expectedWindow = "Module.fs"; + actualText = await Editor.GetCurrentLineTextAsync(TestToken); + actualWindow = await Shell.GetActiveWindowCaptionAsync(TestToken); + Assert.Equal(expectedText, actualText); + Assert.Equal(expectedWindow, actualWindow); + } } \ No newline at end of file diff --git a/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess.cs b/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess.cs index 4597c3bffb7..e1836606f58 100644 --- a/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess.cs +++ b/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess.cs @@ -35,25 +35,6 @@ public async Task CreateSolutionAsync(string solutionName, CancellationToken can var solutionPath = CreateTemporaryPath(); await CreateSolutionAsync(solutionPath, solutionName, cancellationToken); } - - public async Task OpenFileAsync(string projectName, string relativeFilePath, CancellationToken cancellationToken) - { - await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - - var filePath = await GetAbsolutePathForProjectRelativeFilePathAsync(projectName, relativeFilePath, cancellationToken); - if (!File.Exists(filePath)) - { - throw new FileNotFoundException(filePath); - } - - VsShellUtilities.OpenDocument(ServiceProvider.GlobalProvider, filePath, VSConstants.LOGVIEWID.Code_guid, out _, out _, out _, out var view); - - // Reliably set focus using NavigateToLineAndColumn - var textManager = await GetRequiredGlobalServiceAsync(cancellationToken); - ErrorHandler.ThrowOnFailure(view.GetBuffer(out var textLines)); - ErrorHandler.ThrowOnFailure(view.GetCaretPos(out var line, out var column)); - ErrorHandler.ThrowOnFailure(textManager.NavigateToLineAndColumn(textLines, VSConstants.LOGVIEWID.Code_guid, line, column, line, column)); - } private async Task CreateSolutionAsync(string solutionPath, string solutionName, CancellationToken cancellationToken) { @@ -207,19 +188,6 @@ private string CreateTemporaryPath() return Path.Combine(Path.GetTempPath(), "fsharp-test", Path.GetRandomFileName()); } - private async Task GetAbsolutePathForProjectRelativeFilePathAsync(string projectName, string relativeFilePath, CancellationToken cancellationToken) - { - await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - - var dte = await GetRequiredGlobalServiceAsync(cancellationToken); - var solution = dte.Solution; - Assumes.Present(solution); - - var project = solution.Projects.Cast().First(x => x.Name == projectName); - var projectPath = Path.GetDirectoryName(project.FullName); - return Path.Combine(projectPath, relativeFilePath); - } - private async Task GetProjectAsync(string nameOrFileName, CancellationToken cancellationToken) { await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); diff --git a/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess_Files.cs b/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess_Files.cs new file mode 100644 index 00000000000..f639decdb82 --- /dev/null +++ b/vsintegration/tests/FSharp.Editor.IntegrationTests/InProcess/SolutionExplorerInProcess_Files.cs @@ -0,0 +1,88 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio.TextManager.Interop; +using Microsoft.VisualStudio.Threading; +using Task = System.Threading.Tasks.Task; + +namespace Microsoft.VisualStudio.Extensibility.Testing; + +internal partial class SolutionExplorerInProcess +{ + public async Task OpenFileAsync(string projectName, string relativeFilePath, CancellationToken cancellationToken) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + + var filePath = await GetAbsolutePathForProjectRelativeFilePathAsync(projectName, relativeFilePath, cancellationToken); + if (!File.Exists(filePath)) + { + throw new FileNotFoundException(filePath); + } + + VsShellUtilities.OpenDocument(ServiceProvider.GlobalProvider, filePath, VSConstants.LOGVIEWID.Code_guid, out _, out _, out _, out var view); + + // Reliably set focus using NavigateToLineAndColumn + var textManager = await GetRequiredGlobalServiceAsync(cancellationToken); + ErrorHandler.ThrowOnFailure(view.GetBuffer(out var textLines)); + ErrorHandler.ThrowOnFailure(view.GetCaretPos(out var line, out var column)); + ErrorHandler.ThrowOnFailure(textManager.NavigateToLineAndColumn(textLines, VSConstants.LOGVIEWID.Code_guid, line, column, line, column)); + } + + public async Task AddFileAsync(string projectName, string fileName, string contents, CancellationToken cancellationToken) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + + var project = await GetProjectAsync(projectName, cancellationToken); + var projectDirectory = Path.GetDirectoryName(project.FullName); + var filePath = Path.Combine(projectDirectory, fileName); + var directoryPath = Path.GetDirectoryName(filePath); + + Directory.CreateDirectory(directoryPath); + File.WriteAllText(filePath, contents); + + _ = project.ProjectItems.AddFromFile(filePath); + } + + public async Task RenameFileAsync(string projectName, string oldFileName, string newFileName, CancellationToken cancellationToken) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + var projectItem = await GetProjectItemAsync(projectName, oldFileName, cancellationToken); + + projectItem.Name = newFileName; + } + + private async Task GetAbsolutePathForProjectRelativeFilePathAsync(string projectName, string relativeFilePath, CancellationToken cancellationToken) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + + var dte = await GetRequiredGlobalServiceAsync(cancellationToken); + var solution = dte.Solution; + + var project = solution.Projects.Cast().First(x => x.Name == projectName); + var projectPath = Path.GetDirectoryName(project.FullName); + return Path.Combine(projectPath, relativeFilePath); + } + + private async Task GetProjectItemAsync(string projectName, string relativeFilePath, CancellationToken cancellationToken) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + + var solution = (await GetRequiredGlobalServiceAsync(cancellationToken)).Solution; + var projects = solution.Projects.Cast(); + var project = projects.FirstOrDefault(x => x.Name == projectName); + var projectPath = Path.GetDirectoryName(project.FullName); + var fullFilePath = Path.Combine(projectPath, relativeFilePath); + var projectItems = project.ProjectItems.Cast(); + var document = projectItems.FirstOrDefault(d => d.get_FileNames(1).Equals(fullFilePath)); + + return document; + } +} From 6010d6057bf0e750014c57ec85b26dc9da549a41 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 13:19:08 +0200 Subject: [PATCH 02/25] breaking commit --- .../tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs b/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs index 66bb33eccd9..c9d11228116 100644 --- a/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs +++ b/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs @@ -33,6 +33,7 @@ module Test await Shell.ExecuteCommandAsync(VSStd97CmdID.GotoDefn, TestToken); var actualText = await Editor.GetCurrentLineTextAsync(TestToken); + Assert.True(false); Assert.Contains(expectedText, actualText); } From 5d7fa60dd8b29a17f923145943b54db147822dd1 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 15:47:58 +0200 Subject: [PATCH 03/25] up --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e29238876e9..ccb8f4864d9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -355,6 +355,7 @@ stages: inttests_release: _configuration: Release _testKind: testIntegration + continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} steps: - checkout: self clean: true From 68e1da23f579fa689cfdd76092e7b5dd1b012fcc Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 15:53:17 +0200 Subject: [PATCH 04/25] up2 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ccb8f4864d9..afe5a701e80 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -319,6 +319,7 @@ stages: enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp + continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} jobs: # Windows With Compressed Metadata @@ -355,7 +356,6 @@ stages: inttests_release: _configuration: Release _testKind: testIntegration - continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} steps: - checkout: self clean: true From 74d23b3af8e16ab1becbf5c151d712473ac9a180 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 18:34:57 +0200 Subject: [PATCH 05/25] test --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index afe5a701e80..772e78e8971 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -319,7 +319,6 @@ stages: enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp - continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} jobs: # Windows With Compressed Metadata @@ -356,6 +355,7 @@ stages: inttests_release: _configuration: Release _testKind: testIntegration + steps: - checkout: self clean: true @@ -366,7 +366,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} + continueOnError: true - task: PublishTestResults@2 displayName: Publish Test Results inputs: From b87d42f0e01e2912587c4e28627f32d75d5755e9 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 19:30:34 +0200 Subject: [PATCH 06/25] test --- azure-pipelines.yml | 3 +-- eng/Build.ps1 | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 772e78e8971..c5b5f7511d1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -355,7 +355,6 @@ stages: inttests_release: _configuration: Release _testKind: testIntegration - steps: - checkout: self clean: true @@ -366,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: true + condition: and(succeededOrFailed(), eq(variables['_testKind'], 'testIntegration')) - task: PublishTestResults@2 displayName: Publish Test Results inputs: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 0604cec4cef..ff92b6c0357 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -639,6 +639,7 @@ try { } if ($testIntegration) { + Write-Error 'Pipeline failed due to intentional error.' TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" } From d8e6d04f7dd6ddf2e6da2026a4915ef96f4aabcb Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 19:45:24 +0200 Subject: [PATCH 07/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c5b5f7511d1..e29238876e9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - condition: and(succeededOrFailed(), eq(variables['_testKind'], 'testIntegration')) + continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} - task: PublishTestResults@2 displayName: Publish Test Results inputs: From b9c0c346889bafc00545dc802f8309c49bbfe74e Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 21:11:26 +0200 Subject: [PATCH 08/25] UP --- azure-pipelines.yml | 10 ++++++++-- eng/Build.ps1 | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e29238876e9..48ca2a55ba3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -362,10 +362,16 @@ stages: - powershell: eng\SetupVSHive.ps1 displayName: Setup VS Hive condition: or(eq(variables['_testKind'], 'testVs'), eq(variables['_testKind'], 'testIntegration')) - + - script: | + if [ "$( _testKind )" == "testIntegration" ]; then + echo "##vso[task.setvariable variable=shouldContinueOnError]true" + else + echo "##vso[task.setvariable variable=shouldContinueOnError]false" + fi + displayName: 'Set continueOnError value based on _testKind' - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} + continueOnError: $(shouldContinueOnError) - task: PublishTestResults@2 displayName: Publish Test Results inputs: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index ff92b6c0357..c56d0e90601 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -471,6 +471,10 @@ function EnablePreviewSdks() { } try { + if ($testIntegration) { + Write-Error 'Pipeline failed due to intentional error.' + } + $script:BuildCategory = "Build" $script:BuildMessage = "Failure preparing build" @@ -639,7 +643,6 @@ try { } if ($testIntegration) { - Write-Error 'Pipeline failed due to intentional error.' TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" } From 4f06c795c0794ba3efd64791a29947f9ac9b1816 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 21:29:43 +0200 Subject: [PATCH 09/25] up --- azure-pipelines.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48ca2a55ba3..fa4f2f1466e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -362,16 +362,14 @@ stages: - powershell: eng\SetupVSHive.ps1 displayName: Setup VS Hive condition: or(eq(variables['_testKind'], 'testVs'), eq(variables['_testKind'], 'testIntegration')) - - script: | - if [ "$( _testKind )" == "testIntegration" ]; then - echo "##vso[task.setvariable variable=shouldContinueOnError]true" - else - echo "##vso[task.setvariable variable=shouldContinueOnError]false" - fi - displayName: 'Set continueOnError value based on _testKind' + + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + displayName: Build / Test + condition: ne(variables['_testKind'], 'testIntegration') - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: $(shouldContinueOnError) + continueOnError: true + condition: eq(variables['_testKind'], 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From eafe3ea8ee8df849246fa924455c22e11cdb858d Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 21:57:11 +0200 Subject: [PATCH 10/25] up --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa4f2f1466e..e86268bd3bd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -366,10 +366,10 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test condition: ne(variables['_testKind'], 'testIntegration') - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) - displayName: Build / Test - continueOnError: true - condition: eq(variables['_testKind'], 'testIntegration') + - ${{ if eq(variables['_testKind'], 'testIntegration') }}: + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + displayName: Build / Test + continueOnError: true - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 7a07fd108d51f4e551f3e55a935ebf5a7d8682ef Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:16:06 +0200 Subject: [PATCH 11/25] up --- azure-pipelines.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e86268bd3bd..9e04e7dfe13 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,11 +365,8 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - condition: ne(variables['_testKind'], 'testIntegration') - - ${{ if eq(variables['_testKind'], 'testIntegration') }}: - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) - displayName: Build / Test - continueOnError: true + continueOnError: $(buildConfiguration) + continueOnError: eq(variables._testKind, 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From c49e7ed7d62db6d9fa45589329d044f0b99ffccf Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:16:12 +0200 Subject: [PATCH 12/25] up --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9e04e7dfe13..78c674e5f58 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,6 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: $(buildConfiguration) continueOnError: eq(variables._testKind, 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results From ae06af7fed095d1b06d6bba6df00c110a733cd9b Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:21:32 +0200 Subject: [PATCH 13/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 78c674e5f58..9dfcb8deb7e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: eq(variables._testKind, 'testIntegration') + continueOnError: eq($(_testKind), 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 88d706316c51b867bfcee28448febfb9e23cc5f5 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:22:50 +0200 Subject: [PATCH 14/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9dfcb8deb7e..300b5414d42 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: eq($(_testKind), 'testIntegration') + continueOnError: eq(variables['_testKind'], 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 32a5bc7fece5400a2fd00f1d645da0d910ada2cf Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:25:34 +0200 Subject: [PATCH 15/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 300b5414d42..7b6c8d37c24 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: eq(variables['_testKind'], 'testIntegration') + condition: eq(variables['_testKind'], 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 334278234aed2e1e939f1239148d012cab180590 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:27:01 +0200 Subject: [PATCH 16/25] hm --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7b6c8d37c24..300b5414d42 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - condition: eq(variables['_testKind'], 'testIntegration') + continueOnError: eq(variables['_testKind'], 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 1a0546de264518e7df277343de60300a115ea91e Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:32:11 +0200 Subject: [PATCH 17/25] try --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 300b5414d42..1ed485b0337 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: eq(variables['_testKind'], 'testIntegration') + continueOnError: variables['_testKind'] == 'testIntegration' - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 7b300a15acd2de5df41d38d926ae2ff82a57dc6f Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:34:03 +0200 Subject: [PATCH 18/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ed485b0337..4606651e909 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: variables['_testKind'] == 'testIntegration' + continueOnError: "eq(variables['_testKind'], 'testIntegration')" - task: PublishTestResults@2 displayName: Publish Test Results inputs: From b332be87850f3b79395a982951e270061461a579 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:39:36 +0200 Subject: [PATCH 19/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4606651e909..c6b5cbff225 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,7 +365,7 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: "eq(variables['_testKind'], 'testIntegration')" + continueOnError: eq(variables["_testKind"], "testIntegration") - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 72cb56bd30fc9ea6380023cfccc1e6698917ba99 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:51:57 +0200 Subject: [PATCH 20/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c6b5cbff225..56c9f4922a4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -355,6 +355,7 @@ stages: inttests_release: _configuration: Release _testKind: testIntegration + continueOnError: eq(variables['_testKind'], 'testIntegration') steps: - checkout: self clean: true @@ -365,7 +366,6 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - continueOnError: eq(variables["_testKind"], "testIntegration") - task: PublishTestResults@2 displayName: Publish Test Results inputs: From f301b9fe237c596937c56d55e2707b6ebedeee8b Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:54:40 +0200 Subject: [PATCH 21/25] up --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 56c9f4922a4..bda58246b09 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -319,6 +319,7 @@ stages: enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp + continueOnError: eq(variables['_testKind'], 'testIntegration') jobs: # Windows With Compressed Metadata @@ -355,7 +356,6 @@ stages: inttests_release: _configuration: Release _testKind: testIntegration - continueOnError: eq(variables['_testKind'], 'testIntegration') steps: - checkout: self clean: true From 1e53497155082faaea940642453d582734b8b9aa Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:56:32 +0200 Subject: [PATCH 22/25] up --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bda58246b09..f86e217a3b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -206,6 +206,7 @@ stages: enableSourceBuild: false enableTelemetry: true helixRepo: dotnet/fsharp + continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} jobs: # Determinism, we want to run it only in PR builds - job: Determinism_Debug From 6d33c67a676c093c6e0b6d8db28d56525492f31d Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 22:58:43 +0200 Subject: [PATCH 23/25] up --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f86e217a3b2..d1713b347d9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -206,7 +206,6 @@ stages: enableSourceBuild: false enableTelemetry: true helixRepo: dotnet/fsharp - continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} jobs: # Determinism, we want to run it only in PR builds - job: Determinism_Debug @@ -320,7 +319,7 @@ stages: enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp - continueOnError: eq(variables['_testKind'], 'testIntegration') + continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} jobs: # Windows With Compressed Metadata From e5d7db49879b8df7efc404e80cd0aec625d8fcff Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 20 Apr 2023 23:24:04 +0200 Subject: [PATCH 24/25] up --- azure-pipelines.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1713b347d9..4021449c8aa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -319,7 +319,6 @@ stages: enableSourceBuild: true enableTelemetry: true helixRepo: dotnet/fsharp - continueOnError: ${{ eq(variables['_testKind'], 'testIntegration') }} jobs: # Windows With Compressed Metadata @@ -366,6 +365,11 @@ stages: - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test + condition: ne(variables['_testKind'], 'testIntegration') + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + displayName: Build / Integration Test + continueOnError: true + condition: eq(variables['_testKind'], 'testIntegration') - task: PublishTestResults@2 displayName: Publish Test Results inputs: From 44f8c2b989c6dd4b500553bbfdc8f586b8c9e863 Mon Sep 17 00:00:00 2001 From: Petr Date: Fri, 21 Apr 2023 13:07:43 +0200 Subject: [PATCH 25/25] up --- azure-pipelines.yml | 2 ++ eng/Build.ps1 | 4 ---- .../FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4021449c8aa..9e8a716978b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -363,6 +363,7 @@ stages: displayName: Setup VS Hive condition: or(eq(variables['_testKind'], 'testVs'), eq(variables['_testKind'], 'testIntegration')) + # yes, this is miserable, but - https://github.com/dotnet/arcade/issues/13239 - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test condition: ne(variables['_testKind'], 'testIntegration') @@ -370,6 +371,7 @@ stages: displayName: Build / Integration Test continueOnError: true condition: eq(variables['_testKind'], 'testIntegration') + - task: PublishTestResults@2 displayName: Publish Test Results inputs: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index c56d0e90601..0604cec4cef 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -471,10 +471,6 @@ function EnablePreviewSdks() { } try { - if ($testIntegration) { - Write-Error 'Pipeline failed due to intentional error.' - } - $script:BuildCategory = "Build" $script:BuildMessage = "Failure preparing build" diff --git a/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs b/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs index c9d11228116..66bb33eccd9 100644 --- a/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs +++ b/vsintegration/tests/FSharp.Editor.IntegrationTests/GoToDefinitionTests.cs @@ -33,7 +33,6 @@ module Test await Shell.ExecuteCommandAsync(VSStd97CmdID.GotoDefn, TestToken); var actualText = await Editor.GetCurrentLineTextAsync(TestToken); - Assert.True(false); Assert.Contains(expectedText, actualText); }