From b0e4946a9b8cbdb115e7672ddecd48534f0a7515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Tue, 15 Jun 2021 10:14:30 +0300 Subject: Enable CI test on arm64 Change-Id: I26aff00644d85931b5e8ac597c1c5c3c9edb74e9 Reviewed-by: Alexandru Croitor (cherry picked from commit 4debb1824ab57fc1529db630f51366ece7398f74) Reviewed-by: Qt Cherry-pick Bot --- coin/instructions/common_environment.yaml | 7 +++++ coin/instructions/execute_test_instructions.yaml | 26 ++++++++++++++++--- coin/module_config.yaml | 22 ++++++++++++++++ coin_test_instructions.py | 33 ++++++++++++++---------- 4 files changed, 71 insertions(+), 17 deletions(-) diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index 27fe4a27a..fcbd97455 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -104,6 +104,13 @@ instructions: condition: property property: host.os equals_value: Windows + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "/Users/qt/.local/bin/:" + enable_if: + condition: property + property: host.osVersion + equals_value: MacOS_11_00 - type: PrependToEnvironmentVariable variableName: PATH variableValue: "/Users/qt/work/install/bin:" diff --git a/coin/instructions/execute_test_instructions.yaml b/coin/instructions/execute_test_instructions.yaml index 71057d35e..803989e91 100644 --- a/coin/instructions/execute_test_instructions.yaml +++ b/coin/instructions/execute_test_instructions.yaml @@ -4,14 +4,34 @@ enable_if: property: features not_contains_value: LicenseCheck instructions: + - type: ExecuteCommand + command: "python3 -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=ARM64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}}" + maxTimeInSeconds: 14400 + maxTimeBetweenOutput: 1200 + enable_if: + condition: and + conditions: + - condition: property + property: host.osVersion + equals_value: MacOS_11_00 + - condition: property + property: host.arch + equals_value: ARM64 + userMessageOnFailure: > + Failed to execute test instructions on arm mac - type: ExecuteCommand command: "python3 -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}}" maxTimeInSeconds: 14400 maxTimeBetweenOutput: 1200 enable_if: - condition: property - property: host.os - equals_value: MacOS + condition: and + conditions: + - condition: property + property: host.osVersion + equals_value: MacOS_11_00 + - condition: property + property: host.arch + equals_value: X86_64 userMessageOnFailure: > Failed to execute test instructions on osx - type: ExecuteCommand diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 896b39d25..967d57a8d 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -33,6 +33,28 @@ accept_configuration: - condition: property property: features contains_value: TestOnly + - condition: and + conditions: + - condition: property + property: host.osVersion + equals_value: MacOS_11_00 + - condition: property + property: features + contains_value: Packaging + - condition: and + conditions: + - condition: property + property: host.osVersion + equals_value: MacOS_11_00 + - condition: property + property: host.arch + equals_value: ARM64 + - condition: property + property: features + contains_value: TestOnly + - condition: property + property: features + contains_value: Packaging machine_type: Build: diff --git a/coin_test_instructions.py b/coin_test_instructions.py index 46fb60704..13de48f4b 100644 --- a/coin_test_instructions.py +++ b/coin_test_instructions.py @@ -73,22 +73,27 @@ def call_testrunner(python_ver, buildnro): python3 = "python3" if sys.platform == "win32": python3 = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe") - run_instruction([python3, "-m", "pip", "install", "--user", "virtualenv==20.7.2"], "Failed to pin virtualenv") # installing to user base might not be in PATH by default. - # installing to user base might not be in PATH by default. - env_path = os.path.join(site.USER_BASE, "bin") - v_env = os.path.join(env_path, "virtualenv") - if sys.platform == "win32": - env_path = os.path.join(site.USER_BASE, "Scripts") - v_env = os.path.join(env_path, "virtualenv.exe") - try: - run_instruction([v_env, "--version"], "Using default virtualenv") - except Exception as e: + + if CI_HOST_OS == "MacOS" and CI_HOST_ARCH == "ARM64": # we shouldn't install anything to m1, while it is not virtualized v_env = "virtualenv" + run_instruction([v_env, "-p", _pExe, _env], "Failed to create virtualenv") + else: + run_instruction([python3, "-m", "pip", "install", "--user", "virtualenv==20.7.2"], "Failed to pin virtualenv") + # installing to user base might not be in PATH by default. + env_path = os.path.join(site.USER_BASE, "bin") + v_env = os.path.join(env_path, "virtualenv") + if sys.platform == "win32": + env_path = os.path.join(site.USER_BASE, "Scripts") + v_env = os.path.join(env_path, "virtualenv.exe") + try: + run_instruction([v_env, "--version"], "Using default virtualenv") + except Exception as e: + v_env = "virtualenv" + run_instruction([v_env, "-p", _pExe, _env], "Failed to create virtualenv") + # When the 'python_ver' variable is empty, we are using Python 2 + # Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue + run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies") - run_instruction([v_env, "-p", _pExe, _env], "Failed to create virtualenv") - # When the 'python_ver' variable is empty, we are using Python 2 - # Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue - run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies") cmd = [env_python, "testrunner.py", "test", "--blacklist", "build_history/blacklist.txt", "--buildno=" + buildnro] -- cgit v1.2.3