Commit Graph

61 Commits

Author SHA1 Message Date
Alexandre Poumaroux
5d699b9ebf Commercial fixes, CI tests, more tests, coverage (#883)
* Add authentication flags for list-qt-commercial, add tests for coverage

* Add dry run

* Make tests really use auth since secrets have been added, fix some indents

* Fix auth issue, rename user 'email, and password 'pw'

* Fix modules param type

* Update commands names
2025-02-22 09:56:56 +09:00
Alexandre Poumaroux
cbe159f38a Add support for commercial versions of Qt (#878)
* Add install-qt-commercial feature and tests

* Make the auto-answers parameters, fix linter issues

* Fork and execv instead of using subprocess

* Return to simpler process execution method version

* Fix test

* Move commercial installer into its own file

* Fix shadowing of symbol platform causing errors

* Adapt test_cli for argparse format changes on py 3.13+

* Fix some errors, monkeypatch install test

* Add --override super command

* Properly handle --override and grab all the remaining commands when no quotes are given

* Fix tests

* Add base for modules, some niche features are not yet entirely implemented, and there are no updates to the testsuite

* Fix some mistakes

* Fix errors made with the monkeypatch, update Settings to make sure its init

* Tests commercial (#20)

* Full support of installation of all modules and addons
* Add auto setup of cache folder for each OS, add unattended parameter
* Fix settings folders
* Add graceful error message for overwrite case

* Fix windows issue

* Hidden summon works

* Remove both subprocess direct calls

* Dipose of temp folder

* Fix path issue

* Add list-qt-commercial command

* Fix help info

* Make no params valid for list-qt-commercial

* Fix lint errors, and param overflow when no args are passed to list

* Fix search

* Add tests for coverage, fix lint

* Test for overwriting, and for cache usage coverage

* Return to clean exec, ignoring CI fail to preserve code clarity

* Fix parsing of subprocess.run output for some python versions

* Make output more readable in console for list-qt-commercial

* Forward email and password to list request for users without a qtaccount.ini

* Change default settings

* Fix lint errors

* Fix check error
2025-01-28 20:51:53 +09:00
Alexandre Poumaroux
a09b5cee28 Fix WASM (#846)
* Rewrite WASM support

* Add WASM tests to CI, update CI to test more the latest versions, add auto EMSDK version detection function

* Fix some mistakes, typos, moved emsdk version function into BuildJob

* Fix issue related to extensions interfering with wasm on 6.8+

* Fix tests

* Remove dep on Version in CI

* Remove safety before patch

* handle cases where extensions don't exist.

for example with windows desktop 6.8.1 win64_msvc2022_arm64_cross_compiled
both qtwebengine and qtpdf don't exist.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* for --long-modules assume extension doesn't exist on download error.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* for --modules assume extension doesn't exist for download failures.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* reformat with black

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* fix flake8 regression that doesn't occur locally.

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Fix autodesktop by also updating the OS when searching for a valid desktop version to download

* Fix extension issue, reduce the possible retry for getting extensions to prevent server spam

* Fix CI asking for msvc2019 on 6.8+ but its no longer supported

* Make CI use C++20 and MSVC2022

* Fix linux build

* Update runners to windows-2022

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Fix patching

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Add back the semantic version changes to prevent crashes, add tests for it

* Update checks

* Cast 'https://mirrors.ustc.edu.cn' to the shadow realm

* Again

* Update settings.ini

* Update settings.ini

* Update settings.ini

* Remove one_rep on silent

* Update settings.ini

* Restore master settings, remove hash check

* ci: Use specific mirror

Attempt to work around download errors in Azure due to Qt's official download site often redirecting to mirrors to which the network connection is unstable

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Re enable hash checking

* Treat read timeout error during download as connection error

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>

* Add test for modules in WASM with autodesktop

* Fix format

* Fix test

* Make '--autodesktop' trigger its own install process, and test it

* Fix older autodesktop tests

* Add mock update files for 680 wasm, add test for wasm 680 autodesktop

* Passes the additional tests

* Fix format

* Improve coverage, fix format

* Fix tests and improve logging or install

* Fix format

* Fix regression in other tests

* Use flavor

* Fix line len

* Fix codeql

* Fix list-qt for WASM arch on 6.5.x and 6.6.x, restore to original download URL

* Fix test error

* Revert ci settings URL as it is never used by clients, only in CI

* Add comment for clarity in ci/settings.ini

---------

Signed-off-by: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com>
Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Co-authored-by: J.D. Purcell <jdpurcell@gmail.com>
2025-01-06 15:35:40 +09:00
tsteven4
6dc847e599 enhance test_install to exercise extensions 2024-12-26 11:39:08 -07:00
J.D. Purcell
2e7a1cb4b9 Update test script to recognize new patch behavior 2024-12-14 18:46:44 -05:00
tsteven4
a590b6e208 attempt to fix types test 2024-11-30 16:21:59 -07:00
Hiroshi Miura
2a8eb72c0b refactor: test: update cases and expectations
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-09-29 12:17:44 +09:00
Hiroshi Miura
6c2960dce7 fix: test: update expectations
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-08-05 08:01:13 +09:00
Andrew Wason
1615782c25 Fixes and tests. Untested Azure pipeline support. 2024-03-05 18:37:15 -05:00
Dave Dalcino
5c2c18d96b Fix installation of win64_msvc2019_arm64 arch
This fixes the behavior of the `--autodesktop` flag and the updater,
when installing win64_msvc2019_arm64 for desktop targets.
2023-09-06 18:09:02 -07:00
Dave Dalcino
772edb83bf Fix test_install that fails on Python<3.11.4
The tarfile test does not permit the new warning, "Extracting may be
unsafe; consider updating Python to 3.11.4 or greater". This change
should allow the test to succeed when running on 3.11.4 and below.
2023-08-28 05:44:03 -07:00
Dave Dalcino
c3195c9d64 Use 'tar' filter when extracting tarfiles
This is to address a SNYK warning. The new code will only run on Python
3.11.4 and above
2023-08-27 18:45:46 -07:00
Dave Dalcino
7c0de86f78 Add tests for sdktool: install-tool and list-tool 2023-05-24 15:38:13 -07:00
Dave Dalcino
c9732c7c2c Fix broken test 2023-03-25 11:45:15 -07:00
Dave Dalcino
e4fa75147f Test nonspecific OSError 2023-03-14 01:24:03 -07:00
Dave Dalcino
8dd56ff461 Catch OSError(errno.ENOSPC) and PermissionError
When the destination drive is not writable or has insufficient space,
these exceptions are raised during `run_installer`. Unless they are
caught and dealt with, `aqtinstall` requests that the user file a bug
report. This change catches these errors and prints a nice error message
instead of requesting a bug report.
2023-03-13 17:48:09 -07:00
Dave Dalcino
6a0c174e01 Improve warning messages re: unknown aqt arguments
This improves the warnings about unknown versions, modules, and
architectures of Qt, so that it is more explicit what the message
actually means.

This changes the purpose of `Cli._check_modules_arg` from checking if
modules exist in combinations.json, to returning a list of modules
that do not exist in that file. The function has been renamed as well.
This change was necessary to make the warning message more informative.
2023-02-16 14:01:39 -08:00
Dave Dalcino
e30d3198a4 Fix errors in install-* caused by duplicate 'modules'
Fixes #632
2023-01-07 06:57:28 -08:00
Hiroshi Miura
0f1010baee Load settings.ini in child process
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-12-05 19:50:51 +09:00
Dave Dalcino
839cf6e2f3 Patch according to new installscript.qs rules
This removes the inappropriate ENV variables set in steps.yml.
It's not wrong to set those variables, but the official Qt installer
patches the defaults properly, so you don't have to do it manually.
It's wrong to expect our users to set these.

This also patches target_qt.conf to add HostLibraryExecutables.
2022-12-04 16:44:45 -08:00
Dave Dalcino
6db730e659 fix backslashes on windows 2022-12-04 10:42:49 -08:00
Dave Dalcino
18c8259e8c Set executable file permissions for qmake 2022-12-04 10:42:48 -08:00
Dave Dalcino
0cc15b31c6 Add tests for android qt 6.4.1, using "wrong" platforms
Since Qt 6.4.1, the Qt devs stopped building android binaries for
all platforms: see https://bugreports.qt.io/browse/QTBUG-108707

> we are building android packages only in one host & use those in other ones:
> android armv7 is build only in windows
> android arm64 is build only in mac
> android x86 and android x86_64 are build only in linux

This adds tests for Qt 6.4.1 on platforms that are not the platforms that
Qt was built for, so that:
* the binaries built on Mac are tested on Linux
* the binaries built on Linux are tested on Windows
* the binaries built on Windows are tested on Mac

There should be 3 more permutations of this pattern, but I prefer to
ignore them to save on CI build times.
2022-12-02 17:31:53 -08:00
Dave Dalcino
24f6d9ddca Add cli tests for long_modules and modules with archives
This should cover the new lines of uncovered code in this PR.
2022-11-21 07:34:46 +09:00
Dave Dalcino
d73c89a89f fix expected error message in test cases 2022-11-14 19:23:44 -08:00
Dave Dalcino
e716a7805a Add test for uncovered code 2022-10-12 18:10:15 -07:00
David Dalcino
3bb364b301 Fix type error 2022-08-20 09:28:50 -07:00
Dave Dalcino
bcd4e03838 Refactor test_install to mock multiple Qts
This will allow testing multiple qt installations, as required by the
feature that installs the default desktop qt where required

Add autodesktop test for ios
2022-08-20 09:09:36 -07:00
Dave Dalcino
861a3d6b61 Improve install test patch specificity 2022-08-20 09:04:52 -07:00
Dave Dalcino
ed6cf76968 Add CLI option to install desktop qt automatically
This change also causes aqt to emit a warning when the option is not
turned on and the expected desktop Qt is not found.
2022-08-20 07:53:00 -07:00
Dave Dalcino
317bf64ace Add direct test that MetadataFactory receives base_url 2022-08-07 11:34:49 -07:00
Mozi
60889b7296 Log: left align the level name with padding (#539)
* Change log format for brief

- prepend %(levelname)s:

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Update test expectations for error/warning messages

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* log: left align the level name with padding

Why 8: sizeof("CRITICAL") == 8

Ref:
  printf-style String Formatting § Built-in Types — Python 3 documentation
  https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

* log: remove the duplicate "warning" words

Co-authored-by: Hiroshi Miura <miurahr@linux.com>
2022-07-18 22:29:16 +09:00
David Dalcino
ad20856738 Fix patching of Qt6.2.2-ios (#510)
* Add tests for proper patching of Qt6.2.2-ios
* Add a build target for ios installations
* Add test coverage for mobile patching on linux

This change folds in some refactoring as well, in an attempt to reduce
repetitive logic, and make sure that this logic is used everywhere appropriate.
2022-04-04 14:22:13 +09:00
David Dalcino
49a6cf97b6 Remove unnecessary usage of eval function 2022-03-10 18:29:18 -08:00
David Dalcino
be23b62549 Update tests to require proper checksums 2022-03-06 17:56:25 -08:00
David Dalcino
96af3eb393 Refactor: split QtArchive.archive_url into parts
This splits QtArchive.archive_url into two new datamembers: archive_path
and base_url. Ultimately, base_url should be removed from QtPackage
entirely.
2022-03-06 17:36:32 -08:00
David Dalcino
7ebd6aa34e Use sha256 hashes only from trusted mirrors
To keep this commit small, `hashurl` was removed from QtPackage, and
`get_hash` constructs the hash url based on the url of the 7z archive
to download. I think that in the future, QtArchive and QtPackage could
be refactored to construct this url more appropriately. However, this
would be a complicated change that doesn't belong in this commit.
2022-03-06 17:36:32 -08:00
David Dalcino
05cc2347c7 Merge branch 'master' into topic-fix-453 2021-11-24 22:01:27 -08:00
David Dalcino
3af9c97ba0 Refactor: Allow modifiable download dest path
This adds the parameter `archive_dest` to `run_installer`, which will
control where `helper.downloadBinaryFile` will download files, and sets
it to "." by default.

For convenience/readability, this will also turn any reference to the
downloaded file into a `pathlib.Path` object. This makes it easier to
ensure that the file ends up in the right location.
2021-11-24 13:29:20 -08:00
David Dalcino
cfc241002d Fix suggestions for src/doc/ex missing modules 2021-11-23 12:17:03 -08:00
David Dalcino
b736130f90 flake 2021-11-23 11:42:06 -08:00
David Dalcino
c7320cb0f1 Improve CI & tests for install-src/doc/example
This updates CI and unit tests to monitor behavior of
`install-src/doc/example`, now that the `target` parameter has been
deprecated. This makes sure that the `target` parameter is optional,
and that the CLI warns the user that `target` is deprecated when a user
uses it.

[CI tests]:
This adds a test to `install-src/doc/example` Azure Pipeline jobs to
ensure that the desired files are installed, using `ls`.

This also changes some of the archives installed to `qtlottie`, which
is a particularly small file.

This also adds a build job for `install-example`.

[Unit tests]:
This adds tests for `install-src`, with and without the `target`
parameter.

It also fixes existing tests for `install-doc`, to account for
changes to the `target` parameter.
2021-11-23 11:10:06 -08:00
David Dalcino
7638d87d6c Add unit test for install-tool & tool 2021-10-30 19:23:35 -07:00
David Dalcino
173fbb9b6b Add suggestion on MemoryError to use external 7z 2021-10-29 11:08:15 -07:00
David Dalcino
cf5ca6e468 Add test for --noarchives flag 2021-10-20 19:21:22 -07:00
David Dalcino
d5213142a8 Fix misuse of disable_socket (#415)
In an earlier PR, I added calls to `disable_socket()` from
`pytest_socket` where I thought they were needed to prevent some tests
from accessing the network, in case they weren't monkeypatched properly.
Today, I discovered that `disable_socket()` disables sockets globally
for all tests, which means that the tests that use remote data cannot
run if they are executed after another test calls `disable_socket()`.

This change calls `disable_socket()` once from `conftest.py`, so that
no tests are allowed to use network data unless they are marked as ok
to use the network, with `@pytest.mark.enable_socket`. See example of
usage in `tests/test_connection.py`.

Changed return code for unexpected exceptions:

This allows us to write tests that can discover whether an unexpected
exception occurred just by checking the return code, rather than reading
stderr. This will allow us to write less friable tests that don't break
every time some insignificant output details change.

This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.

This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
2021-10-05 14:40:05 +09:00
David Dalcino
776ab6181f Propagate exceptions from run_installer()
This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.

This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
2021-10-02 18:26:03 -07:00
David Dalcino
a5bb2553ce Add improved error messages for missing archives 2021-09-20 12:46:47 -07:00
David Dalcino
7856631120 Add tests for new installer exceptions raised 2021-09-06 13:09:27 -07:00
David Dalcino
cfd4234877 Expect Cli.run not to exit on connection errors 2021-09-01 12:36:29 -07:00