Commit Graph

25065 Commits

Author SHA1 Message Date
toofar f78a4132d6 june 7th 2024-06-07 19:46:27 +12:00
toofar c5138992c7 june 6th 2024-06-06 19:13:20 +12:00
toofar 7612b89680 june 3rd 2024-06-03 09:10:14 +12:00
toofar d897d23140 june 1st 2024-06-01 17:00:46 +12:00
toofar 88574d5861 may 31st 2024-05-31 18:33:09 +12:00
toofar fa3fc1e6a8 may 30th 2024-05-30 18:31:13 +12:00
toofar daa67280c6 may 29th 2024-05-29 17:31:10 +12:00
toofar 9d4e6c3662 may 28th 2024-05-28 18:30:45 +12:00
toofar 28697e943a may 27th 2024-05-27 17:38:22 +12:00
toofar 10faacff70 go back to hardcoding the worker number in each job
Two issues with putting it as an env var:
* shellcheck (via actionlint) claim it needs to be enclosed in double
  quotes, but it's already in a double quoted string and I can't be
  bothered dealing with yaml quoting
* the windows run doesn't seem to pick it up, maybe env vars don't work
  on windows?

Whatever, we can figure out how to make it nicely over overridable later. I
just want to get a stable branch I can re-run through the week.
2024-05-26 12:22:16 +12:00
toofar 82bb28adf6 Switch to using env var for pytest jobs, skip pylint
When I tried to include a default workers arg at the top level of the
matrix definition all it ended up doing it running a single job with "-n
2" and ignoring the whole include block, weird. Don't really understand
it yet: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations

Falling back to putting it in an env var so at least it's only specified
once.

