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

NUnitLite ignores --workers option #1986

Closed
CharliePoole opened this issue Jan 17, 2017 · 14 comments
Closed

NUnitLite ignores --workers option #1986

CharliePoole opened this issue Jan 17, 2017 · 14 comments
Assignees
Milestone

Comments

@CharliePoole
Copy link
Contributor

I came across this working on #164. Changing the number of test workers with the command-line --workers option didn't have any effect on the duration of the test. On investigation, it's clear that although the option is accepted there is no code to transmit it to the framework as a setting.

@oznetmaster
Copy link
Contributor

			if (options.NumberOfTestWorkers >= 0)
				runSettings[FrameworkPackageSettings.NumberOfTestWorkers] = options.NumberOfTestWorkers;

@oznetmaster
Copy link
Contributor

#if PARALLEL
		private int GetLevelOfParallelism ()
			{
			return Settings.ContainsKey (FrameworkPackageSettings.NumberOfTestWorkers)
				? (int)Settings[FrameworkPackageSettings.NumberOfTestWorkers]
					 : (LoadedTest.Properties.ContainsKey (PropertyNames.LevelOfParallelism)
						 ? (int)LoadedTest.Properties.Get (PropertyNames.LevelOfParallelism)
						 : NUnitTestAssemblyRunner.DefaultLevelOfParallelism);
			}
#endif

@oznetmaster
Copy link
Contributor

oznetmaster commented Jan 17, 2017

@CharliePoole Not sure why you think it is not used?

@CharliePoole
Copy link
Contributor Author

Experimentally and because there's no code for it in NUnitLite. NUnit has code to properly handle the setting, if it's there - as you show above. NUnitLite accepts it as a command-line setting but never passes that setting to the framework.

@CharliePoole
Copy link
Contributor Author

I didn't see your first example, only the second. The code you cite is pretty much what I had to add to TextRunner.cs to get it to work. It's not in the master.

@oznetmaster
Copy link
Contributor

That code was in nunitlite for a long time. No idea when it was removed. I did not write it.

@oznetmaster
Copy link
Contributor

As far as I can tell it was there when I started working on 3.0

@oznetmaster
Copy link
Contributor

I have been using that command line option to test the cf build for a long time.

@CharliePoole
Copy link
Contributor Author

This isn't actually helping.

@oznetmaster
Copy link
Contributor

Neither of those pieces of code are samples. They we're copied from my cf source.

@oznetmaster
Copy link
Contributor

It might be relevant to determine when and why they were removed. Might be other related issues as well?

@CharliePoole
Copy link
Contributor Author

I've been back as far as the first alpha release of 3.0. There has never been code to make the option work. Of course, the default setting has always worked, absent the command-line override.

@oznetmaster
Copy link
Contributor

It was added to my CF build on 3/21/2015 at 12:01 PM, according to my version control system.

That was the only change on that date.

That was about eight days after I started working on NUnit.

@CharliePoole
Copy link
Contributor Author

Unfortunately, nobody ever added it to the master repository.

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