ymyzk / tox-gh-actions

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

TypeError comparing options.parallel to None #144

Closed tolomea closed 1 year ago

tolomea commented 1 year ago

Describe the bug I'm coming back to a project I haven't touched for 7 months. It follows the examples fairly closely. All the CI is broken with the following.

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.10/x64/bin/tox", line 8, in <module>
    sys.exit(run())
  File "/opt/hostedtoolcache/Python/3.10.10/x64/lib/python3.10/site-packages/tox/run.py", line 1[9](https://github.com/tolomea/django-data-browser/actions/runs/4341383293/jobs/7580915003#step:6:10), in run
    result = main(sys.argv[1:] if args is None else args)
  File "/opt/hostedtoolcache/Python/3.[10](https://github.com/tolomea/django-data-browser/actions/runs/4341383293/jobs/7580915003#step:6:11).10/x64/lib/python3.10/site-packages/tox/run.py", line 41, in main
    result = provision(state)
  File "/opt/hostedtoolcache/Python/3.10.10/x64/lib/python3.10/site-packages/tox/provision.py", line 105, in provision
    MANAGER.tox_add_core_config(state.conf.core, state)
  File "/opt/hostedtoolcache/Python/3.10.10/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.10/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.10/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.10/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/opt/hostedtoolcache/Python/3.10.10/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.10/x64/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/opt/hostedtoolcache/Python/3.10.10/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.10/x64/lib/python3.10/site-packages/tox_gh_actions/plugin.py", line [20](https://github.com/tolomea/django-data-browser/actions/runs/4341383293/jobs/7580915003#step:6:21)7, in is_log_grouping_enabled
    if hasattr(options, "parallel") and options.parallel > 0:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

That particular one came off py3.10 with the following:

Successfully installed cachetools-5.3.0 chardet-5.1.0 colorama-0.4.6 distlib-0.3.6 filelock-3.9.0 packaging-23.0 platformdirs-3.1.0 pluggy-1.0.0 pyproject-api-1.5.0 tomli-2.0.1 tox-4.4.6 tox-gh-actions-3.0.0 virtualenv-20.20.0

Any pointers on what to check?

ymyzk commented 1 year ago

Hello @tolomea, thanks for reporting the issue. It seems somethings is working unexpectedly inside tox-gh-actions when we run tox using tox -p. I'll look deeper and make a bug fix release later.

I'm coming back to a project I haven't touched for 7 months.

The upgrade from tox v3 to v4 and tox-gh-actions v2 to v3 happened during this period is also a contributing factor to this bug.

Meanwhile, could you try using tox p instead to run your tests in parallel? It seems we can avoid the bug in this way.

tolomea commented 1 year ago

I changed it to just "tox" and that fixed it, although I guess slower now

ymyzk commented 1 year ago

I believe tox p or tox run-parallel can run tests in parallel and it won't trigger the bug reported in this thread.

ymyzk commented 1 year ago

I just released tox-gh-actions v3.1.0 which includes a fix for this issue (#145)