Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1994

[Windows] Skip JUnit report when running a specific test

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 4.4.2
    • Component/s: Tests
    • Environment:
      Windows

      Description

      When running a specific test, more specifically when running a specific function/method, the JUnit report will fail on Windows because the file name is based on the specific test. In that case, the report name will contain ::, and those are forbidden character on that OS.

      Sentry Issue: NUXEO-DRIVE-2MY

      OSError: [Errno 22] Invalid argument: 'C:\\Users\\Windows10\\Desktop\\nuxeo-drive\\tools\\jenkins\\junit\\xml\\tests\\functional\\test_local_client.py::test_rename_with_different_partitions.1.xml'
        File "runpy.py", line 193, in _run_module_as_main
          "__main__", mod_spec)
        File "runpy.py", line 85, in _run_code
          exec(code, run_globals)
        File "__main__.py", line 7, in <module>
          raise SystemExit(pytest.main())
        File "_pytest\config\__init__.py", line 92, in main
          config=config
        File "pluggy\hooks.py", line 286, in __call__
          return self._hookexec(self, self.get_hookimpls(), kwargs)
        File "pluggy\manager.py", line 93, in _hookexec
          return self._inner_hookexec(hook, methods, kwargs)
        File "pluggy\manager.py", line 87, in <lambda>
          firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
        File "_pytest\main.py", line 239, in pytest_cmdline_main
          return wrap_session(config, _main)
        File "_pytest\main.py", line 196, in wrap_session
          session.exitstatus = doit(config, session) or 0
        File "pluggy\hooks.py", line 286, in __call__
          return self._hookexec(self, self.get_hookimpls(), kwargs)
        File "pluggy\manager.py", line 93, in _hookexec
          return self._inner_hookexec(hook, methods, kwargs)
        File "pluggy\manager.py", line 87, in <lambda>
          firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
        File "_pytest\terminal.py", line 681, in pytest_sessionfinish
          outcome.get_result()
        File "_pytest\junitxml.py", line 655, in pytest_sessionfinish
          logfile = open(self.logfile, "w", encoding="utf-8")
      

      The fix is to simply skip JUnit reports.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m