Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions changelog.d/unreleased/5121.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 5121
affected:
- tests/CodeIndex.Tests/ExtractorPluginRegistryTests.cs
- tests/CodeIndex.PluginIsolationFixture/PluginIsolationFixture.cs
---

## English

- **Plugin tests no longer depend on the size of `CodeIndex.Tests.dll` (#5121)** — executable extractor-plugin coverage now enforces use of the dedicated bounded `CodeIndex.PluginIsolationFixture` assembly, so growth in the main test assembly cannot exceed the production 4,096-type inspection limit and break the `net9.0` suite.

## 日本語

- **pluginテストが`CodeIndex.Tests.dll`のサイズに依存しなくなりました (#5121)** — 実行可能なextractor pluginのカバレッジで、専用かつ上限内の`CodeIndex.PluginIsolationFixture` assemblyを使うことを保証し、main test assemblyの増加によってproductionの4,096-type検査上限を超えて`net9.0` suiteが失敗しないようにしました。
16 changes: 13 additions & 3 deletions tests/CodeIndex.Tests/ExtractorPluginRegistryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
using CodeIndex.Models;
using CodeIndex.PluginIsolationFixture;

[assembly: CdidxPlugin(ExtractorPluginRegistry.CurrentApiVersion, ExtractorPluginRegistry.CurrentApiVersion)]

namespace CodeIndex.Tests;

[Collection("Plugin registry sensitive")]
Expand All @@ -26,6 +24,18 @@ public ExtractorPluginRegistryTests(TrustedPluginAssemblyFixture trustedPluginAs
internal const string SlowPluginConstructorEnvironmentVariable = PluginIsolationFixtureEnvironment.SlowConstructor;
internal const string CrashingPluginConstructorEnvironmentVariable = PluginIsolationFixtureEnvironment.CrashingConstructor;

[Fact]
public void PluginFixture_IsDedicatedAndBounded_Issue5121()
{
var testAssembly = typeof(ExtractorPluginRegistryTests).Assembly;
var pluginAssembly = typeof(CollectiblePluginSymbolExtractor).Assembly;

Assert.NotSame(testAssembly, pluginAssembly);
Assert.Empty(testAssembly.GetCustomAttributes<CdidxPluginAttribute>());
Assert.Single(pluginAssembly.GetCustomAttributes<CdidxPluginAttribute>());
Assert.InRange(pluginAssembly.GetTypes().Length, 1, ExtractorPluginRegistry.MaxExtensionAssemblyTypes);
}

[Fact]
public void DoctorIntegrations_DoesNotStartConfiguredPluginWorker_Issue5102()
{
Expand Down Expand Up @@ -337,7 +347,7 @@ public void LoadPluginAssemblies_RejectsUnsafeDirectoryModeAndAncestorSymlink_Is
try
{
Directory.CreateDirectory(pluginDirectory);
File.Copy(Assembly.GetExecutingAssembly().Location, Path.Combine(pluginDirectory, "plugin.dll"));
File.Copy(pluginAssemblyFixturePath, Path.Combine(pluginDirectory, "plugin.dll"));

ExtractorPluginRegistry.ResetForTests();
File.SetUnixFileMode(
Expand Down
Loading