ymyzk / tox-gh-actions

Seamless integration of tox into GitHub Actions for tox 3 and 4
MIT License
249 stars 25 forks source link

TypeError when running `tox --parallel` #176

Closed meshy closed 1 year ago

meshy commented 1 year ago

Describe the bug

Running tox --parallel results in a type error:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.11/x64/bin/tox", line 8, in <module>
    sys.exit(run())
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/tox/run.py", line 41, in main
    result = provision(state)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/tox/provision.py", line 90, in provision
    MANAGER.tox_add_core_config(state.conf.core, state)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/tox/plugin/manager.py", line 66, in tox_add_core_config
    self.manager.hook.tox_add_core_config(core_conf=core_conf, state=state)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/tox_gh_actions/plugin.py", line 56, in tox_add_core_config
    if not is_log_grouping_enabled(config.options):
  File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/tox_gh_actions/plugin.py", line 208, in is_log_grouping_enabled
    if options.parallel > 0:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

To Reproduce

Expected behavior

Tests are run without error.

Additional context

I can see that some work was undertaken to address this issue recently, but I'm still seeing this error with tox-gh-actions version 3.1.0 installed.

For now I intend to remove --parallel from my CI test run.

ymyzk commented 1 year ago

@meshy, thanks for reporting the issue. I'll try to make a bugfix release for this.

For the time being, you can use tox run-parallel instead. As tox --parallel means tox legacy --parallel internally, tox --parallel and tox run-parallel may work slightly differently though.

ymyzk commented 1 year ago

I just released tox-gh-actions v3.1.1 which should fix this issue. Please give it a try.