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

Agents not copied to project referencing nunit.engine package #1023

Open
CharliePoole opened this issue Oct 19, 2021 · 5 comments
Open

Agents not copied to project referencing nunit.engine package #1023

CharliePoole opened this issue Oct 19, 2021 · 5 comments
Milestone

Comments

@CharliePoole
Copy link
Contributor

When a project references the engine package, the directories containing the various agents are not actually copied to output as intended. @jnm2 and I have had some off-line discussion about this and I'm doing some experimenting to find out if the particular type of target project makes a difference... i.e. sdk or non-sdk, package reference or package.config.

I guess we had never noticed this because we don't consume the package in the console runner. The VS adapter consumes it but only runs tests in-process, so no visible issue has ever arisen.

@CharliePoole
Copy link
Contributor Author

I built two simple runners using the same code. One targets net45 and the other net5.0. Visual Studio creates a non-sdk-style project using packages.config for net45 and an sdk-style project using package references for net5.0.

I added the nunit.engine nuget package to both projects. Neither project actually copies the content files (which includes the agents) into the output directory.

I ran the net45 project against a .NET framework test. It throws an exception when trying to start a process because the agent is not found where it's expected to be. If I run in process, it succeeds.

I ran the net 5.0 project against a .NET Core 2.1 test. Even though the files are not visible, it is able to use the info available to locate and run the agent files.

@CharliePoole
Copy link
Contributor Author

It occurs to me that this would not be a problem if all our agents were pluggable extensions. Then the extension service would just find them! I'm experimenting with this approach for TestCentric. See testcentric/testcentric-gui#832

@CharliePoole
Copy link
Contributor Author

Moved to 4.0 on the basis that the use of pluggable agents is a 4.0 feature.

@manfred-brands
Copy link
Member

contentFiles element are not recognized by packages.config projects (NuGet/Home#7672)
You would have to duplicate the files in both the content and contentFiles folders to support both.
Alternatively, would it be better to put those file in a runtime folder as they are needed at runtime?

@CharliePoole
Copy link
Contributor Author

@manfred-brands See issue #909 for a potential solution to this and some other problems. The issue is an Epic (contains other issues) and I've made some progress on it.

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

No branches or pull requests

2 participants