diff --git a/.github/get_idf_build_apps_args.py b/.github/get_idf_build_apps_args.py index f9b7496129..5417ae9e9c 100644 --- a/.github/get_idf_build_apps_args.py +++ b/.github/get_idf_build_apps_args.py @@ -24,7 +24,7 @@ def main(): print(f' - {file}') modified_components = set() - excluded_dirs = ['.github', 'test_app'] + excluded_dirs = ['.github'] for file in modified_files: toplevel = file.split('/')[0] if toplevel in excluded_dirs: diff --git a/.github/workflows/build_and_run_apps.yml b/.github/workflows/build_and_run_apps.yml index 51bfa17585..c993b1c892 100644 --- a/.github/workflows/build_and_run_apps.yml +++ b/.github/workflows/build_and_run_apps.yml @@ -107,11 +107,11 @@ jobs: */examples/*/build_esp*/*.bin */examples/*/build_esp*/flasher_args.json */examples/*/build_esp*/config/sdkconfig.json - */test_apps/**/build_esp*/bootloader/bootloader.bin - */test_apps/**/build_esp*/partition_table/partition-table.bin - */test_apps/**/build_esp*/*.bin - */test_apps/**/build_esp*/flasher_args.json - */test_apps/**/build_esp*/config/sdkconfig.json + */test_app*/**/build_esp*/bootloader/bootloader.bin + */test_app*/**/build_esp*/partition_table/partition-table.bin + */test_app*/**/build_esp*/*.bin + */test_app*/**/build_esp*/flasher_args.json + */test_app*/**/build_esp*/config/sdkconfig.json build_info*.json run-target: @@ -134,6 +134,9 @@ jobs: - runs-on: "ESP32-ETHERNET-KIT" marker: "ethernet" target: "esp32" + - runs-on: "spi_nand_flash" + marker: "spi_nand_flash" + target: "esp32" env: TEST_RESULT_NAME: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }} TEST_RESULT_FILE: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}.xml @@ -155,7 +158,7 @@ jobs: run: | python3 .github/get_pytest_args.py --target=${{ matrix.runner.target }} -v 'build_info*.json' pytest-args.txt cat pytest-args.txt - pytest --suppress-no-test-exit-code $(cat pytest-args.txt) --ignore-glob '*/managed_components/*' --ignore=test_app --ignore=.github --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.target }} + pytest --suppress-no-test-exit-code $(cat pytest-args.txt) --ignore-glob '*/managed_components/*' --ignore=.github --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.target }} - name: Upload test results uses: actions/upload-artifact@v4 if: always() diff --git a/pytest.ini b/pytest.ini index 5919939a9e..4ebe9e7d75 100644 --- a/pytest.ini +++ b/pytest.ini @@ -12,6 +12,7 @@ markers = # env markers generic: generic runner ethernet: ethernet runners + spi_nand_flash: runner with SPI NAND flash connected # log related log_cli = True diff --git a/spi_nand_flash/examples/nand_flash/pytest_nand_flash_example.py b/spi_nand_flash/examples/nand_flash/pytest_nand_flash_example.py new file mode 100644 index 0000000000..c6f7110e60 --- /dev/null +++ b/spi_nand_flash/examples/nand_flash/pytest_nand_flash_example.py @@ -0,0 +1,10 @@ +import pytest + + +@pytest.mark.spi_nand_flash +def test_nand_flash_example(dut) -> None: + dut.expect_exact("Opening file") + dut.expect_exact("File written") + dut.expect_exact("Reading file") + dut.expect_exact("Read from file:") + dut.expect_exact("Returned from app_main") diff --git a/spi_nand_flash/examples/nand_flash/sdkconfig.ci b/spi_nand_flash/examples/nand_flash/sdkconfig.ci new file mode 100644 index 0000000000..7847e636ee --- /dev/null +++ b/spi_nand_flash/examples/nand_flash/sdkconfig.ci @@ -0,0 +1 @@ +CONFIG_EXAMPLE_FORMAT_IF_MOUNT_FAILED=y diff --git a/spi_nand_flash/test_app/pytest_spi_nand_flash.py b/spi_nand_flash/test_app/pytest_spi_nand_flash.py new file mode 100644 index 0000000000..4affbfc4e8 --- /dev/null +++ b/spi_nand_flash/test_app/pytest_spi_nand_flash.py @@ -0,0 +1,6 @@ +import pytest + + +@pytest.mark.spi_nand_flash +def test_spi_nand_flash(dut) -> None: + dut.run_all_single_board_cases()