coin: Add instructions for running license checker during test phase

Add yaml instructions to run the license checker from the qtqa dev
branch, when the LicenseCheckV2 feature is enabled.

This is intended to replace the old legacy instructions that are
hard coded into Coin, that are activated via the 'LicenseCheck' and
'UseLegacyInstructions' features.

We can't reuse the old name and remove the 'UseLegacyInstructions'
feature, because Coin expects license checking instructions to be
added to a separate 'LicenseCheck' phase in the yaml file,
and doesn't allow doing it in the 'Test' phase.

A platform config should enable both the LicenseCheckV2 and TestOnly
features, to ensure the license checking doesn't wait for the build to
finish before running.

The instructions are added to
coin_module_test_template_v3.yaml and
coin_module_test_template_v2.yaml
so that we don't have to add them manually to all repo's
module_config.yaml file, but rather reuse the existing yaml files.

We add the instructions to the v2 file as well, because not all repos
have been ported to v3, like qtmqtt, which is not ported on purpose,
because tests don't pass there currently.

Note that so far, all license checking was done using the qtqa master
branch, not the dev branch. The dev branch currently has more changes
than master (many changes were not cherry-picked). That means that the
check might fail in some repos, and thus have to be fixed.

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Task-number: QTBUG-125569
Task-number: QTQAINFRA-3935
Change-Id: I715b99853aa041cb036d6b61b071746f010565d0
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 2a0e89981a52633c497f62bad0c7d26c466493cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2024-07-25 11:48:55 +02:00 committed by Qt Cherry-pick Bot
parent 29df33a1a4
commit 37dc5b91fd
3 changed files with 53 additions and 6 deletions

View File

@ -1,5 +1,12 @@
type: Group
instructions:
- type: Group
instructions:
- !include "{{qt/qtbase}}/run_license_check.yaml"
enable_if:
condition: property
property: features
contains_value: LicenseCheckV2
- type: Group
instructions:
- !include "{{qt/qtbase}}/coin_module_test_template_common.yaml"
@ -19,6 +26,11 @@ instructions:
property: target.osVersion
in_values: [QEMU, QNX_710]
disable_if:
condition: property
condition: or
conditions:
- condition: property
property: features
contains_value: DisableTests
- condition: property
property: features
contains_value: LicenseCheckV2

View File

@ -1,5 +1,12 @@
type: Group
instructions:
- type: Group
instructions:
- !include "{{qt/qtbase}}/run_license_check.yaml"
enable_if:
condition: property
property: features
contains_value: LicenseCheckV2
- type: Group
instructions:
- !include "{{qt/qtbase}}/coin_module_test_template_common.yaml"
@ -19,6 +26,11 @@ instructions:
property: features
contains_value: AndroidTestRun
disable_if:
condition: property
condition: or
conditions:
- condition: property
property: features
contains_value: DisableTests
- condition: property
property: features
contains_value: LicenseCheckV2

View File

@ -0,0 +1,23 @@
type: Group
instructions:
- type: ChangeDirectory
directory: "{{.AgentWorkingDir}}"
- type: InstallSourceArchive
maxTimeInSeconds: 600
maxTimeBetweenOutput: 600
project: qt/qtqa
ref: dev
directory: qt/qtqa-latest
userMessageOnFailure: >
Could not install qtqa source archive. Please investigate why.
- type: EnvironmentVariable
variableName: QT_MODULE_TO_TEST
variableValue: "{{.SourceDir}}"
userMessageOnFailure: >
Failed to set QT_MODULE_TO_TEST environment variable. This should not happen.
- type: ExecuteCommand
command: perl qt/qtqa-latest/tests/prebuild/license/tst_licenses.pl
maxTimeInSeconds: 7200
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to run license check script.