nunit / nunit/nunit-console

Replacement for RuntimeFrameworkService

Open
#702 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted High Priority Refactor V4
Dominant language
C#
Stars
234
Forks
163
Avg merge
13h 32m
Merged PRs (30d)
25

Description

RuntimeFrameworkService suffers from a number of problems:

  1. Lack of thread-safety (#173) - preventing improvements in other areas (#140)
  2. Mix of functionality relating to runtimes and target frameworks, leading to confusion in code (e.g. use of Runtime.Any, #406).
  3. High-overhead in certain usecases - e.g. every test run currently calculates and discovers all available runtimes, when only a minority of runners require that information.
  4. Limited testing, due to tight integration of assembly inspection/File system requirements, and logic.
  5. Lot's of netfx specific functionality, which can't be compiled for the .NET Standard builds
  6. Reliance on two different versions of Mono Cecil, due to no version of Cecil having support for both .NET 2.0 and .NET Standard.

After spending a couple of years teasing round the edges of this, and not making a lot of progress (https://github.com/nunit/nunit-console/pull/407, https://github.com/nunit/nunit-console/pull/402, https://github.com/nunit/nunit-console/pull/408, https://github.com/nunit/nunit-console/pull/670, #406) I'd like to instead propose a wholesale replacement for these classes. I'm marking this as high priority, as it's an area which is going to need lots of upcoming development for the .NET Standard improvements - and I'd like to create a better structure here, before we start building on top of it.


I'm proposing two new services to replace it:

  1. AssemblyTargetingService: Responsible for everything around what an assembly was built to target. Would be used to inspect and annotate test packages, and inspect engine extensions.
  2. RuntimesService: Responsible for all functionality around discovering available runtimes, and deciding on the runtime to be used for each agent.

I'd then like the Obsolete the current RuntimeFrameworkService, and remove in v4.

Thoughts welcome. 🙂

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading RuntimeFrameworkService and the earlier work referenced in #173, #140, #406 and pull requests #407, #402, #408 and #670. Compare the proposed AssemblyTargetingService and RuntimesService responsibilities, then trace the current runtime and target-framework callers. Done means the replacement structure is agreed, the old service is obsolete, and its removal path for v4 is defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.