Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest errors: openSUSE Packaging 0.26.0 #4868

Open
2 tasks done
uncomfyhalomacro opened this issue Jun 7, 2024 · 3 comments
Open
2 tasks done

pytest errors: openSUSE Packaging 0.26.0 #4868

uncomfyhalomacro opened this issue Jun 7, 2024 · 3 comments

Comments

@uncomfyhalomacro
Copy link

Issue description

Running pytest results in errors specifically the migration tests.

Version

0.26.0

Backend

X11 (default), Wayland (experimental)

Config

No response

Logs

[ 1844s] =================================== FAILURES ===================================
[ 1844s] ____________ test_check_all_migrations[ModuleRenames-no-check-test] ____________
[ 1844s] 
[ 1844s] migration_tester = <test.migrate.conftest.MigrationTester object at 0x7fc717d9df50>
[ 1844s] 
[ 1844s]     @pytest.mark.parametrize("migration_tester", migration_tests, indirect=True, ids=migration_ids)
[ 1844s]     def test_check_all_migrations(migration_tester):
[ 1844s] >       migration_tester.assert_check()
[ 1844s] 
[ 1844s] test/migrate/test_check_migrations.py:51: 
[ 1844s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[ 1844s] 
[ 1844s] self = <test.migrate.conftest.MigrationTester object at 0x7fc717d9df50>
[ 1844s] 
[ 1844s]     def assert_check(self):
[ 1844s]         if not self.test.source:
[ 1844s] >           assert False, f"{self.test_id} has no Check test."
[ 1844s] E           AssertionError: ModuleRenames has no Check test.
[ 1844s] E           assert False
[ 1844s] 
[ 1844s] test/migrate/conftest.py:76: AssertionError
[ 1844s] ________________ test_check_all_migrations[RenameUnspecified-0] ________________
[ 1844s] 
[ 1844s] migration_tester = <test.migrate.conftest.MigrationTester object at 0x7fc7192ddb10>
[ 1844s] 
[ 1844s]     @pytest.mark.parametrize("migration_tester", migration_tests, indirect=True, ids=migration_ids)
[ 1844s]     def test_check_all_migrations(migration_tester):
[ 1844s] >       migration_tester.assert_check()
[ 1844s] 
[ 1844s] test/migrate/test_check_migrations.py:51: 
[ 1844s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[ 1844s] 
[ 1844s] self = <test.migrate.conftest.MigrationTester object at 0x7fc7192ddb10>
[ 1844s] 
[ 1844s]     def assert_check(self):
[ 1844s]         if not self.test.source:
[ 1844s]             assert False, f"{self.test_id} has no Check test."
[ 1844s]     
[ 1844s]         self.assert_migrate()
[ 1844s]     
[ 1845s] >       assert run_qtile_check(self.test.source_path)
[ 1845s] E       AssertionError: assert False
[ 1845s] E        +  where False = run_qtile_check(PosixPath('/tmp/tmpmddmh3ov/config.py'))
[ 1845s] E        +    where PosixPath('/tmp/tmpmddmh3ov/config.py') = <test.migrate.conftest.SourceCode object at 0x7fc7192dce90>.source_path
[ 1845s] E        +      where <test.migrate.conftest.SourceCode object at 0x7fc7192dce90> = <test.migrate.conftest.MigrationTester object at 0x7fc7192ddb10>.test
[ 1845s] 
[ 1845s] test/migrate/conftest.py:80: AssertionError
[ 1845s] ----------------------------- Captured stdout call -----------------------------
[ 1845s] Saved!
[ 1845s] Finished. Backup files have not been deleted.
[ 1845s] Checking Qtile config at: /tmp/tmpmddmh3ov/config.py
[ 1845s] Checking if config is valid python...
[ 1845s] Traceback (most recent call last):
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/scripts/check.py", line 122, in check_config
[ 1845s]     config.load()
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/confreader.py", line 134, in load
[ 1845s]     config = importlib.import_module(name)
[ 1845s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[ 1845s]     return _bootstrap._gcd_import(name[level:], package, level)
[ 1845s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[ 1845s]   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[ 1845s]   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[ 1845s]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[ 1845s]   File "/tmp/tmpmddmh3ov/config.py", line 10, in <module>
[ 1845s]     tb.set_font(fontsize=12)
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/widget/base.py", line 733, in set_font
[ 1845s]     self.bar.draw()
[ 1845s]     ^^^^^^^^
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/command/base.py", line 281, in __getattr__
[ 1845s]     raise AttributeError(f"{self.__class__} has no attribute {name}")
[ 1845s] AttributeError: <class 'libqtile.widget.textbox.TextBox'> has no attribute bar
[ 1845s] 
[ 1845s] ----------------------------- Captured stderr call -----------------------------
[ 1845s] Errors found in config. Exiting check.
[ 1845s] =========================== short test summary info ============================
[ 1845s] SKIPPED [1] test/widgets/test_statusnotifier.py:28: StatusNotifier tests are currently broken
[ 1845s] SKIPPED [1] test/test_restart.py:73: Skipping test on Wayland.
[ 1845s] SKIPPED [1] test/widgets/test_clipboard.py:49: Test only available on X11.
[ 1845s] SKIPPED [1] test/widgets/test_clipboard.py:70: Test only available on X11.
[ 1845s] SKIPPED [1] test/widgets/test_clipboard.py:94: Test only available on X11.
[ 1845s] SKIPPED [1] test/widgets/test_clipboard.py:121: Test only available on X11.
[ 1845s] SKIPPED [1] test/widgets/test_clipboard.py:141: Test only available on X11.
[ 1845s] SKIPPED [1] test/widgets/test_clipboard.py:166: Test only available on X11.
[ 1845s] SKIPPED [1] test/widgets/test_systray.py:33: Skipping test on Wayland.
[ 1845s] SKIPPED [1] test/widgets/test_systray.py:51: Skipping test on Wayland.
[ 1845s] SKIPPED [1] test/widgets/test_systray.py:84: Skipping test on Wayland.
[ 1845s] SKIPPED [1] test/widgets/test_systray.py:112: volumeicon must be installed. Skipping test.
[ 1845s] SKIPPED [1] test/widgets/test_systray.py:108: Skipping test on Wayland.
[ 1845s] SKIPPED [1] test/widgets/test_widget_init_configure.py:95: Unsupported backend
[ 1845s] SKIPPED [1] test/widgets/test_widget_init_configure.py:129: Unsupported backend
[ 1845s] SKIPPED [1] test/widgets/test_widgetbox.py:126: Skipping test on Wayland.
[ 1845s] SKIPPED [1] test/widgets/test_widgetbox.py:153: Skipping test on Wayland.
[ 1845s] ====== 2 failed, 1969 passed, 17 skipped, 4 xpassed in 1816.50s (0:30:16) ======
[ 1845s] error: Bad exit status from /var/tmp/rpm-tmp.0gBGpq (%check)

Required

  • I have searched past issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@uncomfyhalomacro uncomfyhalomacro changed the title openSUSE Packaging 0.26.0 pytest errors: openSUSE Packaging 0.26.0 Jun 7, 2024
@uncomfyhalomacro
Copy link
Author

Relevant branch:
https://build.opensuse.org/package/show/home:uncomfyhalomacro:branches:X11:windowmanagers/qtile
I am not sure what errors causes the AttributeError.

@tych0
Copy link
Member

tych0 commented Jun 7, 2024

Hmm:

[ 1844s] E AssertionError: ModuleRenames has no Check test.

this is actually right. ModuleRenames does not have a Check test. I wonder why this passes in our ci...

tych0 added a commit to tych0/qtile that referenced this issue Jun 7, 2024
We have reports of the stack trace:

[ 1845s] Checking Qtile config at: /tmp/tmpmddmh3ov/config.py
[ 1845s] Checking if config is valid python...
[ 1845s] Traceback (most recent call last):
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/scripts/check.py", line 122, in check_config
[ 1845s]     config.load()
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/confreader.py", line 134, in load
[ 1845s]     config = importlib.import_module(name)
[ 1845s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[ 1845s]     return _bootstrap._gcd_import(name[level:], package, level)
[ 1845s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[ 1845s]   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[ 1845s]   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[ 1845s]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[ 1845s]   File "/tmp/tmpmddmh3ov/config.py", line 10, in <module>
[ 1845s]     tb.set_font(fontsize=12)
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/widget/base.py", line 733, in set_font
[ 1845s]     self.bar.draw()
[ 1845s]     ^^^^^^^^
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/command/base.py", line 281, in __getattr__
[ 1845s]     raise AttributeError(f"{self.__class__} has no attribute {name}")
[ 1845s] AttributeError: <class 'libqtile.widget.textbox.TextBox'> has no attribute bar

the problem here is that the test actually calls set_font() when imported,
which we can't do since we haven't actually configured a bar yet.

This is part of qtile#4868 and suggests that we are somehow not running the
migration tests correctly in our CI.

Signed-off-by: Tycho Andersen <[email protected]>
tych0 added a commit to elParaguayo/qtile that referenced this issue Jun 11, 2024
We have reports of the stack trace:

[ 1845s] Checking Qtile config at: /tmp/tmpmddmh3ov/config.py
[ 1845s] Checking if config is valid python...
[ 1845s] Traceback (most recent call last):
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/scripts/check.py", line 122, in check_config
[ 1845s]     config.load()
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/confreader.py", line 134, in load
[ 1845s]     config = importlib.import_module(name)
[ 1845s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[ 1845s]     return _bootstrap._gcd_import(name[level:], package, level)
[ 1845s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[ 1845s]   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[ 1845s]   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[ 1845s]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[ 1845s]   File "/tmp/tmpmddmh3ov/config.py", line 10, in <module>
[ 1845s]     tb.set_font(fontsize=12)
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/widget/base.py", line 733, in set_font
[ 1845s]     self.bar.draw()
[ 1845s]     ^^^^^^^^
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/command/base.py", line 281, in __getattr__
[ 1845s]     raise AttributeError(f"{self.__class__} has no attribute {name}")
[ 1845s] AttributeError: <class 'libqtile.widget.textbox.TextBox'> has no attribute bar

the problem here is that the test actually calls set_font() when imported,
which we can't do since we haven't actually configured a bar yet.

This is part of qtile#4868 and suggests that we are somehow not running the
migration tests correctly in our CI.

Signed-off-by: Tycho Andersen <[email protected]>
Copy link

github-actions bot commented Sep 6, 2024

This issue is stale because it has been open 90 days with no activity. Remove the status: stale label or comment, or this will be closed in 30 days.

tych0 added a commit to tych0/qtile that referenced this issue Sep 6, 2024
We have reports of the stack trace:

[ 1845s] Checking Qtile config at: /tmp/tmpmddmh3ov/config.py
[ 1845s] Checking if config is valid python...
[ 1845s] Traceback (most recent call last):
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/scripts/check.py", line 122, in check_config
[ 1845s]     config.load()
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/confreader.py", line 134, in load
[ 1845s]     config = importlib.import_module(name)
[ 1845s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[ 1845s]     return _bootstrap._gcd_import(name[level:], package, level)
[ 1845s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[ 1845s]   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[ 1845s]   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[ 1845s]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[ 1845s]   File "/tmp/tmpmddmh3ov/config.py", line 10, in <module>
[ 1845s]     tb.set_font(fontsize=12)
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/widget/base.py", line 733, in set_font
[ 1845s]     self.bar.draw()
[ 1845s]     ^^^^^^^^
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/command/base.py", line 281, in __getattr__
[ 1845s]     raise AttributeError(f"{self.__class__} has no attribute {name}")
[ 1845s] AttributeError: <class 'libqtile.widget.textbox.TextBox'> has no attribute bar

the problem here is that the test actually calls set_font() when imported,
which we can't do since we haven't actually configured a bar yet.

This is part of qtile#4868 and suggests that we are somehow not running the
migration tests correctly in our CI.

Signed-off-by: Tycho Andersen <[email protected]>
tych0 added a commit that referenced this issue Sep 22, 2024
We have reports of the stack trace:

[ 1845s] Checking Qtile config at: /tmp/tmpmddmh3ov/config.py
[ 1845s] Checking if config is valid python...
[ 1845s] Traceback (most recent call last):
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/scripts/check.py", line 122, in check_config
[ 1845s]     config.load()
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/confreader.py", line 134, in load
[ 1845s]     config = importlib.import_module(name)
[ 1845s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[ 1845s]     return _bootstrap._gcd_import(name[level:], package, level)
[ 1845s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 1845s]   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[ 1845s]   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[ 1845s]   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[ 1845s]   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[ 1845s]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[ 1845s]   File "/tmp/tmpmddmh3ov/config.py", line 10, in <module>
[ 1845s]     tb.set_font(fontsize=12)
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/widget/base.py", line 733, in set_font
[ 1845s]     self.bar.draw()
[ 1845s]     ^^^^^^^^
[ 1845s]   File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/command/base.py", line 281, in __getattr__
[ 1845s]     raise AttributeError(f"{self.__class__} has no attribute {name}")
[ 1845s] AttributeError: <class 'libqtile.widget.textbox.TextBox'> has no attribute bar

the problem here is that the test actually calls set_font() when imported,
which we can't do since we haven't actually configured a bar yet.

This is part of #4868 and suggests that we are somehow not running the
migration tests correctly in our CI.

Signed-off-by: Tycho Andersen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants