@@ -15,14 +15,20 @@ class TestSetupAndroidWithConfig:
15
15
16
16
def test_setup_android_reads_config (self , tmp_path ):
17
17
"""Test that setup-android reads SDK location from config."""
18
- # Create a test config
18
+ # Create a test config with x86_64 architecture
19
19
config_data = {
20
20
"project" : {
21
21
"name" : "test" ,
22
22
"run_id" : "test_001" ,
23
23
"cache_dir" : str (tmp_path / "test_cache" ),
24
24
},
25
- "openvino" : {"mode" : "build" },
25
+ "openvino" : {
26
+ "mode" : "build" ,
27
+ "toolchain" : {
28
+ "abi" : "x86_64" , # Specify architecture to match what we check
29
+ "api_level" : 30 ,
30
+ },
31
+ },
26
32
"device" : {"kind" : "android" , "serials" : []},
27
33
"models" : [{"name" : "model1" , "path" : "model1.xml" }],
28
34
"report" : {"sinks" : [{"type" : "json" , "path" : "results.json" }]},
@@ -34,11 +40,11 @@ def test_setup_android_reads_config(self, tmp_path):
34
40
35
41
with patch ("ovmobilebench.android.installer.api.verify_installation" ) as mock_verify :
36
42
with patch ("ovmobilebench.android.installer.api.ensure_android_tools" ) as mock_ensure :
37
- # Mock verification to say everything is installed
43
+ # Mock verification to say everything is installed (with x86_64)
38
44
mock_verify .return_value = {
39
45
"platform_tools" : True ,
40
46
"emulator" : True ,
41
- "system_images" : ["system-images;android-30;google_apis;arm64-v8a " ],
47
+ "system_images" : ["system-images;android-30;google_apis;x86_64 " ],
42
48
"ndk_versions" : ["27.2.12479018" ],
43
49
}
44
50
@@ -56,14 +62,20 @@ def test_setup_android_reads_config(self, tmp_path):
56
62
57
63
def test_setup_android_installs_missing_components (self , tmp_path ):
58
64
"""Test that setup-android installs only missing components."""
59
- # Create a test config
65
+ # Create a test config with x86_64 architecture
60
66
config_data = {
61
67
"project" : {
62
68
"name" : "test" ,
63
69
"run_id" : "test_001" ,
64
70
"cache_dir" : str (tmp_path / "test_cache" ),
65
71
},
66
- "openvino" : {"mode" : "build" },
72
+ "openvino" : {
73
+ "mode" : "build" ,
74
+ "toolchain" : {
75
+ "abi" : "x86_64" ,
76
+ "api_level" : 30 ,
77
+ },
78
+ },
67
79
"device" : {"kind" : "android" , "serials" : []},
68
80
"models" : [{"name" : "model1" , "path" : "model1.xml" }],
69
81
"report" : {"sinks" : [{"type" : "json" , "path" : "results.json" }]},
@@ -79,11 +91,16 @@ def test_setup_android_installs_missing_components(self, tmp_path):
79
91
mock_verify .return_value = {
80
92
"platform_tools" : True ,
81
93
"emulator" : True ,
82
- "system_images" : ["system-images;android-30;google_apis;arm64-v8a " ],
94
+ "system_images" : ["system-images;android-30;google_apis;x86_64 " ],
83
95
"ndk_versions" : [], # NDK missing
84
96
}
85
97
86
- mock_ensure .return_value = MagicMock (returncode = 0 )
98
+ mock_ensure .return_value = {
99
+ "sdk_root" : str (tmp_path / "test_cache" / "android-sdk" ),
100
+ "ndk_path" : str (
101
+ tmp_path / "test_cache" / "android-sdk" / "ndk" / "27.2.12479018"
102
+ ),
103
+ }
87
104
88
105
result = runner .invoke (
89
106
app ,
0 commit comments