mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fba96d58c2
build: - upgrade idf-build-apps to 2.x - unify get_pytest_apps and get_cmake_apps to get_all_apps - returns (test_apps, non_test_apps) tuple - add tests for the new get_all_apps assign: - generate build report - generate target test pipeline based on the build report target test: - download artifacts from minio server - users can use `pytest --pipeline-id xxxxx` to download and flash the binaries from the artifacts .post: - generate target test reports
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import sys
|
|
import typing as t
|
|
from typing import Literal
|
|
|
|
from idf_build_apps import App, CMakeApp, json_to_app
|
|
from idf_ci.uploader import AppUploader, get_app_uploader
|
|
|
|
|
|
class IdfCMakeApp(CMakeApp):
|
|
uploader: t.ClassVar[t.Optional['AppUploader']] = get_app_uploader()
|
|
build_system: Literal['idf_cmake'] = 'idf_cmake'
|
|
|
|
def _post_build(self) -> None:
|
|
super()._post_build()
|
|
|
|
if self.uploader:
|
|
self.uploader.upload_app(self.build_path)
|
|
|
|
|
|
def dump_apps_to_txt(apps: t.List[App], output_filepath: str) -> None:
|
|
with open(output_filepath, 'w') as fw:
|
|
for app in apps:
|
|
fw.write(app.model_dump_json() + '\n')
|
|
|
|
|
|
def import_apps_from_txt(input_filepath: str) -> t.List[App]:
|
|
apps: t.List[App] = []
|
|
with open(input_filepath) as fr:
|
|
for line in fr:
|
|
if line := line.strip():
|
|
try:
|
|
apps.append(json_to_app(line, extra_classes=[IdfCMakeApp]))
|
|
except Exception: # noqa
|
|
print('Failed to deserialize app from line: %s' % line)
|
|
sys.exit(1)
|
|
|
|
return apps
|