Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5673

Certain test names or test fixture parameters causes the plugin to try to write to illegal file names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: nunit-plugin
    • Labels:
      None
    • Environment:
      Master: Hudson ver. 1.346, NUnit plugin ver: 0.9
      Slave: Windows Vista SP2
    • Similar Issues:

      Description

      Given this test class definition:

      [TestFixture(typeof(UnicodeEncoding))]
      public class TestByteStringParser<T> where T : Encoding, new()
      {
         //...
      }
      

      you will get the following error:

      ERROR: Publisher hudson.plugins.nunit.NUnitPublisher aborted due to exception
      hudson.util.IOException2: remote file operation failed: c:\build\workspace\dotnet-vizrt-win32 at hudson.remoting.Channel@1cd1d94:bgohudsontest
      	at hudson.FilePath.act(FilePath.java:690)
      	at hudson.FilePath.act(FilePath.java:676)
      	at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:102)
      	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      	at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
      	at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
      	at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
      	at hudson.model.Build$RunnerImpl.post2(Build.java:152)
      	at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
      	at hudson.model.Run.run(Run.java:1221)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:122)
      Caused by: java.io.FileNotFoundException: c:\build\workspace\dotnet-vizrt-win32\temporary-junit-reports\TEST-Vizrt.Utilities.Tests.TestByteStringParser<UnicodeEncoding>.TestMultipleStringsInOneBlock.xml (The filename, directory name, or volume label syntax is incorrect)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(Unknown Source)
      	at java.io.FileOutputStream.<init>(Unknown Source)
      	at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:105)
      	at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:69)
      	at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:55)
      	at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1962)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:270)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at hudson.remoting.Engine$1$1.run(Engine.java:58)
      	at java.lang.Thread.run(Unknown Source)
      
      

      The part to note here is that it tries to write to the filename "TEST-Vizrt.Utilities.Tests.TestByteStringParser<UnicodeEncoding>.TestMultipleStringsInOneBlock.xml" which contains illegal characters.

      I did a little bit of digging and it seems like the characters come from NUnitReportTransformer.java line 104 which uses element.getAttribute("name") as a part of the filename without sanitizing any illegal characters.

        Attachments

          Activity

          dagvl dagvl created issue -
          dagvl dagvl made changes -
          Field Original Value New Value
          Attachment testresults.xml [ 19139 ]
          emn13 emn13 made changes -
          Description
          Given this test class definition:
          {code}
          [TestFixture(typeof(UnicodeEncoding))]
          public class TestByteStringParser<T> where T : Encoding, new()
          {
             //...
          }
          {code}

          you will get the following error:
          {code}
          ERROR: Publisher hudson.plugins.nunit.NUnitPublisher aborted due to exception
          hudson.util.IOException2: remote file operation failed: c:\build\workspace\dotnet-vizrt-win32 at hudson.remoting.Channel@1cd1d94:bgohudsontest
          at hudson.FilePath.act(FilePath.java:690)
          at hudson.FilePath.act(FilePath.java:676)
          at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:102)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
          at hudson.model.Build$RunnerImpl.post2(Build.java:152)
          at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
          at hudson.model.Run.run(Run.java:1221)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:122)
          Caused by: java.io.FileNotFoundException: c:\build\workspace\dotnet-vizrt-win32\temporary-junit-reports\TEST-Vizrt.Utilities.Tests.TestByteStringParser<UnicodeEncoding>.TestMultipleStringsInOneBlock.xml (The filename, directory name, or volume label syntax is incorrect)
          at java.io.FileOutputStream.open(Native Method)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:105)
          at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:69)
          at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:55)
          at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1962)
          at hudson.remoting.UserRequest.perform(UserRequest.java:114)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:270)
          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:58)
          at java.lang.Thread.run(Unknown Source)

          {code}

          The part to note here is that it tries to write to the filename "TEST-Vizrt.Utilities.Tests.TestByteStringParser<UnicodeEncoding>.TestMultipleStringsInOneBlock.xml" which contains illegal characters.

          I did a little bit of digging and it seems like the characters come from NUnitReportTransformer.java line 104 which uses element.getAttribute("name") as a part of the filename without sanitizing any illegal characters.

          Given this test class definition:
          {code}
          [TestFixture(typeof(UnicodeEncoding))]
          public class TestByteStringParser<T> where T : Encoding, new()
          {
             //...
          }
          {code}

          you will get the following error:
          {code}
          ERROR: Publisher hudson.plugins.nunit.NUnitPublisher aborted due to exception
          hudson.util.IOException2: remote file operation failed: c:\build\workspace\dotnet-vizrt-win32 at hudson.remoting.Channel@1cd1d94:bgohudsontest
          at hudson.FilePath.act(FilePath.java:690)
          at hudson.FilePath.act(FilePath.java:676)
          at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:102)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
          at hudson.model.Build$RunnerImpl.post2(Build.java:152)
          at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
          at hudson.model.Run.run(Run.java:1221)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:122)
          Caused by: java.io.FileNotFoundException: c:\build\workspace\dotnet-vizrt-win32\temporary-junit-reports\TEST-Vizrt.Utilities.Tests.TestByteStringParser<UnicodeEncoding>.TestMultipleStringsInOneBlock.xml (The filename, directory name, or volume label syntax is incorrect)
          at java.io.FileOutputStream.open(Native Method)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:105)
          at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:69)
          at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:55)
          at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1962)
          at hudson.remoting.UserRequest.perform(UserRequest.java:114)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:270)
          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:58)
          at java.lang.Thread.run(Unknown Source)

          {code}

          The part to note here is that it tries to write to the filename "TEST-Vizrt.Utilities.Tests.TestByteStringParser<UnicodeEncoding>.TestMultipleStringsInOneBlock.xml" which contains illegal characters.

          I did a little bit of digging and it seems like the characters come from NUnitReportTransformer.java line 104 which uses element.getAttribute("name") as a part of the filename without sanitizing any illegal characters.

          redsolo redsolo made changes -
          Attachment mylyn-context.zip [ 19227 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          abayer Andrew Bayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 135765 ] JNJira + In-Review [ 203664 ]

            People

            • Assignee:
              redsolo redsolo
              Reporter:
              dagvl dagvl
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: