Improve Azure tests for install-src/doc/example

This change updates the usage of `install-src`, `install-doc`, and
`install-example` to omit the optional `TARGET` parameter.
It also changes the usage of `--archives`, so that the archives for
the modules are not be specified.

This also adds customizable checks to each build job, so that specific
requirements can be made on an individual basis.
The three `install-src/doc/example` commands now have specific checks
that will cause the build job to fail if the requested modules and
archives have not been installed.
This commit is contained in:
David Dalcino
2021-12-05 13:41:54 -08:00
parent 633cbacc62
commit 7f97b96b6e
2 changed files with 18 additions and 10 deletions

View File

@@ -33,6 +33,7 @@ class BuildJob:
spec=None, spec=None,
mingw_variant: str = "", mingw_variant: str = "",
tool_options: Optional[Dict[str, str]] = None, tool_options: Optional[Dict[str, str]] = None,
check_output_cmd: Optional[str] = None,
): ):
self.command = command self.command = command
self.qt_version = qt_version self.qt_version = qt_version
@@ -49,6 +50,7 @@ class BuildJob:
# `steps.yml` assumes that qt_version is the highest version that satisfies spec # `steps.yml` assumes that qt_version is the highest version that satisfies spec
self.spec = spec self.spec = spec
self.output_dir = output_dir self.output_dir = output_dir
self.check_output_cmd = check_output_cmd
def qt_bindir(self, *, sep='/') -> str: def qt_bindir(self, *, sep='/') -> str:
out_dir = f"$(Build.BinariesDirectory){sep}Qt" if not self.output_dir else self.output_dir out_dir = f"$(Build.BinariesDirectory){sep}Qt" if not self.output_dir else self.output_dir
@@ -201,15 +203,23 @@ 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="qtlottie" "install-src", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", subarchives="qtlottie",
# Fail the job if this path does not exist:
check_output_cmd="ls -lh ./6.1.0/Src/qtlottie/",
), ),
# Should install the `qtlottie` module, even though the archive `qtlottieanimation` is not specified:
BuildJob( BuildJob(
"install-doc", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", "install-doc", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64",
subarchives="qtdoc qtlottieanimation", module="qtlottie" subarchives="qtdoc", module="qtlottie",
# Fail the job if these paths do not exist:
check_output_cmd="ls -lh ./Docs/Qt-6.1.0/qtdoc/ ./Docs/Qt-6.1.0/qtlottieanimation/",
), ),
# Should install the `qtcharts` module, even though the archive `qtcharts` is not specified:
BuildJob( BuildJob(
"install-example", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", "install-example", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64",
subarchives="qtdoc qtcharts", module="qtcharts" subarchives="qtdoc", module="qtcharts",
# Fail the job if these paths do not exist:
check_output_cmd="ls -lh ./Examples/Qt-6.1.0/charts/ ./Examples/Qt-6.1.0/demos/ ./Examples/Qt-6.1.0/tutorials/",
), ),
# 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={
@@ -368,6 +378,7 @@ for platform_build_job in all_platform_build_jobs:
("TOOL2_ARGS", build_job.tool_options.get("TOOL2_ARGS", "")), ("TOOL2_ARGS", build_job.tool_options.get("TOOL2_ARGS", "")),
("LIST_TOOL2_CMD", build_job.tool_options.get("LIST_TOOL2_CMD", "")), ("LIST_TOOL2_CMD", build_job.tool_options.get("LIST_TOOL2_CMD", "")),
("TEST_TOOL2_CMD", build_job.tool_options.get("TEST_TOOL2_CMD", "")), ("TEST_TOOL2_CMD", build_job.tool_options.get("TEST_TOOL2_CMD", "")),
("CHECK_OUTPUT_CMD", build_job.check_output_cmd or "")
] ]
) )

View File

@@ -117,19 +117,16 @@ steps:
aqt list-example $(HOST) $(QT_VERSION) --modules # print example modules available for host/desktop/version aqt list-example $(HOST) $(QT_VERSION) --modules # print example modules available for host/desktop/version
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) $(QT_VERSION) --archives $(SUBARCHIVES)
ls -lh ./$(QT_VERSION)/Src/*/ $(CHECK_OUTPUT_CMD)
fi fi
if [[ "$(SUBCOMMAND)" =~ ^install-(doc|example)$ ]]; then if [[ "$(SUBCOMMAND)" =~ ^install-(doc|example)$ ]]; then
opt="" opt=""
if [[ "$(MODULE)" != "" ]]; then if [[ "$(MODULE)" != "" ]]; then
opt+=" -m $(MODULE)" opt+=" -m $(MODULE)"
fi fi
python -m aqt $(SUBCOMMAND) $(HOST) $(TARGET) $(QT_VERSION) --archives $(SUBARCHIVES) $opt python -m aqt $(SUBCOMMAND) $(HOST) $(QT_VERSION) --archives $(SUBARCHIVES) $opt
$(CHECK_OUTPUT_CMD)
# 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=""