Skip to content

Commit 423296c

Browse files
authored
IGNITE-27442 .NET: Disable packing for test projects (#7291)
1 parent d1e163a commit 423296c

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

modules/platforms/dotnet/Apache.Ignite.Tests.Aot/Apache.Ignite.Tests.Aot.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ILLinkTreatWarningsAsErrors>true</ILLinkTreatWarningsAsErrors>
1212
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1313
<WarningsAsErrors>$(WarningsAsErrors);IL3050</WarningsAsErrors>
14+
<IsPackable>false</IsPackable>
1415
</PropertyGroup>
1516

1617
<ItemGroup>

modules/platforms/dotnet/Apache.Ignite.Tests.Common/Apache.Ignite.Tests.Common.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<Nullable>enable</Nullable>
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>Apache.Ignite.Tests.Common.snk</AssemblyOriginatorKeyFile>
9-
<IsTrimmable>true</IsTrimmable>
9+
<IsTrimmable>true</IsTrimmable>
10+
<IsPackable>false</IsPackable>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

modules/platforms/dotnet/Apache.Ignite.Tests/ProjectFilesTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,28 @@ public void TestTodosHaveTickets()
141141
}
142142
}
143143

144+
[Test]
145+
public void TestBenchmarkAndTestProjectsAreNotPackable()
146+
{
147+
foreach (var file in Directory.GetFiles(TestUtils.SolutionDir, "*.csproj", SearchOption.AllDirectories))
148+
{
149+
var fileName = Path.GetFileName(file);
150+
151+
if (!fileName.Contains("Test", StringComparison.OrdinalIgnoreCase) &&
152+
!fileName.Contains("Benchmark", StringComparison.OrdinalIgnoreCase))
153+
{
154+
continue;
155+
}
156+
157+
var text = File.ReadAllText(file);
158+
159+
StringAssert.Contains(
160+
"<IsPackable>false</IsPackable>",
161+
text,
162+
"Test and benchmark projects must not be packable: " + fileName);
163+
}
164+
}
165+
144166
[SuppressMessage("Design", "CA1064:Exceptions should be public", Justification = "Tests.")]
145167
[SuppressMessage("Design", "CA1032:Implement standard exception constructors", Justification = "Tests.")]
146168
private sealed class TodoWithoutTicketException : AssertionException

0 commit comments

Comments
 (0)