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

MSTest Plugin - MSTestPublisher aborted due to exception : Getting an error because "&# could not be transformed

    XMLWordPrintable

Details

    Description

      Hello,

      I'm getting an the following errors, because "&# couldn't be transformed - this characters occur when JustMock writes certain exceptions,
      could there be a way not to abort the build when this happens?

      thanks a lot!

      Processing tests results in file(s) Test\TestResults\testResults.trx
       Test\TestResults\testResults.trx
      ERROR: Publisher hudson.plugins.mstest.MSTestPublisher aborted due to exception
      java.io.IOException: remote file operation failed: c:\jenkins\workspace\Build - Tests at hudson.remoting.Channel@69bf0fd8:build3
      	at hudson.FilePath.act(FilePath.java:916)
      	at hudson.FilePath.act(FilePath.java:893)
      	at hudson.plugins.mstest.MSTestPublisher.perform(MSTestPublisher.java:73)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:745)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:709)
      	at hudson.model.Build$BuildExecution.post2(Build.java:182)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:658)
      	at hudson.model.Run.execute(Run.java:1735)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      Caused by: hudson.util.IOException2: Could not transform the MSTest report. Please report this issue to the plugin author
      	at hudson.plugins.mstest.MSTestTransformer.invoke(MSTestTransformer.java:66)
      	at hudson.plugins.mstest.MSTestTransformer.invoke(MSTestTransformer.java:28)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2474)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at hudson.remoting.Engine$1$1.run(Engine.java:63)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Character reference "&#
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
      	at hudson.plugins.mstest.MSTestReportConverter.transform(MSTestReportConverter.java:63)
      	at hudson.plugins.mstest.MSTestTransformer.invoke(MSTestTransformer.java:64)
      	... 12 more
      Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Character reference "&#
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
      	... 16 more
      Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Character reference "&#
      	at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
      	at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
      	... 17 more
      

      Attachments

        Activity

          vishal vishal Mane added a comment - - edited

          I am also facing this issue my jenkins version is : 1.619 and Mstest version is :0.18

          please find attached trx file (SYSTEM_AD-JENKINS 2015-07-08 10_53_01.trx)

          vishal vishal Mane added a comment - - edited I am also facing this issue my jenkins version is : 1.619 and Mstest version is :0.18 please find attached trx file (SYSTEM_AD-JENKINS 2015-07-08 10_53_01.trx)
          vishal vishal Mane added a comment -

          I am also facing this issue my jenkins version is : 1.619 and Mstest version is :0.18

          please find attached trx file (SYSTEM_AD-JENKINS 2015-07-08 10_53_01.trx)

          vishal vishal Mane added a comment - I am also facing this issue my jenkins version is : 1.619 and Mstest version is :0.18 please find attached trx file (SYSTEM_AD-JENKINS 2015-07-08 10_53_01.trx)
          vishal vishal Mane added a comment -

          Any one has anything on this issue please help me.

          vishal vishal Mane added a comment - Any one has anything on this issue please help me.

          vishal Mane, the file you've attached is not valid XML.

          Try one of the xml validators you can find online, or your favourite xml editor. Everyone will tell you the same message:
          The line
          DEBUG: S: LPUSH pubsub:LogQHotelBeds \Y\0�\0\0\0\0\0\0�g��ܶ%��J�?Xo�~i��s�RKǀ�&���і
          contains an invalid XML character entity. Which one? The  sequence.

          This means that your unit test outputs the given sequence. MSTest just copies it in the TRX. Without any further validation.

          In order to fix the mstest behavior, in the past I've patched the mstest plugin in order to skip invalid characters. I've skipped the ones explicitly listed in the official XML specification. Your character sequence doesn't appear in the official XML specification.

          Microsoft is aware of the problem (Jitin John, which reported an update on 4/9/2015 is from Microsoft). I'm not aware of a fix concerning vstest.console or mstest. Let's hope it will be included in VS2015 (which will be released on 07/20/2015).

          As a conclusion, you can do one of the following things:
          1) modify your unit tests from printing invalid xml character entities on StdOut or on the Debug trace.
          2) contact Microsoft in order to ask them to fix the problem in mstest and vstest.console.
          3) modify the code in ContentCorrector.java in order to add the given character sequence to the list of the invalid ones (and propose a pull request by means of the github interface).

          Have a good day,
          Ivo

          nilleb Ivo Bellin Salarin added a comment - vishal Mane, the file you've attached is not valid XML. Try one of the xml validators you can find online, or your favourite xml editor. Everyone will tell you the same message: The line DEBUG: S: LPUSH pubsub:LogQHotelBeds \Y\0�\0\0\0\0\0\0�g��ܶ%��J�?Xo�~i��s�RKǀ�&���і contains an invalid XML character entity. Which one? The  sequence. This means that your unit test outputs the given sequence. MSTest just copies it in the TRX. Without any further validation. In order to fix the mstest behavior, in the past I've patched the mstest plugin in order to skip invalid characters. I've skipped the ones explicitly listed in the official XML specification. Your character sequence doesn't appear in the official XML specification. Microsoft is aware of the problem (Jitin John, which reported an update on 4/9/2015 is from Microsoft). I'm not aware of a fix concerning vstest.console or mstest. Let's hope it will be included in VS2015 (which will be released on 07/20/2015). As a conclusion, you can do one of the following things: 1) modify your unit tests from printing invalid xml character entities on StdOut or on the Debug trace. 2) contact Microsoft in order to ask them to fix the problem in mstest and vstest.console. 3) modify the code in ContentCorrector.java in order to add the given character sequence to the list of the invalid ones (and propose a pull request by means of the github interface). Have a good day, Ivo

          Have a look at the previous comment, about the output of the unit test and the valididty of the attached XML.

          nilleb Ivo Bellin Salarin added a comment - Have a look at the previous comment, about the output of the unit test and the valididty of the attached XML.

          People

            nilleb Ivo Bellin Salarin
            knpe Peter Stefan Knittl-Frank
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: