forked from Open-CMSIS-Pack/cmsis-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
160 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,21 +41,6 @@ jobs: | |
pip install --upgrade pip | ||
pip install -r test/requirements.txt | ||
# - name: Cache vcpkg | ||
# uses: actions/cache@v4 | ||
# with: | ||
# key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }} | ||
# restore-keys: | | ||
# vcpkg-${{ runner.os }}-${{ runner.arch }}- | ||
# path: /home/runner/.vcpkg | ||
|
||
# - name: Prepare vcpkg env | ||
# working-directory: ./test | ||
# run: | | ||
# . <(curl https://aka.ms/vcpkg-init.sh -L) | ||
# vcpkg x-update-registry --all | ||
# vcpkg activate | ||
|
||
- name: Setup vcpkg environment | ||
uses: soumeh01/actions/vcpkg@testwindows | ||
with: | ||
|
@@ -64,15 +49,13 @@ jobs: | |
cache: "-" | ||
|
||
- name: Activate Arm tool license | ||
working-directory: ./test | ||
run: | | ||
armlm activate --server https://mdk-preview.keil.arm.com --product KEMDK-COM0 | ||
working-directory: ./test | ||
|
||
# python -m robot --outputdir ../reports-${{ matrix.os }} -x junit-report.xml src | ||
- name: Run Test | ||
working-directory: ./test | ||
run: | | ||
python -m robot --outputdir ../reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} ./src | ||
python -m robot --outputdir reports-${{ matrix.target }}-${{ matrix.arch }} --settag ${{ matrix.target }}-${{ matrix.arch }} --name ${{ matrix.target }}-${{ matrix.arch }} ./test | ||
- name: Archieve test results | ||
if: always() | ||
|
@@ -89,6 +72,17 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: Install pip dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r test/requirements.txt | ||
- name: Download reports windows amd64 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -126,13 +120,22 @@ jobs: | |
path: reports-mac-arm64 | ||
|
||
- name: Consolidate robot test results | ||
continue-on-error: true | ||
run: | | ||
python -m robot.rebot --name Collective_Robot_Results --outputdir Collective_Robot_Results \ | ||
python -m robot.rebot --name Collective_Robot_Results --outputdir Collective_Robot_Results --output output.xml \ | ||
./reports-win-amd64/output.xml ./reports-win-amd64/output.xml \ | ||
./reports-ubuntu-arm64/output.xml ./reports-ubuntu-arm64/output.xml \ | ||
./reports-macos-amd64/output.xml ./reports-macos-arm64/output.xml | ||
./reports-lin-arm64/output.xml ./reports-lin-arm64/output.xml \ | ||
./reports-mac-amd64/output.xml ./reports-mac-arm64/output.xml | ||
- name: HTML Preview | ||
if: always() | ||
id: html_preview | ||
uses: pavi2410/html-preview-action@v2 | ||
with: | ||
html_file: 'Collective_Robot_Results/log.html' | ||
|
||
- name: Send macos report to commit | ||
- name: Send report to commit | ||
if: always() | ||
uses: joonvena/[email protected] | ||
with: | ||
report_path: Collective_Robot_Results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Installation and Running Robot Framework Tests | ||
|
||
This guide will walk you through the installation process and running of Robot Framework tests. | ||
|
||
## Prerequisites | ||
|
||
Before running Robot Framework tests, ensure you have the following prerequisites installed on your system: | ||
|
||
- Python (minimum recommended version **3.11**) | ||
- pip (python package manager) | ||
|
||
## Install Robot Framework | ||
|
||
Install Robot Framework and its dependencies using pip: | ||
|
||
```bash | ||
cd <root_dir> | ||
pip install --upgrade pip | ||
pip install -r test/requirements.txt | ||
``` | ||
|
||
## Running Tests | ||
|
||
### Run all tests | ||
|
||
This command will run all tests located in the `test` directory and place the test reports and logs under specified directory. | ||
|
||
```bash | ||
robot -d <output_directory> <path_to_tests> | ||
robot -d results ./test | ||
``` | ||
|
||
### Running Specific Tests | ||
|
||
To run specific tests, use the `--test` options: | ||
|
||
```bash | ||
robot --test <test_name> <path_to_tests> | ||
``` | ||
|
||
for e.g. | ||
|
||
```bash | ||
robot --test "Validate build-c Example" test/test.robot | ||
``` | ||
|
||
## Adding Tests | ||
|
||
The test cases in [test.robot](./test.robot) are implemented in a data-driven style, where each test case utilizes a single higher-level keyword to encapsulate the test workflow. To incorporate a new example for validation, follow the steps outlined below. | ||
|
||
- Add Example under [data](./data/) directory. | ||
- Add test details under **Test Cases** section following below conventions | ||
|
||
```robot | ||
# <Name of the Test> | ||
# <Path to the input <project>.csolution.yml file> <Expected build status> <Example root directory name> | ||
``` | ||
|
||
for e.g. | ||
|
||
```robot | ||
Validate USB Example | ||
${TEST_DATA_DIR}${/}${USB}${/}solution.csolution.yml ${0} ${USB} | ||
``` | ||
```txt | ||
☑️ Note: | ||
All options in the tests should be separated by **TABs**. | ||
For more information on robot test follow https://docs.robotframework.org/docs/testcase_styles/datadriven | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*** Settings *** | ||
Documentation Initailization for the robot tests in this directory | ||
Test Timeout 10 minutes | ||
# Library OperatingSystem | ||
# Resource ./global.robot | ||
# Resource ${RESOURCES}/utils.resource | ||
# Suite Setup Global Setup | ||
# Suite Teardown Global Teardown | ||
# *** Keywords *** | ||
# Global Setup | ||
# ${parent_dir}= Join Path ${CURDIR} .. | ||
# ${src_dir}= Join Path ${parent_dir} data | ||
# ${dest_dir}= Get Test Data directory | ||
# Set Global Variable ${TEST_DATA_DIR} ${dest_dir} | ||
# Copy Directory ${src_dir} ${dest_dir} | ||
# Global Teardown | ||
# Remove Directory with Content ${TEST_DATA_DIR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*** Variables *** | ||
${RESOURCES} ${CURDIR} # Path to the resource directory | ||
${Build} build # Directory name where example build files are copied | ||
${Data} data # Directory name of test data source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters