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.
This commit is contained in:
David Dalcino
2021-11-22 14:09:46 -08:00
parent e6cd276e20
commit c7320cb0f1
3 changed files with 93 additions and 6 deletions

View File

@@ -201,10 +201,15 @@ linux_build_jobs.extend(
subarchives="qtbase qttools qt icu", subarchives="qtbase qttools qt icu",
), ),
BuildJob( BuildJob(
"install-src", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", subarchives="qt" "install-src", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", subarchives="qtlottie"
), ),
BuildJob( BuildJob(
"install-doc", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", subarchives="qtdoc" "install-doc", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64",
subarchives="qtdoc qtlottieanimation", module="qtlottie"
),
BuildJob(
"install-example", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64",
subarchives="qtdoc qtlottie", module="qtlottie"
), ),
# test for list commands # test for list commands
BuildJob('list', '5.15.2', 'linux', 'desktop', 'gcc_64', '', spec="<6", list_options={ BuildJob('list', '5.15.2', 'linux', 'desktop', 'gcc_64', '', spec="<6", list_options={

View File

@@ -118,9 +118,18 @@ steps:
fi fi
if [[ "$(SUBCOMMAND)" == "install-src" ]]; then if [[ "$(SUBCOMMAND)" == "install-src" ]]; then
python -m aqt $(SUBCOMMAND) $(HOST) $(TARGET) $(QT_VERSION) --archives $(SUBARCHIVES) python -m aqt $(SUBCOMMAND) $(HOST) $(TARGET) $(QT_VERSION) --archives $(SUBARCHIVES)
ls -lh ./$(QT_VERSION)/Src/*/
fi fi
if [[ "$(SUBCOMMAND)" == "install-doc" ]]; then if [[ "$(SUBCOMMAND)" =~ ^install-(doc|example)$ ]]; then
python -m aqt $(SUBCOMMAND) $(HOST) $(TARGET) $(QT_VERSION) --archives $(SUBARCHIVES) opt=""
if [[ "$(MODULE)" != "" ]]; then
opt+=" -m $(MODULE)"
fi
python -m aqt $(SUBCOMMAND) $(HOST) $(TARGET) $(QT_VERSION) --archives $(SUBARCHIVES) $opt
# Docs install to ./Docs/Qt-6.1.0/qtdoc/
# Examples install to ./Examples/Qt-6.1.0/demos
ls -lh ./*/Qt-$(QT_VERSION)/*/
fi fi
if [[ "$(SUBCOMMAND)" == "install-tool" ]]; then if [[ "$(SUBCOMMAND)" == "install-tool" ]]; then
opt="" opt=""

View File

@@ -334,6 +334,68 @@ def tool_archive(host: str, tool_name: str, variant: str, date: datetime = datet
r"Time elapsed: .* second" r"Time elapsed: .* second"
), ),
), ),
(
"install-src windows desktop 5.14.2".split(),
"windows",
"desktop",
"5.14.2",
"",
"",
"windows_x86/desktop/qt5_5142_src_doc_examples/Updates.xml",
[
MockArchive(
filename_7z="qtbase-everywhere-src-5.14.2.7z",
update_xml_name="qt.qt5.5142.src",
version="5.14.2",
contents=(
PatchedFile(
filename="Src/qtbase/QtBaseSource.cpp",
unpatched_content="int main(){ return 0; }",
patched_content=None, # not patched
),
),
),
],
re.compile(
r"^aqtinstall\(aqt\) v.* on Python 3.*\n"
r"Warning: The parameter 'target' with value 'desktop' is deprecated and marked for removal in a future version of aqt.\n"
r"In the future, please omit this parameter\.\n"
r"Downloading qtbase\.\.\.\n"
r"Finished installation of qtbase-everywhere-src-5\.14\.2\.7z in .*\n"
r"Finished installation\n"
r"Time elapsed: .* second"
),
),
(
"install-src windows 5.14.2".split(),
"windows",
"desktop",
"5.14.2",
"",
"",
"windows_x86/desktop/qt5_5142_src_doc_examples/Updates.xml",
[
MockArchive(
filename_7z="qtbase-everywhere-src-5.14.2.7z",
update_xml_name="qt.qt5.5142.src",
version="5.14.2",
contents=(
PatchedFile(
filename="Src/qtbase/QtBaseSource.cpp",
unpatched_content="int main(){ return 0; }",
patched_content=None, # not patched
),
),
),
],
re.compile(
r"^aqtinstall\(aqt\) v.* on Python 3.*\n"
r"Downloading qtbase\.\.\.\n"
r"Finished installation of qtbase-everywhere-src-5\.14\.2\.7z in .*\n"
r"Finished installation\n"
r"Time elapsed: .* second"
),
),
( (
"install 5.9.0 windows desktop win32_mingw53".split(), "install 5.9.0 windows desktop win32_mingw53".split(),
"windows", "windows",
@@ -595,9 +657,20 @@ def test_install(
"* Please use 'aqt list-qt windows desktop --modules 5.15.0 <arch>' to show modules available.\n", "* Please use 'aqt list-qt windows desktop --modules 5.15.0 <arch>' to show modules available.\n",
), ),
( (
"install-src windows desktop 5.15.0 -m nonexistent foo", "install-doc windows desktop 5.15.0 -m nonexistent foo",
"windows-5152-src-doc-example-update.xml", "windows-5152-src-doc-example-update.xml",
"The packages ['foo', 'nonexistent', 'src'] were not found while parsing XML of package information!\n" "Warning: The parameter 'target' with value 'desktop' is deprecated and marked for removal in a future "
"version of aqt.\n"
"In the future, please omit this parameter.\n"
"The packages ['doc', 'foo', 'nonexistent'] were not found while parsing XML of package information!\n"
"==============================Suggested follow-up:==============================\n"
"* Please use 'aqt list-qt windows desktop --arch 5.15.0' to show architectures available.\n"
"* Please use 'aqt list-qt windows desktop --modules 5.15.0 <arch>' to show modules available.\n",
),
(
"install-doc windows 5.15.0 -m nonexistent foo",
"windows-5152-src-doc-example-update.xml",
"The packages ['doc', 'foo', 'nonexistent'] were not found while parsing XML of package information!\n"
"==============================Suggested follow-up:==============================\n" "==============================Suggested follow-up:==============================\n"
"* Please use 'aqt list-qt windows desktop --arch 5.15.0' to show architectures available.\n" "* Please use 'aqt list-qt windows desktop --arch 5.15.0' to show architectures available.\n"
"* Please use 'aqt list-qt windows desktop --modules 5.15.0 <arch>' to show modules available.\n", "* Please use 'aqt list-qt windows desktop --modules 5.15.0 <arch>' to show modules available.\n",