From e077aa84ffaf58c51c31a45ffba38cf77153a722 Mon Sep 17 00:00:00 2001 From: tmat Date: Tue, 4 Apr 2023 16:16:46 -0700 Subject: [PATCH 1/2] Use the right version of packages in integration tests. --- src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs b/src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs index 4fcb8fa27..8ff532373 100644 --- a/src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs +++ b/src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs @@ -174,10 +174,13 @@ public DotNetSdkTestBase(params string[] packages) NuGetCacheDir = RootDir.CreateDirectory(".packages"); NuGetPackageFolders = EnsureTrailingDirectorySeparator(NuGetCacheDir.Path); + // {info-version} = {package-version}+{commit-sha} + var packageVersion = typeof(DotNetSdkTestBase).Assembly.GetCustomAttribute()!.InformationalVersion.Split('+')[0]; + RootDir.CreateFile("Directory.Build.props").WriteAllText( $@" - {string.Join(Environment.NewLine, packages.Select(packageName => $""))} + {string.Join(Environment.NewLine, packages.Select(packageName => $""))} "); From 2fba322dcd18ee84d27207eae476e5a30109d871 Mon Sep 17 00:00:00 2001 From: tmat Date: Tue, 4 Apr 2023 17:19:45 -0700 Subject: [PATCH 2/2] Update GitLab integration tests --- src/SourceLink.Git.IntegrationTests/GitLabTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SourceLink.Git.IntegrationTests/GitLabTests.cs b/src/SourceLink.Git.IntegrationTests/GitLabTests.cs index 5707f8d21..ca4d7d99e 100644 --- a/src/SourceLink.Git.IntegrationTests/GitLabTests.cs +++ b/src/SourceLink.Git.IntegrationTests/GitLabTests.cs @@ -51,14 +51,14 @@ public void FullValidation_Https() { NuGetPackageFolders, ProjectSourceRoot, - $"https://噸.com/test-org/{repoName}/raw/{commitSha}/*", + $"https://噸.com/test-org/{repoName}/-/raw/{commitSha}/*", s_relativeSourceLinkJsonPath, $"https://噸.com/test-org/{repoName}", $"https://噸.com/test-org/{repoName}" }); AssertEx.AreEqual( - $@"{{""documents"":{{""{ProjectSourceRoot.Replace(@"\", @"\\")}*"":""https://噸.com/test-org/{repoName}/raw/{commitSha}/*""}}}}", + $@"{{""documents"":{{""{ProjectSourceRoot.Replace(@"\", @"\\")}*"":""https://噸.com/test-org/{repoName}/-/raw/{commitSha}/*""}}}}", File.ReadAllText(Path.Combine(ProjectDir.Path, s_relativeSourceLinkJsonPath))); TestUtilities.ValidateAssemblyInformationalVersion( @@ -109,14 +109,14 @@ public void FullValidation_Ssh() { NuGetPackageFolders, ProjectSourceRoot, - $"https://噸.com/test-org/{repoName}/raw/{commitSha}/*", + $"https://噸.com/test-org/{repoName}/-/raw/{commitSha}/*", s_relativeSourceLinkJsonPath, $"https://噸.com/test-org/{repoName}", $"https://噸.com/test-org/{repoName}" }); AssertEx.AreEqual( - $@"{{""documents"":{{""{ProjectSourceRoot.Replace(@"\", @"\\")}*"":""https://噸.com/test-org/{repoName}/raw/{commitSha}/*""}}}}", + $@"{{""documents"":{{""{ProjectSourceRoot.Replace(@"\", @"\\")}*"":""https://噸.com/test-org/{repoName}/-/raw/{commitSha}/*""}}}}", File.ReadAllText(Path.Combine(ProjectDir.Path, s_relativeSourceLinkJsonPath))); TestUtilities.ValidateAssemblyInformationalVersion( @@ -161,7 +161,7 @@ public void ImplicitHost() }, expectedResults: new[] { - $"http://噸.com/test-org/{repoName}/raw/{commitSha}/*", + $"http://噸.com/test-org/{repoName}/-/raw/{commitSha}/*", $"http://噸.com/test-org/{repoName}", $"http://噸.com/test-org/{repoName}" });