From 13c460d0ff1a4eecfb7b1bc43a863783ed59a2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Wed, 9 Sep 2020 08:32:21 +0300 Subject: Add coin instructions to run Android test in emulator Task-number: QTQAINFRA-3867 Pick-to: 6.0 Change-Id: Ie6dd9c2dfeeccd526c2133d7ac03efce5b7ed091 Reviewed-by: Assam Boudjelthia --- .../call_cmake_for_standalone_tests.yaml | 14 +++++++++++++ .../cmake_regular_test_instructions_common.yaml | 10 +++++++++ .../coin_module_test_android_start_emulator.yaml | 24 ++++++++++++++++++++++ .../coin_module_test_template_common.yaml | 1 + .../instructions/coin_module_test_template_v3.yaml | 3 +++ .../coin_qtbase_build_template_v2.yaml | 20 +++++------------- 6 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 coin/instructions/coin_module_test_android_start_emulator.yaml (limited to 'coin') diff --git a/coin/instructions/call_cmake_for_standalone_tests.yaml b/coin/instructions/call_cmake_for_standalone_tests.yaml index 501ab3abab..7ab936cf87 100644 --- a/coin/instructions/call_cmake_for_standalone_tests.yaml +++ b/coin/instructions/call_cmake_for_standalone_tests.yaml @@ -1,5 +1,19 @@ type: Group instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}" + - type: ExecuteCommand + command: "{{.SourceDir}}/util/android/android_cmakelist_patcher.sh" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to patch CMakeLists.txt. + enable_if: + condition: property + property: features + contains_value: AndroidTestRun + - type: ChangeDirectory + directory: "{{.BuildDir}}" - type: ExecuteCommand command: "{{.Env.TESTS_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_CMAKE_TESTS}}\\bin\\qt-internal-configure-tests {{.Env.COIN_CMAKE_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution diff --git a/coin/instructions/cmake_regular_test_instructions_common.yaml b/coin/instructions/cmake_regular_test_instructions_common.yaml index ec6f23a3f7..3a9e75c576 100644 --- a/coin/instructions/cmake_regular_test_instructions_common.yaml +++ b/coin/instructions/cmake_regular_test_instructions_common.yaml @@ -11,3 +11,13 @@ instructions: Failed to install tests archive. - type: ChangeDirectory directory: "{{.SourceDir}}_standalone_tests" + - type: ExecuteCommand + command: "ln -s {{.InstallDir}}/target fake_prefix" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to run android hack. See QTBUG-88579 to check if this can be removed + enable_if: + condition: property + property: features + contains_value: AndroidTestRun diff --git a/coin/instructions/coin_module_test_android_start_emulator.yaml b/coin/instructions/coin_module_test_android_start_emulator.yaml new file mode 100644 index 0000000000..fc5f259043 --- /dev/null +++ b/coin/instructions/coin_module_test_android_start_emulator.yaml @@ -0,0 +1,24 @@ +type: Group +instructions: + - type: Group + instructions: + - type: ExecuteCommand + command: ["{{.Env.ANDROID_SDK_HOME}}/tools/emulator", "@x86emulator","-no-audio","-no-window","-gpu","swiftshader_indirect","-partition-size","4000"] + maxTimeInSeconds: 1800 + maxTimeBetweenOutput: 600 + userMessageOnFailure: "Failed to run emulator, check logs." + startInBackground: True + - type: ExecuteCommand + command: ["{{.Env.ANDROID_SDK_HOME}}/platform-tools/adb","devices"] + maxTimeInSeconds: 1800 + maxTimeBetweenOutput: 600 + userMessageOnFailure: "Failed to run adb, check logs." + - type: ExecuteCommand + command: ["{{.Env.ANDROID_SDK_HOME}}/platform-tools/adb","wait-for-device"] + maxTimeInSeconds: 1800 + maxTimeBetweenOutput: 1800 + userMessageOnFailure: "Failed to run adb, check logs." + enable_if: + condition: property + property: features + contains_value: AndroidTestRun diff --git a/coin/instructions/coin_module_test_template_common.yaml b/coin/instructions/coin_module_test_template_common.yaml index 716a4bb1e7..bd610a2281 100644 --- a/coin/instructions/coin_module_test_template_common.yaml +++ b/coin/instructions/coin_module_test_template_common.yaml @@ -2,6 +2,7 @@ type: Group instructions: # The build env is needed on MSVC so that tst_qmake can properly build apps / libraries. - !include "{{qt/qtbase}}/prepare_building_env.yaml" + - !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml" # The test env vars are needed to pick the proper prefix.bat file. - !include "{{qt/qtbase}}/cmake_setup_running_tests_env_vars.yaml" - !include "{{qt/qtbase}}/coin_module_test_qemu_env_vars.yaml" diff --git a/coin/instructions/coin_module_test_template_v3.yaml b/coin/instructions/coin_module_test_template_v3.yaml index 9984305a03..fa521f0d54 100644 --- a/coin/instructions/coin_module_test_template_v3.yaml +++ b/coin/instructions/coin_module_test_template_v3.yaml @@ -15,6 +15,9 @@ instructions: - condition: property property: target.osVersion equals_value: QEMU + - condition: property + property: features + contains_value: AndroidTestRun disable_if: condition: property property: features diff --git a/coin/instructions/coin_qtbase_build_template_v2.yaml b/coin/instructions/coin_qtbase_build_template_v2.yaml index ec3856d5a5..3421a51598 100644 --- a/coin/instructions/coin_qtbase_build_template_v2.yaml +++ b/coin/instructions/coin_qtbase_build_template_v2.yaml @@ -21,20 +21,10 @@ instructions: instructions: - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" enable_if: - condition: and - conditions: - - condition: property - property: host.os - equals_property: target.os - - condition: property + condition: property property: target.osVersion - equals_value: QEMU - disable_if: - condition: and - conditions: - - condition: property - property: host.os - equals_property: target.os - - condition: property + in_values: [Android_ANY, QEMU] + enable_if: + condition: property property: target.osVersion - not_equals_value: QEMU + in_values: [IOS_ANY, Android_ANY, QEMU] -- cgit v1.2.3