Commit Graph

29 Commits

Author SHA1 Message Date
Jakub Kocka
c082e6a25d ci(tools): Keep Windows build-system work dir short and logs off the live log
Relative CI_PROJECT_DIR after cd nested --work-dir under tools/test_build_system
and blew MAX_PATH. Save failed-command output next to artifacts instead of
streaming a 12 KB record that still hangs shard 3/6.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 20:45:13 +08:00
Jakub Kocka
fa7372d1c4 ci(tools): Verify submodules were copied into the idf_copy worktree
git worktree add leaves every submodule as an empty directory, and the
copy loop skipped any submodule it could not read from the source repo.

The placeholder then stayed in the copy and the build failed much later
in an unrelated component, as a missing mbedtls/include or tlsf.c

Check each submodule in the destination after copying it. If one is
still a placeholder, drop the worktree and create the copy with
shutil.copytree, which does not depend on the submodule state of the source checkout
2026-09-17 20:45:13 +08:00
Jakub Kocka
02a689149c ci(tools): Don't abort idf_copy when a worktree submodule is a gitlink
git worktree add materializes submodules as gitlink files. rmtree() cannot
remove those, and exists()+iterdir() on a source gitlink raises and falls
back to shutil.copytree, which leaves mbedtls/include as a file. Unlink
dest gitlinks and only copy populated source directories.
2026-09-01 09:18:31 +02:00
Jakub Kocka
5889cba730 ci(tools): Fix worktree submodule copy of gitlink files 2026-08-17 11:53:09 +02:00
Renz Bagaporo
48374cb8fa test(build_system): add CMake v2 ULP legacy shim coverage 2026-07-29 13:08:22 +09:00
Marek Fiala
8c08c75f48 feat(tools): adopt esp-pylib for idf.py logging and errors
Migrate idf.py and its actions to the shared esp-pylib library:
- add esp-pylib (and esp-pylib[ide]) to the core/ide requirements
- base FatalError on esp_pylib.errors.FatalError, keeping the idf.py ctx cleanup
- replace the local raw-ANSI helpers (red_print/yellow_print/print_warning/
  color_print) with esp_pylib.logger.log (warn/err/note/hint) across the
  idf.py actions
- install esp_pylib exception reporting at the idf.py entry point and silence
  the logger during shell completion
- update affected tests for the new prefixes/line wrapping
- add normalize_output() helper and unify terminal env in conftest to handle
  Rich line-wrapping in CI assertions

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 20:19:07 +08:00
Jakub Kocka
c040c3f840 ci(tools): Fixed git worktree copy 2026-05-13 14:55:21 +02:00
Marius Vikhammer
c06bf7de44 ci(build): removed and replaced template with regular test-apps 2026-04-29 15:21:30 +08:00
Daniel Paul
166bdcee87 fix: test_project_components_overrides_extra_components 2026-04-01 17:22:17 +02:00
Fu Hanxi
c360d8be98 feat: support moving idf components to component registry
and mark it as root dependency
2026-03-17 21:02:49 +08:00
Jakub Kocka
7551e82048 ci(tools): Changed the approach of some build tests to cmake reconfigure
Where actually building the app is not needed cmake reconfigure was introduced instead.
This should be performance upgrade especially for Windows runners, where build is quite slow
2026-03-16 08:57:40 +01:00
Jakub Kocka
82cc3b55b6 ci(tools): Updated approach of copying files to using git worktree 2026-03-16 08:53:47 +01:00
Frantisek Hrbata
6e5d6b75ae feat(test_build_system): allow buildv2 specific tests
Currently, cmakev2 is being tested only in backward-compatible mode by
using the existing cmakev1 tests with the cmakev2 test application. We
also need to add tests specific to cmakev2, and it is convenient to
reuse the existing build system testing framework. Let's add a `buildv2`
subdirectory to the existing `tools/test_build_system` directory and use
the `pytest_collection_modifyitems` hook to ignore tests in this
directory unless the `--buildv2` option is used.

