Add command-line option to specify configuration file#348
Add command-line option to specify configuration file#348CharliePoole merged 3 commits intomasterfrom
Conversation
| Assert.That(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, Is.SamePath(expectedPath)); | ||
| var expectedPath = Path.Combine(TestContext.CurrentContext.TestDirectory, STANDARD_CONFIG_FILE); | ||
| var alternatePath = Path.Combine(TestContext.CurrentContext.TestDirectory, ALTERNATE_CONFIG_FILE); | ||
| Assert.That(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, Is.SamePath(expectedPath).Or.SamePath(alternatePath)); |
There was a problem hiding this comment.
Would you mind explaining the changes in this file to me? I'm a bit confused where alt.config has come from?
There was a problem hiding this comment.
Good catch... I should add alt.config in GitHub rather than directly in my bin directory where it is, of course, being ignored.
Basically, alt.config is a standard way of manually testing that the command-line option works. By running the tests with --configfile=alt.config I am able to verify the complete chain of events that cause the correct file to be read. The changes here are so that existing tests do not get broken when I do that.
This is really not absolutely necessary because we have unit tests that verify each individual link in the chain but it made me more confident to be able to add it.
I think it will be clearer once I actually add the file.
There was a problem hiding this comment.
Thanks - that made sense. 😄 Could I suggest a comment to cover that - that the alternatePath part of these two tests is only in the case where a --configFile option has been used manually?
There was a problem hiding this comment.
I completely overlooked the tests when I reviewed (so much for multitasking between tasks).
There was a problem hiding this comment.
@ChrisMaddock I'll do that. Things like this are always "obvious" to the guy who writes them!
|
Still having problem with Apple agents not starting. Overriding to merge. |
Fixes #246
Adds the option to the console runner. The underlying capability has been there for some time and is already used by the NUnit 3 VS adapter.