Skip to content

Commit 51adb9a

Browse files
committed
test: temp workaround for linux test apps
1 parent b02687a commit 51adb9a

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

conftest.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,20 @@ def build_dir(app_path: str, target: Optional[str], config: Optional[str]) -> st
260260
Returns:
261261
valid build directory
262262
"""
263-
264-
check_dirs = []
265-
if target is not None and config is not None:
266-
check_dirs.append(f'build_{target}_{config}')
267-
if target is not None:
268-
check_dirs.append(f'build_{target}')
269-
if config is not None:
270-
check_dirs.append(f'build_{config}')
271-
check_dirs.append('build')
263+
if target == 'linux':
264+
# IDF-6644
265+
# hard-coded in components/esp_partition/partition_linux.c
266+
# const char *partition_table_file_name = "build/partition_table/partition-table.bin";
267+
check_dirs = ['build']
268+
else:
269+
check_dirs = []
270+
if target is not None and config is not None:
271+
check_dirs.append(f'build_{target}_{config}')
272+
if target is not None:
273+
check_dirs.append(f'build_{target}')
274+
if config is not None:
275+
check_dirs.append(f'build_{config}')
276+
check_dirs.append('build')
272277

273278
for check_dir in check_dirs:
274279
binary_path = os.path.join(app_path, check_dir)
@@ -284,6 +289,15 @@ def build_dir(app_path: str, target: Optional[str], config: Optional[str]) -> st
284289
)
285290

286291

292+
@pytest.fixture(autouse=True)
293+
def linux_cd_into_app_folder(app_path: str, target: Optional[str]) -> None:
294+
# IDF-6644
295+
# hard-coded in components/esp_partition/partition_linux.c
296+
# const char *partition_table_file_name = "build/partition_table/partition-table.bin";
297+
if target == 'linux':
298+
os.chdir(app_path)
299+
300+
287301
@pytest.fixture(autouse=True)
288302
@multi_dut_fixture
289303
def junit_properties(test_case_name: str, record_xml_attribute: Callable[[str, object], None]) -> None:
@@ -327,6 +341,7 @@ def real_func(item: str, value: float, target: str) -> None:
327341
:param target: target chip
328342
:raise: AssertionError: if check fails
329343
"""
344+
330345
def _find_perf_item(operator: str, path: str) -> float:
331346
with open(path, 'r') as f:
332347
data = f.read()

tools/ci/ci_build_apps.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,18 @@ def get_pytest_apps(
6161
app_dirs.sort()
6262

6363
default_size_json_path = 'size.json'
64+
build_dir = 'build_@t_@w'
6465
if target == 'linux': # no idf_size.py for linux target
6566
default_size_json_path = None # type: ignore
67+
# IDF-6644
68+
# hard-coded in components/esp_partition/partition_linux.c
69+
# const char *partition_table_file_name = "build/partition_table/partition-table.bin";
70+
build_dir = 'build'
6671

6772
apps = find_apps(
6873
app_dirs,
6974
target=target,
70-
build_dir='build_@t_@w',
75+
build_dir=build_dir,
7176
config_rules_str=config_rules_str,
7277
build_log_path='build_log.txt',
7378
size_json_path=default_size_json_path,

0 commit comments

Comments
 (0)