Skip to content

Commit

Permalink
Fix test error, sdk placed in wrong block
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Aug 27, 2024
1 parent a972f3c commit 94be89a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Castle.Core" Version="5.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions NUnit3TestAdapter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
build.cmd = build.cmd
build.ps1 = build.ps1
src\Directory.Build.props = src\Directory.Build.props
Directory.Packages.props = Directory.Packages.props
DisableAppDomain.runsettings = DisableAppDomain.runsettings
LICENSE = LICENSE
src\native-assembly\NativeTests.dll = src\native-assembly\NativeTests.dll
Expand Down
8 changes: 4 additions & 4 deletions src/NUnit.TestAdapter.Tests.Acceptance/AcceptanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ protected string NUnitVersion(string targetFramework) =>
private static readonly Lazy<(IsolatedWorkspaceManager Manager, string NupkgVersion, bool KeepWorkspaces)> Initialization = new(() =>
{
var directory = TestContext.Parameters["ProjectWorkspaceDirectory"]
?? TryAutoDetectProjectWorkspaceDirectory()
?? throw new InvalidOperationException("The test parameter ProjectWorkspaceDirectory must be set in order to run this test.");
?? TryAutoDetectProjectWorkspaceDirectory() // Walks the directory tree up to find the project workspace directory, named ".acceptance"
?? throw new InvalidOperationException("Either The test parameter ProjectWorkspaceDirectory must be set in order to run this test, or the `.acceptance` folder has not been found. Run cmd line `build -t acceptance` first");
var nupkgDirectory = TestContext.Parameters["TestNupkgDirectory"]
?? TryAutoDetectTestNupkgDirectory(NuGetPackageId)
?? throw new InvalidOperationException("The test parameter TestNupkgDirectory must be set in order to run this test.");
?? TryAutoDetectTestNupkgDirectory(NuGetPackageId) // Walks the directory tree up to find the test nupkg directory, named "package"
?? throw new InvalidOperationException("The test parameter TestNupkgDirectory must be set in order to run this test, or the packages have not been created, run cmdline `build -t package` first");
var nupkgVersion = TryGetTestNupkgVersion(nupkgDirectory, packageId: NuGetPackageId)
?? throw new InvalidOperationException($"No NuGet package with the ID {NuGetPackageId} was found in {nupkgDirectory}.");
Expand Down
3 changes: 2 additions & 1 deletion src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ItemGroup>
<PackageReference Include="NSubstitute" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
Expand All @@ -23,7 +24,7 @@

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<PackageReference Include="NUnit" VersionOverride="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />

<PackageReference Include="Microsoft.TestPlatform.ObjectModel" VersionOverride="11.0.0" />
</ItemGroup>

Expand Down

0 comments on commit 94be89a

Please sign in to comment.