SublimeText / UnitTesting

Testing Sublime Text Packages
MIT License
112 stars 32 forks source link

ST3 regression #261

Closed gerardroche closed 7 months ago

gerardroche commented 7 months ago

I'm getting errors for ST3 in github actions for NeoVintageous: https://github.com/NeoVintageous/NeoVintageous/actions/runs/8570042792

It works locally on ST3. I narrowed it down to between v1.5.9 and v1.6.0.

I tried to narrow it down to a specific commit, but you apparently can't specify a commit as the version of UnitTesting to install. This just causes an error:

        uses: SublimeText/UnitTesting/actions/setup@v1
        with:
          unittesting-version: c6beb376dd2e93438da6c56ef646c029f2d06bc3
          sublime-text-version: ${{ matrix.st-version }}

https://github.com/NeoVintageous/NeoVintageous/actions/runs/8570816425/workflow

Some example errors below.

(subl:2826): dbind-WARNING **: 13:48:42.714: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Wait for tests output.......
Start to read output...
F....FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF..FF...F.FFFFFFFF.FF.FFFFFFFF.FFFF..FFFF.F.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.F.FFFF.......FFFFFFFFF......F.EFFF..FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFF.FFFFFFFsFFFFFFFFFFFFFFFFFFFFxFFFFFFFFFFFFFFFFFFFFFxxxxxxFFFFFFFFFFFFFxxFFFFFFFF....FFFFF.F...FFFFFFF...............FFFFFFFFFFF.....FFFF.FF.FFFFFFFFFFFFFFF.FFFFFFFFFFFFFFF............FFFFFFFFFFFFFFFFFFFFFFFF.FFFFF.FFFFFFFFFFFFFFFFF.FFFFFFFF..FFFFF..FFFFFFFFFFFFFFFFF............FF.FF.F.FFFFFFFFFFFFFFFFFFF.FFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF....FFFFFFFFFFFFFFFFFFFF.....FF..FFFFFFFFFFFFFFFFFFFFFFFFFF...FFF.FFF.FFFFF.FFFFFFFFFFF...FFFFFFFFFFFFFFFFFFFFFFFFFFxxFFFFFFFFFF....FFFFFFFFF..FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...F..FFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFF.....FFF..FFFFFFFFFFFFFFFFFFFFFFF............FFFFFFFFF.FF.FFFFFFFFFFFFFFFFFFFFFFFF...FFFFFFFFFF.FFFFFFFF.............................................................................................................................................................FFFFF..FFFFFFFFFFFFFFFFF.FFFFFFFFFFFFF.FFFFFFFFFFFFFF.FFF.........................FFFFFFFFFFFFFFFFFFFFFFF.FFFF...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF..F.F...FFFFFFFF.FFFFFFF.FFFFFFFFFFF...FFFFFFFFFFFFFFFFF..FFFF.FFFFFFFFFFFFFFFFFFF..FFFFFF.FFFFFFFFFFFF.FFF.FFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFF.FFFF........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF................................................................................................................................................................................................................................................................................FF..............................................................................................
======================================================================
ERROR: test_v (tests.functional.test_m.Test_m)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/functional/test_m.py", line 28, in test_v
    self.assertMarkContent('x', '1\nfizz b|uzz\n3\n')
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/unittest.py", line 412, in assertMarkContent
    self._assertContentSelection([get_mark(self.view, name)], expected)
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/unittest.py", line 488, in _assertContentSelection
    content.insert(sel.begin() + counter, '|')
AttributeError: 'NoneType' object has no attribute 'begin'

======================================================================
FAIL: test_v_U (tests.functional.test__big_u.Test_U)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/functional/test__big_u.py", line 24, in test_v_U
    self.eq('f|izz b|uzz', 'v_U', 'n_f|IZZ Buzz')
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/unittest.py", line 1094, in eq
    getattr(self, method_name)(expected, *args)
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/unittest.py", line 541, in assertNormal
    self._assertView(expected, NORMAL, msg)  # type: ignore[arg-type]
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/unittest.py", line 500, in _assertView
    self._assertContentSelection(list(self.view.sel()), expected, msg)
  File "/home/runner/.config/sublime-text-3/Packages/NeoVintageous/tests/unittest.py", line 494, in _assertContentSelection
    self.assertEquals(expected, ''.join(content), msg)
AssertionError: 'f|IZZ Buzz' != 'f|izz b|uzz'
- f|IZZ Buzz
+ f|izz b|uzz
gerardroche commented 7 months ago

I added a switch to use UnitTesting 1.5.9 for ST3:

      - name: Setup
        uses: SublimeText/UnitTesting/actions/setup@v1
        with:
          unittesting-version: ${{ matrix.os == 'ubuntu-latest' && matrix.st-version == 3 && '1.5.9' || '' }}
          sublime-text-version: ${{ matrix.st-version }}
deathaxe commented 7 months ago

Seems to be caused by the way how packages are reloaded before testing.

This is fixed by https://github.com/SublimeText/UnitTesting/pull/258.

Until next release setting "reload_package_on_testing": false in unittesting.json would workaround this issue, too.

Reloading packages is useless on CI anyway, as packages are installed before ST is started for testing.