Without the `--buildv2` option, only the existing cmakev1 tests are
executed and tests in `buildv2` directory are skipped. With the
`--buildv2` option, the existing cmakev1 tests run with the cmakev2
testing application for backward compatibility testing, and all cmakev2
tests within the `buildv2` subdirectory are also executed.

Note: we cannot use the `pytest_ignore_collect` hook, because the
`--buildv2` option is not known to the pytest, so the
`config.getoption('--buildv2', False)` returns always False. We would
likely need to add the `--buildv2` option in the conftest.py in the
esp-idf root directory.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>

fix: lsadjf las jflasjfl aslfsald asl fsadlf sladsal jfsadfas

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-01-22 15:41:05 +01:00
Frantisek Hrbata
d1270b62b8 feat(test_build_system): add pytest header whether buildv1 or buildv2 is running
This adds a clear header to the pytest output, indicating which build
system version is currently being tested.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-01-22 15:41:05 +01:00
Frantisek Hrbata
f2a7c311fd feat(test_build_system): add buildv2_skip marker
This marker enables the skipping of tests that, for any reason, cannot
be executed with the IDF build system version 2. It accepts an optional
string argument that explains why the test cannot be run with version 2.
If no explanation is provided, a default message is used. This marker is
used in the `pytest_collection_modifyitems` hook to skip tests marked
with it when the `--buildv2` pytest command line option is used.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
05ec102b9f fix(test_build_system): fix ruff formatting for conftest.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1da7f3714f feat(test_build_system): add --buildv2 pytest option and buildv2 test app
The IDF build system v2 should be backward compatible with IDF build
system v1 in most situations. Therefore, it makes sense to reuse the
existing v1 tests and run them for v2 as well. This approach will help
ensure that v2 maintains backward compatibility. Introduce a new
--buildv2 option, which switches the existing tests to use the newly
added buildv2_test_app for v2. The goal is to enable the existing v1
tests incrementally in CI as the v2 implementation progresses.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Fu Hanxi
6ff7947fef feat: add component_source property to component targets 2024-09-30 18:14:04 +08:00
Marek Fiala
e95aff7ca9 feat(tools): sanitize all fixtures using test names
The parametrization include `[` and `]` in names. This is not
possible to use within path. Expand the sanitization into all
fixtures using request.node.name.
2024-08-21 14:37:06 +02:00
Marek Fiala
ccbb415be8 feat(tools): add pytest mark idf_copy_with_space 2024-08-21 14:37:05 +02:00
Ivan Grokhotkov
fc4c445643 test(build_system): move reproducible build test to pytest 2024-08-11 20:24:03 +02:00
Fu Hanxi
a4f691b88a ci: always cleanup idf copy in ci 2024-04-16 15:32:10 +02:00
Marek Fiala
52da5b765f feat(tools): Run skipped build system pytests on Win 2024-02-08 11:23:51 +01:00
kohait00
9beda4ce48 feat(tools/cmake): Added VERSION argument to the project() macro in cmake
This commit enables the standad VERSION argument for the project() macro
in ESP-IDF. The VERSION argument is compilant with the requirements of
cmake 3.16. This commit also adds new test cases for verifying the
validity of the version argument.

Merges https://github.com/espressif/esp-idf/pull/12461

Co-authored-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2023-12-05 11:29:43 +01:00
Marek Fiala
f4e3c9c03a refactor(tools): Rewrite build system unit tests to python
Rewritten parts:
 - git
 - version
 - build
2023-07-18 15:51:04 +02:00
Marek Fiala
fb0dc46183 Tools: Rewrite build system unit tests to python - sdkconfig, bootloader, components 2023-05-23 09:47:39 +00:00
Marek Fiala
165c0d852b Tools: Rewrite build system unit tests to python - other target tests 2023-02-09 16:08:04 +01:00
Ivan Grokhotkov
5d2f900bef test_build_system: fix idf_copy fixture not changing IDF_PATH 2022-12-21 17:22:50 +01:00
Ivan Grokhotkov
0503cb52eb build system: add the initial set of pytest-based build system tests 2022-09-16 00:07:55 +02:00