test(build_system): check reproducible builds with spaces in paths

This commit is contained in:
Ivan Grokhotkov
2024-08-09 15:38:55 +02:00
parent bef4cb05ff
commit cbc52e7d30

View File

@@ -8,6 +8,7 @@ import sys
from pathlib import Path
import pytest
from test_build_system_helpers import IdfPyFunc
from test_build_system_helpers import run_idf_py
# In this test file the test are grouped into 3 bundles
@@ -23,8 +24,6 @@ def clean_app_dir(app_path: Path) -> None:
@pytest.mark.idf_copy('esp idf with spaces')
def test_spaces_bundle1(idf_copy: Path) -> None:
logging.info('Running test spaces bundle 1')
# test_build
run_idf_py('build', workdir=(idf_copy / 'examples' / 'get-started' / 'hello_world'))
# test spiffsgen
run_idf_py('build', workdir=(idf_copy / 'examples' / 'storage' / 'spiffsgen'))
# test build ulp_fsm
@@ -40,12 +39,6 @@ def test_spaces_bundle2(idf_copy: Path) -> None:
run_idf_py('build', workdir=(idf_copy / 'examples' / 'security' / 'flash_encryption'))
# test_x509_cert_bundle
run_idf_py('build', workdir=(idf_copy / 'examples' / 'protocols' / 'https_x509_bundle'))
# test dfu
hello_world_app_path = (idf_copy / 'examples' / 'get-started' / 'hello_world')
run_idf_py('-DIDF_TARGET=esp32s2', 'dfu', workdir=hello_world_app_path)
clean_app_dir(hello_world_app_path)
# test uf2
run_idf_py('uf2', workdir=hello_world_app_path)
@pytest.mark.idf_copy('esp idf with spaces')
@@ -69,6 +62,26 @@ def test_spaces_bundle3(idf_copy: Path) -> None:
workdir=secure_boot_app_path)
# Use this bundle for tests which can be done with the default build_test_app
@pytest.mark.parametrize('dummy_', [
# Dummy parameter with a space in it, used so that the test directory name contains a space
pytest.param('test spaces')
])
@pytest.mark.idf_copy('esp idf with spaces')
@pytest.mark.usefixtures('idf_copy')
def test_spaces_bundle4(dummy_: str, idf_py: IdfPyFunc, test_app_copy: Path) -> None:
logging.info(f'Running test spaces bundle 4 in {test_app_copy}')
(test_app_copy / 'sdkconfig').write_text('CONFIG_APP_REPRODUCIBLE_BUILD=y')
idf_py('build')
(test_app_copy / 'sdkconfig').unlink()
idf_py('set-target', 'esp32s2')
idf_py('dfu')
idf_py('uf2')
@pytest.mark.skipif(sys.platform == 'win32', reason='Unix test')
@pytest.mark.idf_copy('esp idf with spaces')
def test_install_export_unix(idf_copy: Path) -> None: