From dc20af1ee47c9ad6281096ade3d7c7b64d153cc2 Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Mon, 17 Jun 2024 09:28:13 +0200 Subject: [PATCH] Remote test execution --- .github/workflows/e2e_test.yaml | 2 +- test/remote_example_tests.csv | 10 ++++++++++ test/remote_example_tests.robot | 15 ++++++++------- test/requirements.txt | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 test/remote_example_tests.csv diff --git a/.github/workflows/e2e_test.yaml b/.github/workflows/e2e_test.yaml index 91ae178..fe5f973 100644 --- a/.github/workflows/e2e_test.yaml +++ b/.github/workflows/e2e_test.yaml @@ -72,7 +72,7 @@ jobs: - name: Run Test shell: bash run: | - python -m robot --outputdir reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} ./test + python -m robot --outputdir reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} ./test/remote_example_tests.robot - name: Archieve test results if: always() diff --git a/test/remote_example_tests.csv b/test/remote_example_tests.csv new file mode 100644 index 0000000..a6cb8d4 --- /dev/null +++ b/test/remote_example_tests.csv @@ -0,0 +1,10 @@ +*** Test Cases ***;${github_url};${expect};[Tags];[Documentation] +Hello_B-U585I-IOT02A;https://github.com/Arm-Examples/Hello_B-U585I-IOT02A;${0};; +Hello_FRDM-K32L3A6;https://github.com/Arm-Examples/Hello_FRDM-K32L3A6;${0};; +Hello_IMXRT1050-EVKB;https://github.com/Arm-Examples/Hello_IMXRT1050-EVKB;${0};; +Hello_LPCXpresso55S69;https://github.com/Arm-Examples/Hello_LPCXpresso55S69;${0};; +Blinky_FRDM-K32L3A6;https://github.com/Arm-Examples/Blinky_FRDM-K32L3A6;${0};; +Blinky_NUCLEO-G0B1RE;https://github.com/Arm-Examples/Blinky_NUCLEO-G0B1RE;${0};; +Blinky_NUCLEO-F756ZG;https://github.com/Arm-Examples/Blinky_NUCLEO-F756ZG;${0};; +keil-studio-get-started;https://github.com/Arm-Examples/keil-studio-get-started;${0};; +Hello_AVH;https://github.com/Arm-Examples/Hello_AVH;${0};; \ No newline at end of file diff --git a/test/remote_example_tests.robot b/test/remote_example_tests.robot index 20093fa..6a8814d 100644 --- a/test/remote_example_tests.robot +++ b/test/remote_example_tests.robot @@ -5,7 +5,8 @@ Suite Teardown Global Teardown Library lib${/}utils.py Library String Library Collections -Library lib${/}elf_compare.py +Library lib${/}elf_compare.py +Library DataDriver Resource resources${/}global.resource Resource resources${/}utils.resource Test Template Test github examples @@ -18,6 +19,7 @@ ${Hello_FRDM-K32L3A6} https://github.com/Arm-Examples/Hello_FRDM-K32L3A6 *** Test Cases *** +Test remote example ${github_url} and expect ${expect} Default UserData # Test Csolution example # ${csolution-examples} ${Pass} @@ -29,15 +31,14 @@ ${Hello_FRDM-K32L3A6} https://github.com/Arm-Examples/Hello_FRDM-K32L3A6 *** Keywords *** Test github examples - [Arguments] ${github_url} ${expect} - ${dest_dir}= Evaluate "${github_url}".split('/')[-1] - ${dest_dir}= Set Variable ${TEST_DATA_DIR}${/}${Remote_Example_Dir}${/}${dest_dir} - Checkout GitHub Repository ${github_url} ${dest_dir} + [Arguments] ${github_url} ${expect} + ${dest_dir}= Evaluate "${github_url}".split('/')[-1] + ${dest_dir}= Set Variable ${TEST_DATA_DIR}${/}${Remote_Example_Dir}${/}${dest_dir} + Checkout GitHub Repository ${github_url} ${dest_dir} ${files} Glob Files In Directory ${dest_dir} *.csolution.* ${True} FOR ${file} IN @{files} ${example_name}= Get Parent Directory Name ${file} - Run Keyword If '${example_name}' != 'CubeMX' - ... Run Csolution Project ${file} ${expect} + Run Csolution Project ${file} ${expect} END Run Csolution Project diff --git a/test/requirements.txt b/test/requirements.txt index e7f6d4a..2add130 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,2 +1,3 @@ # Requirements needed robotframework >= 7.0 +robotframework-datadriver >= 1.11.2