{"action":"created","issue":{"url":"https://api.github.com/repos/xunit/xunit/issues/1345","repository_url":"https://api.github.com/repos/xunit/xunit","labels_url":"https://api.github.com/repos/xunit/xunit/issues/1345/labels{/name}","comments_url":"https://api.github.com/repos/xunit/xunit/issues/1345/comments","events_url":"https://api.github.com/repos/xunit/xunit/issues/1345/events","html_url":"https://github.com/xunit/xunit/issues/1345","id":240090707,"number":1345,"title":"XUnit fails on AppVeyor + Cake","user":{"login":"Antaris","id":255906,"avatar_url":"https://avatars2.githubusercontent.com/u/255906?v=4","gravatar_id":"","url":"https://api.github.com/users/Antaris","html_url":"https://github.com/Antaris","followers_url":"https://api.github.com/users/Antaris/followers","following_url":"https://api.github.com/users/Antaris/following{/other_user}","gists_url":"https://api.github.com/users/Antaris/gists{/gist_id}","starred_url":"https://api.github.com/users/Antaris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antaris/subscriptions","organizations_url":"https://api.github.com/users/Antaris/orgs","repos_url":"https://api.github.com/users/Antaris/repos","events_url":"https://api.github.com/users/Antaris/events{/privacy}","received_events_url":"https://api.github.com/users/Antaris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2017-07-03T07:40:46Z","updated_at":"2017-10-09T21:10:30Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm running `dotnet xunit` manually as part of a Cake build running both locally and on AppVeyor.\r\n\r\nHere is my Cake build script:\r\n\r\n```\r\nTask(\"Test\")\r\n    .Description(\"Runs unit tests\")\r\n    .IsDependentOn(\"Build\")\r\n    .Does(() =>\r\n    {\r\n        var tests = GetFiles(folders.tests + \"**/*.csproj\");\r\n        foreach (var test in tests)\r\n        {\r\n            string folder = System.IO.Path.GetDirectoryName(test.FullPath);\r\n            string project = folder.Substring(folder.LastIndexOf('\\\\') + 1);\r\n            string resultsFile = folders.testResults + project + \".xml\";\r\n\r\n            CreateDirectory(folders.testResults);\r\n            using (var process = StartAndReturnProcess(\"dotnet\", new ProcessSettings \r\n                {\r\n                    Arguments = \"xunit -xml ../\" + resultsFile + \" --no-build\",\r\n                    WorkingDirectory = folder\r\n                }))\r\n            {\r\n                process.WaitForExit();\r\n\r\n                if (AppVeyor.IsRunningOnAppVeyor)\r\n                {\r\n                    AppVeyor.UploadTestResults(resultsFile, AppVeyorTestResultsType.XUnit);\r\n                }\r\n            }\r\n        }\r\n    });\r\n```\r\n\r\nCake does not have a built in alias for common dotnet tools, so we have to manually run the tool. The `folder` variable changes the working directory to that of the project, and we're outputting XML test results that we would then manually upload.\r\n\r\nRunning locally works fine, we get our test results, but running it on AppVeyor results in the following error:\r\n\r\n```\r\n========================================\r\nTest\r\n========================================\r\nExecuting task: Test\r\nCreating directory C:/projects/framework/build/test-results\r\nDetecting target frameworks in Alium.Core.Abstractions.Tests.csproj...\r\nLocating binaries for framework netcoreapp1.1...\r\nRunning .NET Core tests for framework netcoreapp1.1...\r\nCake.exe : System.ComponentModel.Win32Exception: The directory name is invalid\r\nAt line:1 char:1\r\n+ & \"C:\\projects\\framework\\build-template\\tools\\Cake\\Cake.exe\" \"build.c ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (System.Componen...name is invalid:String) [], RemoteException\r\n    + FullyQualifiedErrorId : NativeCommandError\r\n \r\n   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)\r\n   at System.Diagnostics.Process.Start()\r\n   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)\r\n   at\r\n Program.RunDotNetCoreProject(String outputPath, String assemblyName, String targetFileName, String extraArgs)\r\n   at Program.RunTargetFramework(String testProject, String targetFramework, Boolean amendOutputFileNames)\r\n   at Program.Execute(String[] args)\r\nAn error occurred when executing task '\r\nTest\r\n'.\r\nError: \r\nOne or more errors occurred.\r\n```\r\n\r\nSo I can see it is actually running `dotnet xunit`, but then an exception is thrown `Directory name is invalid`. Hard for me to debug on AppVeyor.\r\n\r\nAny thoughts?"},"comment":{"url":"https://api.github.com/repos/xunit/xunit/issues/comments/335290540","html_url":"https://github.com/xunit/xunit/issues/1345#issuecomment-335290540","issue_url":"https://api.github.com/repos/xunit/xunit/issues/1345","id":335290540,"user":{"login":"johncrim","id":3312127,"avatar_url":"https://avatars0.githubusercontent.com/u/3312127?v=4","gravatar_id":"","url":"https://api.github.com/users/johncrim","html_url":"https://github.com/johncrim","followers_url":"https://api.github.com/users/johncrim/followers","following_url":"https://api.github.com/users/johncrim/following{/other_user}","gists_url":"https://api.github.com/users/johncrim/gists{/gist_id}","starred_url":"https://api.github.com/users/johncrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johncrim/subscriptions","organizations_url":"https://api.github.com/users/johncrim/orgs","repos_url":"https://api.github.com/users/johncrim/repos","events_url":"https://api.github.com/users/johncrim/events{/privacy}","received_events_url":"https://api.github.com/users/johncrim/received_events","type":"User","site_admin":false},"created_at":"2017-10-09T21:10:30Z","updated_at":"2017-10-09T21:10:30Z","author_association":"NONE","body":"The `.deps.json` files are present before `dotnet xunit` is called. I added your powershell line to dump the deps.json files before calling `dotnet xunit`. From https://ci.appveyor.com/project/johncrim/logjam/build/1.1.0-netstandard0037#L244\r\n\r\n```\r\n.\\test.ps1\r\nFullName                                                                                                       \r\n--------                                                                                                       \r\nC:\\projects\\logjam\\src\\LogJam\\bin\\Release\\netstandard1.3\\LogJam.deps.json                                      \r\nC:\\projects\\logjam\\src\\LogJam.XUnit2\\bin\\Release\\netstandard1.3\\LogJam.XUnit2.deps.json                        \r\nC:\\projects\\logjam\\test\\LogJam.ConsoleTester\\bin\\Release\\netcoreapp2.0\\LogJam.ConsoleTester.deps.json          \r\nC:\\projects\\logjam\\test\\LogJam.Internal.UnitTests\\bin\\Release\\netcoreapp2.0\\LogJam.Internal.UnitTests.deps.json\r\nC:\\projects\\logjam\\test\\LogJam.Test.Shared\\bin\\Release\\netcoreapp2.0\\LogJam.Test.Shared.deps.json              \r\nC:\\projects\\logjam\\test\\LogJam.UnitTests\\bin\\Release\\netcoreapp2.0\\LogJam.UnitTests.deps.json                  \r\nC:\\projects\\logjam\\test\\LogJam.XUnit2.UnitTests\\bin\\Release\\netcoreapp2.0\\LogJam.XUnit2.UnitTests.deps.json    \r\nDetecting target frameworks in LogJam.UnitTests.csproj...\r\nEXEC: \"C:\\Program Files\\dotnet\\dotnet.exe\" msbuild \"C:\\projects\\logjam\\test\\LogJam.UnitTests\\LogJam.UnitTests.csproj\" /nologo /verbosity:minimal \"/p:_Xunit_ImportTargetsFile=C:\\Users\\appveyor\\.nuget\\packages\\dotnet-xunit\\2.3.0\\lib\\netcoreapp2.0\\import.targets\" /p:Configuration=Debug /t:_Xunit_GetTargetFrameworks \"/p:_XunitInfoFile=C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp6514.tmp\"\r\nLocating binaries for framework netcoreapp2.0...\r\nEXEC: \"C:\\Program Files\\dotnet\\dotnet.exe\" msbuild \"C:\\projects\\logjam\\test\\LogJam.UnitTests\\LogJam.UnitTests.csproj\" /nologo /verbosity:minimal \"/p:_Xunit_ImportTargetsFile=C:\\Users\\appveyor\\.nuget\\packages\\dotnet-xunit\\2.3.0\\lib\\netcoreapp2.0\\import.targets\" /p:Configuration=Debug /t:_Xunit_GetTargetValues \"/p:_XunitInfoFile=C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp6728.tmp\" \"/p:TargetFramework=netcoreapp2.0\"\r\nRunning .NET Core 2.0.0 tests for framework netcoreapp2.0...\r\nEXEC: \"C:\\Program Files\\dotnet\\dotnet.exe\" exec --fx-version 2.0.0 \"C:\\Users\\appveyor\\.nuget\\packages\\dotnet-xunit\\2.3.0\\tools\\netcoreapp2.0\\xunit.console.dll\" \"LogJam.UnitTests.dll\" -internaldiagnostics\r\ndotnet : System.ComponentModel.Win32Exception (0x80004005): The directory name is invalid\r\nAt C:\\projects\\logjam\\test.ps1:7 char:3\r\n+   dotnet xunit -nobuild -internaldiagnostics $testProject.csproj\r\n+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (System.Componen...name is invalid:String) [], RemoteException\r\n    + FullyQualifiedErrorId : NativeCommandError\r\n \r\n   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)\r\n   at System.Diagnostics.Process.Start()\r\n   at System.Diagnostics.Process.Start(ProcessS\r\ntartInfo startInfo)\r\n   at Program.RunDotNetCoreProject(String outputPath, String assemblyName, String targetFileName, String extraArgs, String fxVersion, String netCoreAppVersion) in C:\\Dev\\xunit\\xunit\\src\\dotnet-xunit\\Program.cs:line 390\r\n   at Program.RunTargetFramework(String testProject, String targetFramework, Boolean amendOutputFileNames) in C:\\Dev\\xunit\\xunit\\src\\dotnet-xunit\\Program.cs:line 329\r\n   at Program.Execute(String[] args) in C:\\Dev\\xunit\\xunit\\src\\dotnet-xunit\\Program.cs:line 130\r\nDetecting target frameworks in LogJam.Internal.UnitTests.csproj...\r\nEXEC: \"C:\\Program Files\\dotnet\\dotnet.exe\" msbuild \"C:\\projects\\logjam\\test\\LogJam.Internal.UnitTests\\LogJam.Internal.UnitTests.csproj\" /nologo /verbosity:minimal \"/p:_Xunit_ImportTargetsFile=C:\\Users\\appveyor\\.nuget\\packages\\dotnet-xunit\\2.3.0\\lib\\netcoreapp2.0\\import.targets\" /p:Configuration=Debug /t:_Xunit_GetTargetFrameworks \"/p:_XunitInfoFile=C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp6C77.tmp\"\r\nLocating binaries for framework netcoreapp2.0...\r\nEXEC: \"C:\\Program Files\\dotnet\\dotnet.exe\" msbuild \"C:\\projects\\logjam\\test\\LogJam.Internal.UnitTests\\LogJam.Internal.UnitTests.csproj\" /nologo /verbosity:minimal \"/p:_Xunit_ImportTargetsFile=C:\\Users\\appveyor\\.nuget\\packages\\dotnet-xunit\\2.3.0\\lib\\netcoreapp2.0\\import.targets\" /p:Configuration=Debug /t:_Xunit_GetTargetValues \"/p:_XunitInfoFile=C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp6E7B.tmp\" \"/p:TargetFramework=netcoreapp2.0\"\r\nRunning .NET Core 2.0.0 tests for framework netcoreapp2.0...\r\nEXEC: \"C:\\Program Files\\dotnet\\dotnet.exe\" exec --fx-version 2.0.0 \"C:\\Users\\appveyor\\.nuget\\packages\\dotnet-xunit\\2.3.0\\tools\\netcoreapp2.0\\xunit.console.dll\" \"LogJam.Internal.UnitTests.dll\" -internaldiagnostics\r\ndotnet : System.ComponentModel.Win32Exception (0x80004005): The directory name is invalid\r\nAt C:\\projects\\logjam\\test.ps1:7 char:3\r\n+   dotnet xunit -nobuild -internaldiagnostics $testProject.csproj\r\n+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (System.Componen...name is invalid:String) [], RemoteException\r\n    + FullyQualifiedErrorId : NativeCommandError\r\n \r\n   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)\r\n   at System.Diagnostics.Process.Start()\r\n   at System.Diagnostics.Process.Start(ProcessS\r\ntartInfo startInfo)\r\n   at Program.RunDotNetCoreProject(String outputPath, String assemblyName, String targetFileName, String extraArgs, String fxVersion, String netCoreAppVersion) in C:\\Dev\\xunit\\xunit\\src\\dotnet-xunit\\Program.cs:line 390\r\n   at Program.RunTargetFramework(String testProject, String targetFramework, Boolean amendOutputFileNames) in C:\\Dev\\xunit\\xunit\\src\\dotnet-xunit\\Program.cs:line 329\r\n   at Program.Execute(String[] args) in C:\\Dev\\xunit\\xunit\\src\\dotnet-xunit\\Program.cs:line 130\r\n```"}}
{"actor":{"display_login":"johncrim"}}