mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
test(cmakev2): Enable test_rebuild.py for buildv2 CI tests
The test_rebuild_no_changes test verifies that running idf.py build successively without any file changes results in identical build artifacts on the second run (i.e., nothing gets rebuilt). This test was failing in buildv2 because it expected kconfig_menus.json to be present in build/config/ after a normal build. However, in cmakev2, kconfig_menus.json is not generated during regular builds. In cmakev1, kconfig_menus.json was generated globally during every build alongside other config files (sdkconfig.h, sdkconfig.cmake, etc). In cmakev2, kconfig_menus.json generation does not happend for normal builds because it depends on the Kconfig menu hierarchy and cannot be generated globally. It must be generated per-executable. Hence, this commit updates the artefacts list for cmakev2 to not expect the kconfig_menus.json file during a build/re-build action.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
from .build_constants import ALL_ARTIFACTS
|
||||
from .build_constants import ALL_ARTIFACTS_BUILDV1
|
||||
from .build_constants import ALL_ARTIFACTS_BUILDV2
|
||||
from .build_constants import APP_BINS
|
||||
from .build_constants import BOOTLOADER_BINS
|
||||
from .build_constants import JSON_METADATA
|
||||
@@ -10,21 +12,38 @@ from .file_utils import bin_file_contains
|
||||
from .file_utils import bin_files_differ
|
||||
from .file_utils import file_contains
|
||||
from .file_utils import replace_in_file
|
||||
from .idf_utils import EnvDict
|
||||
from .idf_utils import EXT_IDF_PATH
|
||||
from .idf_utils import EnvDict
|
||||
from .idf_utils import IdfPyFunc
|
||||
from .idf_utils import find_python
|
||||
from .idf_utils import get_idf_build_env
|
||||
from .idf_utils import IdfPyFunc
|
||||
from .idf_utils import run_cmake
|
||||
from .idf_utils import run_cmake_and_build
|
||||
from .idf_utils import run_idf_py
|
||||
from .snapshot import get_snapshot
|
||||
from .snapshot import Snapshot
|
||||
from .snapshot import get_snapshot
|
||||
|
||||
__all__ = [
|
||||
'append_to_file', 'replace_in_file',
|
||||
'get_idf_build_env', 'run_idf_py', 'EXT_IDF_PATH', 'EnvDict', 'IdfPyFunc',
|
||||
'Snapshot', 'get_snapshot', 'run_cmake', 'APP_BINS', 'BOOTLOADER_BINS',
|
||||
'PARTITION_BIN', 'JSON_METADATA', 'ALL_ARTIFACTS',
|
||||
'run_cmake_and_build', 'find_python', 'file_contains', 'bin_file_contains', 'bin_files_differ'
|
||||
'append_to_file',
|
||||
'replace_in_file',
|
||||
'get_idf_build_env',
|
||||
'run_idf_py',
|
||||
'EXT_IDF_PATH',
|
||||
'EnvDict',
|
||||
'IdfPyFunc',
|
||||
'Snapshot',
|
||||
'get_snapshot',
|
||||
'run_cmake',
|
||||
'APP_BINS',
|
||||
'BOOTLOADER_BINS',
|
||||
'PARTITION_BIN',
|
||||
'JSON_METADATA',
|
||||
'ALL_ARTIFACTS',
|
||||
'ALL_ARTIFACTS_BUILDV1',
|
||||
'ALL_ARTIFACTS_BUILDV2',
|
||||
'run_cmake_and_build',
|
||||
'find_python',
|
||||
'file_contains',
|
||||
'bin_file_contains',
|
||||
'bin_files_differ',
|
||||
]
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
BOOTLOADER_BINS = ['build/bootloader/bootloader.elf', 'build/bootloader/bootloader.bin']
|
||||
APP_BINS = ['build/build_test_app.elf', 'build/build_test_app.bin']
|
||||
PARTITION_BIN = ['build/partition_table/partition-table.bin']
|
||||
JSON_METADATA = ['build/project_description.json', 'build/flasher_args.json', 'build/config/kconfig_menus.json', 'build/config/sdkconfig.json']
|
||||
ALL_ARTIFACTS = [
|
||||
*BOOTLOADER_BINS,
|
||||
*APP_BINS,
|
||||
*PARTITION_BIN,
|
||||
*JSON_METADATA
|
||||
]
|
||||
JSON_METADATA = ['build/project_description.json', 'build/flasher_args.json', 'build/config/sdkconfig.json']
|
||||
|
||||
# kconfig_menus.json is only generated during build in cmakev1.
|
||||
KCONFIG_MENUS_JSON = ['build/config/kconfig_menus.json']
|
||||
|
||||
# Build system v1 artifacts
|
||||
ALL_ARTIFACTS_BUILDV1 = [*BOOTLOADER_BINS, *APP_BINS, *PARTITION_BIN, *JSON_METADATA, *KCONFIG_MENUS_JSON]
|
||||
|
||||
# Build system v2 artifacts
|
||||
ALL_ARTIFACTS_BUILDV2 = [*BOOTLOADER_BINS, *APP_BINS, *PARTITION_BIN, *JSON_METADATA]
|
||||
|
||||
# Default artifacts for tests that don't specify build version
|
||||
ALL_ARTIFACTS = ALL_ARTIFACTS_BUILDV1
|
||||
|
||||
Reference in New Issue
Block a user