Skip to content

Commit

Permalink
test(build_system): check reproducible builds with spaces in paths
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Aug 15, 2024
1 parent bef4cb0 commit cbc52e7
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions tools/test_build_system/test_spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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
Expand All @@ -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
Expand All @@ -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')
Expand All @@ -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:
Expand Down

0 comments on commit cbc52e7

Please sign in to comment.