Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions are no longer loading as is currently documented #1613

Open
mmalandra-kb4 opened this issue Jan 28, 2025 · 2 comments
Open

Extensions are no longer loading as is currently documented #1613

mmalandra-kb4 opened this issue Jan 28, 2025 · 2 comments

Comments

@mmalandra-kb4
Copy link

NUnit Engine/API versions 3.19.1.

How should extensions be loaded now? With the latest nunit-console (3.19.1) and engines/api, our extensions are no longer loading.

From the source code, you can see a major change here where the code is only looking at specific folders that match hardcoded patterns:

public void FindExtensionAssemblies(Assembly hostAssembly)
{
    log.Info($"FindExtensionAssemblies called for host {hostAssembly.FullName}");

    bool isChocolateyPackage = System.IO.File.Exists(Path.Combine(hostAssembly.Location, "VERIFICATION.txt"));
    string[] extensionPatterns = isChocolateyPackage
        ? new[] { "nunit-extension-*/**/tools/", "nunit-extension-*/**/tools/*/" }
        : new[] { "NUnit.Extension.*/**/tools/", "NUnit.Extension.*/**/tools/*/" };


    IDirectory startDir = _fileSystem.GetDirectory(AssemblyHelper.GetDirectoryName(hostAssembly));

    while (startDir != null)
    {
        foreach (var pattern in extensionPatterns)
            foreach (var dir in _directoryFinder.GetDirectories(startDir, pattern))
                ProcessDirectory(dir, true);

        startDir = startDir.Parent;
    }
}

Does the documentation around loading extensions need to be updated, or is there a way to get engine to allow for other folders to contain extensions?

@mazharenko
Copy link

Is Chocolatey involved in your case? Then have a look at #1614

Addins files must still be supported #1504

@mmalandra-kb4
Copy link
Author

We are not using chocolately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants