StackStorm-Exchange / stackstorm-excel

excel actions to read and write variables to an excel file
https://exchange.stackstorm.org/
Apache License 2.0
9 stars 8 forks source link

CI is broken #19

Closed cognifloyd closed 2 years ago

cognifloyd commented 2 years ago

CI is broken. I tried pinning the version of openpyxl in #18, but that didn't work. For reference, here's the last good run in CircleCI: https://app.circleci.com/pipelines/github/StackStorm-Exchange/stackstorm-excel/65/workflows/9d2f2998-e402-4a69-b76f-81d28170999b/jobs/313

A bunch of tests are failing with the error:

   Traceback (most recent call last):
    /home/runner/virtualenv/lib/python3.6/site-packages/mock/mock.py line 1346 in patched
      return func(*newargs, **newkeywargs)
    tests/test_action_get_keys_for_rows.py line 81 in test_get_keys_row_col_specify_exists
      result = action.run('sheet1', "mock_excel.xlsx", 3, 2)
    actions/get_keys_for_rows.py line 27 in run
      strict=strict)
    actions/lib/excel_reader.py line 159 in set_sheet
      self._set_key_column(key_column)
    actions/lib/excel_reader.py line 113 in _set_key_column
      key = self._ws.cell(column=self._key_column, row=row)
    tests/excel_base_action_test_case.py line 91 in cell
      mock.Mock(Cell(self, row, i, value=None)))
    /home/runner/virtualenv/lib/python3.6/site-packages/mock/mock.py line 1084 in __init__
      _spec_state, _new_name, _new_parent, **kwargs
    /home/runner/virtualenv/lib/python3.6/site-packages/mock/mock.py line 439 in __init__
      self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
    /home/runner/virtualenv/lib/python3.6/site-packages/mock/mock.py line 494 in _mock_add_spec
      if iscoroutinefunction(getattr(spec, attr, None)):
    /home/runner/virtualenv/lib/python3.6/site-packages/openpyxl/cell/cell.py line 135 in column_letter
      return get_column_letter(self.column)
    /home/runner/virtualenv/lib/python3.6/site-packages/openpyxl/utils/cell.py line 112 in get_column_letter
      raise ValueError("Invalid column index {0}".format(idx))
   ValueError: Invalid column index 0

openpyxl in the successful run was v3.0.6. But v3.0.6, v3.0.7, and v3.0.9 all have this failure. Someone needs to diagnose what changed and fix it. It is very likely that a transitive dep needs to be pinned.

amanda11 commented 2 years ago

Confused @cognifloyd - build_test_weekly seems to be passing? https://app.circleci.com/pipelines/github/StackStorm-Exchange/stackstorm-excel/110/workflows/442c1c23-5f4d-4dac-9004-5e8a373eca5c

amanda11 commented 2 years ago

I think the reason the build push you mentioned is the last one, as that's the last time we did a PR on this run. But the weekly nightly CI have still been passing, so not sure it's a transitive dependency one.

openpyxl on last passing under CircleCI was also 3.0.9 - https://app.circleci.com/pipelines/github/StackStorm-Exchange/stackstorm-excel/110/workflows/442c1c23-5f4d-4dac-9004-5e8a373eca5c/jobs/359

I think its possibly related to the version of mock. I'm not sure what version was used in the CircleCI - if I look I see mention of both mock 2.0.0 and 4.0.3 in the CircleCI run, and I couldn't find in the GHA run where the version of mock came from. I think this came from generic test requirements for the exchange packs rather than per pack.

cognifloyd commented 2 years ago

Sorry. More context would be helpful. It was working in CircleCI, but now that we've moved to Github Actions, something is failing.

cognifloyd commented 2 years ago

@amanda11 you can see the failures here: https://github.com/StackStorm-Exchange/stackstorm-excel/runs/4576438389?check_suite_focus=true

cognifloyd commented 2 years ago

Looks like it's an issue with mock being too new. v2.0.0 works (the last version used successfully on CircleCI, but v4.0.3 does not. Version 3.0.5 also works. I just pushed a fix on master for it.

cognifloyd commented 2 years ago

Someone needs to figure out what changed between mock 3 and 4 and fix the tests.

cognifloyd commented 2 years ago

Pushed a fix. CI is green.