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

[Windows] Fix test_valid_argument_value() integration test

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 5.1.1
    • Component/s: Tests

      Description

      exe = <function exe.<locals>.execute at 0x0717EE80>
      arg = '--log-level-file=TRACE'
      
          @pytest.mark.parametrize(
              "arg",
              [
                  "--channel=alpha",
                  "--channel=beta",
                  "--channel=release",
                  "--debug",
                  "--debug-pydev",
                  "--delay=42",
                  "--force-locale=es",
                  "--handshake-timeout=42",
                  "--log-level-file=TRACE",
                  "--log-level-file=DEBUG",
                  "--log-level-file=INFO",
                  "--log-level-file=WARNING",
                  "--log-level-file=ERROR",
                  "--log-level-console=TRACE",
                  "--log-level-console=DEBUG",
                  "--log-level-console=INFO",
                  "--log-level-console=WARNING",
                  "--log-level-console=ERROR",
                  # --log-filename tested in test_argument_log_filename()
                  "--locale=es",
                  "--max-errors=42",
                  "--nofscheck",
                  # --nxdrive-home tested in test_argument_nxdrive_home()
                  "--proxy-server=***example.org:8888",
                  "--ssl-no-verify",
                  "--sync-and-quit",
                  "--timeout=42",
                  "--update-check-delay=42",
                  "--update-site-url='https://example.org'",
                  "--version",
                  "-v",
              ],
          )
          def test_valid_argument_value(exe, arg):
              """Test all CLI arguments but those requiring a folder."""
              with exe(args=arg) as app:
      >           assert not fatal_error_dlg(app)
      E           assert not True
      E            +  where True = fatal_error_dlg(<pywinauto.application.Application object at 0x0716DB80>)
      
      app        = <pywinauto.application.Application object at 0x0716DB80>
      arg        = '--log-level-file=TRACE'
      exe        = <function exe.<locals>.execute at 0x0717EE80>
      
      tests\integration\windows\test_cli.py:79: AssertionError
      ---------------------------- Captured stderr call -----------------------------
      2021-04-14 15:25:40 5196 436 INFO     tests.integration.windows.conftest Starting 'dist\\ndrive\\ndrive.exe' with args='--log-level-file=TRACE --nxdrive-home="..."'
      2021-04-14 15:25:43 5196 436 WARNING  tests.integration.windows.utils Fatal error screen detected! Details:
      

      Command line arguments:

      --log-level-file=TRACE
      --nxdrive-home=...
      

      Exception:

      Traceback (most recent call last):
        File "nxdrive\__main__.py", line 69, in main
          ret = CliHandler().handle(sys.argv[1:])
        File "nxdrive\commandline.py", line 525, in handle
          Options.update(options, setter="cli", fail_on_error=False)
        File "nxdrive\options.py", line 487, in update
          MetaOptions.set(
        File "nxdrive\options.py", line 462, in set
          callback(new_value)
        File "nxdrive\logging_config.py", line 254, in <lambda>
          Options.callbacks["log_level_file"] = lambda level: _update_logger(
        File "nxdrive\logging_config.py", line 243, in _update_logger
          handler.setLevel(level)
        File "logging\__init__.py", line 914, in setLevel
        File "logging\__init__.py", line 198, in _checkLevel
      ValueError: Unknown level: 'TRACE'
      

      Logs before the crash:

      2021-04-14 15:25:40 6372 1716 WARNING  root               TRACE level is deprecated since 4.1.0. Please use DEBUG instead.
      2021-04-14 15:25:40 6372 1716 WARNING  root               TRACE level is deprecated since 4.1.0. Please use DEBUG instead.
      2021-04-14 15:25:40 6372 1716 INFO     nxdrive.commandline Command line: argv=['--log-level-file=TRACE', '--nxdrive-home=...'], options=Namespace(nxdrive_home=WindowsPath('...'), log_level_file='TRACE', log_level_console='WARNING', log_filename=None, locale='en', force_locale=None, update_site_url='https://community.nuxeo.com/static/drive-updates', channel='centralized', debug=False, nofscheck=False, proxy_server=None, ssl_no_verify=False, sync_and_quit=False, debug_pydev=False, delay=30, handshake_timeout=60, timeout=30, update_check_delay=3600, max_errors=3)
      2021-04-14 15:25:40 6372 1716 INFO     nxdrive.commandline Running on version 5.1.1
      2021-04-14 15:25:40 6372 1716 INFO     nxdrive.options    Option 'nxdrive_home' updated: WindowsPath('C:/Users/runneradmin/.nuxeo-drive') -> WindowsPath('...') [cli]
      2021-04-14 15:25:40 6372 1716 DEBUG    nxdrive.options    Options(nxdrive_home[cli]=WindowsPath('...'))
      2021-04-14 15:25:40 6372 1716 WARNING  root               TRACE level is deprecated since 4.1.0. Please use DEBUG instead.
      2021-04-14 15:25:40 6372 1716 INFO     nxdrive.options    Option 'log_level_file' updated: 'INFO' -> 'TRACE' [cli]
      2021-04-14 15:25:40 6372 1716 DEBUG    nxdrive.options    Options(log_level_file[cli]='TRACE', nxdrive_home[cli]=WindowsPath('...'))
      

        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 - 15 minutes
                  15m