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

[assembly: RequiresSTA] in NUnit test suites is not parsed correctly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      XP pro, Hudson ver. 1.386, Xunit 1.12, Nunit 1.12, NUnit 2.5.5.10112

      Description

      I'm generating xml files via nunit-console (%%f is the file name of the test assembly)

      ..\Tools\NUnit\bin\net-2.0\nunit-console "%%f" /framework=4.0.30319 /xml=NUnitResult_%%f.xml /exclude=device

      When using [assembly: RequiresSTA] in the test assembly, the xml file generated by the addon for JUnit doesn't contain any test information only one entry about RequiresSTA.

      Workaround for me was using a config file:

      <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
      <configSections>
      <sectionGroup name="NUnit">
      <section type="System.Configuration.NameValueSectionHandler"
      name="TestRunner"></section>
      </sectionGroup>
      </configSections>
      <NUnit>
      <TestRunner>
      <add value="STA" key="ApartmentState"/>
      </TestRunner>
      </NUnit>
      </configuration>

      Anyway, a fix would be good.

        Activity

        Hide
        redsolo redsolo added a comment -

        Could you attach an XML file containing the NUnit output that is not parsed properly? Otherwise it is difficult to reproduce this issue.

        Show
        redsolo redsolo added a comment - Could you attach an XML file containing the NUnit output that is not parsed properly? Otherwise it is difficult to reproduce this issue.
        Hide
        flominator Flominator added a comment -

        Example file that could not be parsed

        Show
        flominator Flominator added a comment - Example file that could not be parsed
        Hide
        flominator Flominator added a comment -

        The file attached lead to this log output:

        [xUnit] [INFO] - Converting 'C:\svn\...\.UnitTests.dll.xml' .
        [xUnit] [ERROR] - The converted file for the input file 'C:\svn\...\UnitTests.dll.xml' doesn't match the JUnit format
        [xUnit] [ERROR] - At line 2 of file:///C:/svn/.../generatedJUnitFiles/NUnit/TEST--1789153906.xml:cvc-complex-type.2.4.b: The content of element 'testsuites' is not complete. One of '

        {"":testsuite}

        ' is expected.

        Show
        flominator Flominator added a comment - The file attached lead to this log output: [xUnit] [INFO] - Converting 'C:\svn\...\.UnitTests.dll.xml' . [xUnit] [ERROR] - The converted file for the input file 'C:\svn\...\UnitTests.dll.xml' doesn't match the JUnit format [xUnit] [ERROR] - At line 2 of file:///C:/svn/.../generatedJUnitFiles/NUnit/TEST--1789153906.xml:cvc-complex-type.2.4.b: The content of element 'testsuites' is not complete. One of ' {"":testsuite} ' is expected.
        Hide
        redsolo redsolo added a comment -

        What plugin are you using? The log output says "xUnit"

        Show
        redsolo redsolo added a comment - What plugin are you using? The log output says "xUnit"
        Hide
        flominator Flominator added a comment -

        Good point! I moved it to the xUnit category

        Show
        flominator Flominator added a comment - Good point! I moved it to the xUnit category
        Hide
        redsolo redsolo added a comment -

        Im hoping you are the maintainer of the xunit plugin

        Show
        redsolo redsolo added a comment - Im hoping you are the maintainer of the xunit plugin
        Hide
        gbois Gregory Boissinot added a comment -

        The error is due to a wrong JUnit format.
        Fixed in trunk.
        However, your test result as input file is empty (no testcases).
        Is it to normal?

        Show
        gbois Gregory Boissinot added a comment - The error is due to a wrong JUnit format. Fixed in trunk. However, your test result as input file is empty (no testcases). Is it to normal?

          People

          • Assignee:
            gbois Gregory Boissinot
            Reporter:
            flominator Flominator
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: