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

Create result directory if it does not exist #501

Closed
jnm2 opened this issue Nov 25, 2018 · 2 comments
Closed

Create result directory if it does not exist #501

jnm2 opened this issue Nov 25, 2018 · 2 comments

Comments

@jnm2
Copy link
Collaborator

jnm2 commented Nov 25, 2018

Right now if the directory does not already exist for the result file path, you get this:

NUnit.Engine.NUnitEngineException : The path specified in --result C:/Users/Joseph/Source/Repos/nunit/test-results/net20/nunit.framework.tests.xml could not be written to
  ----> System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\Users\Joseph\Source\Repos\nunit\test-results\net20\nunit.framework.tests.xml'.

--NUnitEngineException
The path specified in --result C:/Users/Joseph/Source/Repos/nunit/test-results/net20/nunit.framework.tests.xml could not be written to
   at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
   at NUnit.ConsoleRunner.Program.Main(String[] args)
--
DirectoryNotFoundException
Could not find a part of the path 'C:\Users\Joseph\Source\Repos\nunit\test-results\net20\nunit.framework.tests.xml'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at NUnit.Engine.Services.NUnit3XmlResultWriter.WriteResultFile(XmlNode resultNode, String outputPath)
   at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)

It would be convenient if the directory was just created.

@JerryBLi
Copy link
Contributor

JerryBLi commented Feb 1, 2019

Hey, I just submitted a Pull request #539 for this. Do you think this warrants a test to be written?

@ChrisMaddock ChrisMaddock added this to the 3.10 milestone Feb 3, 2019
@jnm2
Copy link
Collaborator Author

jnm2 commented Mar 16, 2019

Could follow up by removing https://github.com/nunit/nunit/blob/4584f8f5540bba7ee5abb7af3eea7c2b500e002b/build.cake#L415 when 3.10 is released.

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

3 participants