Drop the pylint parallelism because it's complaining that `Value
'config.cache' is unsubscriptable (unsubscriptable-object)` in many
places. Aha, that's why I've been seeing that locally and not on CI!
2024-05-26 12:08:00 +12:00
toofar da0e86aa1f try running tests with two workers
From https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runners have 4 cores (apart from macos-11).

We could use `-n auto`, but I hypothesis that for the e2e tests since we
have one worker process per test process maybe we don't want to actually
use up all the cores with test processes? It doesn't look like it's
possible to tell pytest-xdist to use all core but one, or half the
cores, or anything (issue
herehttps://github.com/pytest-dev/pytest-xdist/issues/477).
So lets just set it to 2 for now which should be a lot faster than 1, if
it works.
2024-05-26 11:51:09 +12:00
Florian Bruhin 7d32df88cb Adjust security patch version for Qt 6.7.1 2024-05-25 14:51:29 +02:00
Florian Bruhin 63b5708bae Revert "adjust test strings for incrementing connection IDs"
This reverts commit ccebbd6ebb.
2024-05-25 14:49:51 +02:00
Florian Bruhin b41cc1d0fc Syntax simplifications
- Drop trailing comma inside trivial tuple
- Use r"""...""" for string containing ", as \" inside r"..." is taken literally
  (I'm surprised it works!)
- Use ['"] instead of ('|")
- Also adjust the inner [^'] to [^'"] for consistency
2024-05-25 13:19:42 +02:00
Florian Bruhin af1d537970 Try stabilizing 'Clicking on focused element'
The problem was that 'qute-input focused' wasn't logged. Let's see if this helps.
2024-05-25 13:19:42 +02:00
Florian Bruhin 04b2b0bdea Revert "Use a proper increasing id for ipc logging"
This reverts commit 7144e72116.

Turns out this adds complexity, but doesn't really help with debugging that
much, and also needs us to guess what the correct ID might be.

We should rather go for a nicer (but more invasive) cleanup by having a separate
IPCConnection class that stores a socket and ID, see #8208.
2024-05-25 13:17:13 +02:00
Florian Bruhin 8ca2b7939f
Merge pull request #8199 from qutebrowser/feat/8170_pdfjs_withresolve
Add Promise.withResolvers polyfill for latest PDF.js version
2024-05-25 13:09:52 +02:00
toofar e86ef0b2fd update changlog entry for pdf.js fix 2024-05-25 09:42:02 +12:00
toofar 3aaa3ce16d Adapt pdf.js unit test for changed string delims
As of at the very least the latest version the version string looks
like:

    const pdfjsVersion = "4.2.67";

So change the regex to allow double quotes too.
2024-05-25 09:41:44 +12:00
toofar 7eb32a7550 update_3rdparty: move dict related imports into method
I'm trying to update pdf.js in the bleeding edge CI jobs. It complains
that either it can't find PyQt or it can't find yaml depending on how I
invoke tox. Joy. Since dict stuff isn't run by default in this script
hopefully that is the only broken import path and moving it into the
function lets the pdfjs (and ace) bit of the script work fine.

Actually, looking at the stack traces below, both of them are from dict
related code!

    tox exec -re bleeding -- python scripts/dev/update_3rdparty.py --gh-token ***
      Traceback (most recent call last):
        File "/__w/qutebrowser/qutebrowser/scripts/dev/update_3rdparty.py", line 20, in <module>
          from scripts import dictcli
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/dictcli.py", line 25, in <module>
          from qutebrowser.browser.webengine import spell
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/browser/webengine/spell.py", line 14, in <module>
          from qutebrowser.utils import log, message, standarddir
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/utils/message.py", line 15, in <module>
          from qutebrowser.qt.core import pyqtSignal, pyqtBoundSignal, QObject
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/qt/core.py", line 17, in <module>
          machinery.init_implicit()
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/qt/machinery.py", line 278, in init_implicit
          raise NoWrapperAvailableError(info)
      qutebrowser.qt.machinery.NoWrapperAvailableError: No Qt wrapper was importable.

    python scripts/dev/update_3rdparty.py --gh-token ***
      Traceback (most recent call last):
        File "/__w/qutebrowser/qutebrowser/scripts/dev/update_3rdparty.py", line 20, in <module>
          from scripts import dictcli
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/dictcli.py", line 25, in <module>
          from qutebrowser.browser.webengine import spell
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/browser/webengine/spell.py", line 14, in <module>
          from qutebrowser.utils import log, message, standarddir
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/utils/message.py", line 17, in <module>
          from qutebrowser.utils import usertypes, log
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/utils/usertypes.py", line 16, in <module>
          from qutebrowser.utils import log, qtutils, utils
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/utils/qtutils.py", line 39, in <module>
          from qutebrowser.utils import usertypes, utils
        File "/__w/qutebrowser/qutebrowser/scripts/dev/../../scripts/../qutebrowser/utils/utils.py", line 29, in <module>
          import yaml
      ModuleNotFoundError: No module named 'yaml'
2024-05-25 09:41:44 +12:00
toofar 22370b457f Install recent pdf.js in some CI jobs
This installs pdf.js in a selection of CI jobs. Previously the PDF.js
tests (in qutescheme.feature) were skipped in CI because it wasn't
installed anywhere. There has been a couple of recent cases where pdf.js
started depending on javascript features that are too new for even the
most recent QtWebEngine to support. The aim of this commit is to catch
that case. This doesn't add coverage for older webengine releases.

This also incidentally updates the ace editor in these test jobs, since that is
also updated by default by the update_3rdparty script. Hopefully that
doesn't cause issues.

The reasoning for installing on each type of job:

*ubuntu jobs*: not installed - while our main test runs are on ubuntu
  there is an upstream issue where many assets used by pdf.js (like icons
  used in the toolbar) aren't packaged, see #7904. This causes warning
  messages because assets requested via qutescheme can't be found, which
  causes the tests to fail. We could a) install pdf.js from source instead
  of using the ubuntu one b) ignore the warning logs c) skip this
  environment and rely on tests elsewhere. I've chosen to do (c). I don't
  see a huge benefit in testing pdf.js across multiple environments if we
  aren't using it installed from the OS anyway. We could install from
  source but currently all the Qt < 6.5 tests are failing from some other
  JS error, and I think fixing that is out of scope of this issue.

*docker Qt6*: installed - the archlinux pdfjs package works fine and we are
  only testing the most recent Qt versions because arch users are expected
  to stay up to date.

*docker Qt5*: not installed - doesn't support JS features required by
  PDF.js. I guess we could install the legacy build from source here. I'm
  mostly worried about catching new breakages for this commit though

*windows*: installed - we install pdf.js from source when making a
  release so it would be nice to do that in tests too.

*macos*: not installed - the tests that were catching the breakages are
  end2end tests which we don't run on mac. And I think there was an
  error from the :versions tests here, don't remember.

*bleeding edge*: installed - from source

pdf.js tests fail on Qt < 6.5 with `Uncaught TypeError: Cannot read
properties of null (reading 'mainContainer')`

The `TestPDFJSVersion.test_real_file` unit tests currently fails because
`version._pdfjs_version()` returns `unknown (bundled)`, not sure why. I
think this is pre-existing and it also wasn't being run on CI.
2024-05-25 09:41:44 +12:00
toofar 48d57cd5c8 Add `Promise.withResolvers()` polyfill for pdf.js
It's needed for both the main page (which we generate using jinja) and
the worker script.

Closes: https://github.com/qutebrowser/qutebrowser/issues/8170
2024-05-25 09:41:44 +12:00
toofar 1f2a0016b7 put windows IPC fix changelog in correct release [ci skip] 2024-05-25 09:40:44 +12:00
toofar 68a8d618d6 update changelog for flaky windows qtimer issue 2024-05-25 09:34:01 +12:00
toofar 669795058b Handle "early timer" log messages in tests
The `test_cleanup()` test for guiprocess was triggering the early timer
warning messages because it was using a VeryCourse timer with a 100ms
interval. Changed it to to a normal Course timer (the default) for that
test.

For the `ipc-timeout` timer we know that is happening in the tests on
windows. It's being logged in lost of e2e tests, the elapsed times it's
logging are between 0 and 0.020s. I'm not sure if it's the right thing
to be changing the log level in production code or marking the messages
as expected in test code.
2024-05-25 09:34:01 +12:00
toofar 5e4d0f1870 Add unit tests for early timer firing checking 2024-05-25 09:34:01 +12:00
toofar ccebbd6ebb adjust test strings for incrementing connection IDs 2024-05-25 09:34:01 +12:00
toofar f6e9295c50 remove unneeded QTimer imports 2024-05-25 09:34:01 +12:00
toofar 9c8a80798a Use common timer validity check in usertypes.Timer
Since we are now checking for early timer firings in usertype.Timer I
figured why do it in two places, lets call the check method on Timer in
the handler in the IPC class too.

I also removed the platform and version check because while the bug only
happens under those conditions the check to ensure a timer event was
valid should work everywhere. Right? We can add them back of someone
wants but I'm not sure I see a point.

It would be nice if we could filter out invalid timer events in
usertypes.Timer and not require the consuming code to have to do
anything. But that would be more work, so lets wait until more places of
code actually need to care about it, chances are it'll be fixed in Qt
soon enough anyway.

I also think usertypes.Timer should be restarting the time so it gets
called at the proper time. But if we aren't filtering the events that
would mean it gets called twice.
2024-05-25 09:34:01 +12:00
toofar c5fa5a0dc9 lint: Add misc check for QTimer initialization
Since we added some sanity checking in usertypes.Timer() around
QTBUG-124496 it would be convenient if there was a reminder for future
timer users to use our Timer object instead. Here's one!

It's looking for QTimer initialisations, we are still allowing
QTimer.singleShot(), although that probably can hit the same issue.

It uses an end-of-line anchor in the regex so you can put a comment (any
comment) on the end of the line to ignore the check.
2024-05-25 09:34:01 +12:00
Florian Bruhin 38abfdb8a0 check more timers 2024-05-25 09:34:01 +12:00
Florian Bruhin 52346a1910 Check all timers for early triggering 2024-05-25 09:34:01 +12:00
Florian Bruhin 38053466fd Ignore timeout 2024-05-25 09:34:01 +12:00
Florian Bruhin 00c56456be back to normal ipc impl 2024-05-25 09:34:01 +12:00
Florian Bruhin 5b84600fa6 logging 2024-05-25 09:34:01 +12:00
Florian Bruhin 48b27a356c timestamps 2024-05-25 09:34:01 +12:00
Florian Bruhin ef0517da69 Use a separate IPCConnection class 2024-05-25 09:34:01 +12:00
Florian Bruhin 4fadca2ae7 tests: Make ssl message matching fuzzier
Windows seems to struggle with the dash
2024-05-25 09:34:01 +12:00
Florian Bruhin 7144e72116 Use a proper increasing id for ipc logging 2024-05-25 09:34:01 +12:00
Florian Bruhin 6d99dff10b Merge branch 'update-dependencies' 2024-05-24 21:53:08 +02:00
Florian Bruhin a2983553bb Merge branch 'feat/pyqt67_enablement' 2024-05-24 21:51:34 +02:00
Florian Bruhin 72d7e2327b Update for new pylint/astroid releases
- Add a couple new "raise utils.Unreachable" to avoid
  possibly-used-before-assignment issues.
- Simplify an "if" for the same reason
- Remove an unneeded "return"
- Use "NoReturn" to prepare for pylint knowing about it in the future:
  https://github.com/pylint-dev/pylint/issues/9674
- Add some ignores for used-before-assignment false-positives
- Ignore new undefined-variable messages for Qt wrapers
- Ignore a new no-member warning for KeySequence:
  https://github.com/pylint-dev/astroid/issues/2448#issuecomment-2130124755
2024-05-24 21:46:04 +02:00
Florian Bruhin 470ec752e1 Add Riverbank Computing as extra index for PyQt requirements
Easier fix instead of 6c4be8ef03.
Seems to get picked up just fine, and shouldn't hurt when it's not needed, as we
don't use --pre. Thus, no development releases should be installed.
2024-05-24 17:08:56 +02:00
Florian Bruhin 0f51171141 Revert "Try getting PyQt 6.7 from Riverbank server"
This reverts commit 6c4be8ef03.

Possibly easier solution in next commit.
2024-05-24 17:08:56 +02:00
Florian Bruhin 8b44c26146 Try getting PyQt 6.7 from Riverbank server
See https://www.riverbankcomputing.com/pipermail/pyqt/2024-April/045832.html and https://github.com/pypi/support/issues/3949
2024-05-24 17:08:56 +02:00
toofar 3f1842b729 Update requirements and CI for PyQt6.7
6.7 is released now, some distros are already shipping it!

This commit:
1. adds a new 6.7 requirements file (the plain 6 one has already been
   updated by the bot)
2. adds a new tox env referring to the new requirements file
3. updates the mac and windows installer jobs to run with pyqt67 with the
   assumption we'll be including that in our next release
4. adds two new CI environments for 6.7, one each for python 3.11 and 3.12
   (3.12 only came out like 6 months ago)
5. updates a couple of references to the py37 tox env that looked like they
   were missed, 3.7 support was dropped in 93c7fdd
6. updates various ubuntu containers to the latest LTS instead of the previous
   related one - this is quite unrelated to this change but I thought I would
   give it a go, no need to use the old one unless we are specifically testing
   on it?
   - linters - they use tox but probably use system libraries
   - these all run in nested containers anyway, should be fully isolated
   - codeql - eh, uses a third party action, check the docs if it fails
   - irc - as above
2024-05-24 17:08:56 +02:00
Florian Bruhin f72b862da5 tests: Re-add pytest-benchmark warning ignore
This was fixed but never released...
2024-05-24 17:07:52 +02:00
Florian Bruhin ecf0fd225a Increase YAML warning deadline with --with-pydebug
This makes things significantly slower
2024-05-24 16:57:20 +02:00
Florian Bruhin 6339eacda4 py313: Upgrade typing-extensions 2024-05-23 14:52:10 +02:00