Add initial test and GHA file for bu585#160
Conversation
b2c86c2 to
0a46424
Compare
Includes a new basic test group and initial github actions file to establish framework for testing ocre runtime with physical hardware after the major refactor. The test plan tests to confirm the hello-world container works and establishes initial process for testing containers on the b_u585 board. Utilizes similar methods in the GHA workflow as before the major refactor to build the .wasm and build and flash the runtime. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
0a46424 to
4bbb9a2
Compare
.github/workflows/hardware-bu585.yml
Outdated
| submodules: recursive | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Make python venv |
There was a problem hiding this comment.
To slightly speed up execution time if we wanted we could keep a venv in the home dir of the user which runs this job instead of making it in a workspace which is cleaned every time. That way it would only re-install when there is a newer version of a pip package. Probably not worth doing though unless these pip installs take a while.
.github/workflows/hardware-bu585.yml
Outdated
| run: | | ||
| cd tests_hw && bash beginTests.sh "supervisor-helloWorld" | ||
|
|
||
| - name: Print Modbus Server Validation Logs |
There was a problem hiding this comment.
re-label this from modbus to helloworld
.github/workflows/main.yml
Outdated
| with: | ||
| devcontainer-tag: ${{ needs.zephyr-devcontainer.outputs.devcontainer-tag }} | ||
|
|
||
| hardware-bu585: |
There was a problem hiding this comment.
can you put an underscore after the B and add the i_iot02a?
| conn.send_break(duration=1) | ||
| time.sleep(5) | ||
| print("Cleaning up container hello-world") | ||
| conn.write(b'ocre rm hello-world\n') |
There was a problem hiding this comment.
do you want to remove the container and also remove the image?
There was a problem hiding this comment.
Removing the image should be unnecessary since we wipe the filesystem with every flash.
| @@ -0,0 +1,28 @@ | |||
| { | |||
| "name": "Supervisor Sample - Hello World", | |||
| "description": "Test Hello World Container within ", | |||
There was a problem hiding this comment.
within what? And why is container capitalized but within not?
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Why 5 empty lines here? We could add a linter at some point if we want the python code to be clean, but I have noticed plenty of extra empty lines in this file and some others, including the GHA main.yml. Not a huge deal but worth trying to keep clean.
Code style, naming conventions, and formatting fixes. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
kr-t
left a comment
There was a problem hiding this comment.
Beside using our own docker container for tests (see the comment), I strongly recommend to checkout the zephyr.yml and run the mini and demo samples. Just the two of those already cover a lot of things we want to test in the first place. I think the order shall be:
- run mini
- run demo
- run other stuff via supervisor (even if we are running hello-world again as the very first supervisor test)
Also, a minor nitpick: if you believe it is ready for a review, please remove in this case [draft] from the title.
.github/workflows/hardware-bu585.yml
Outdated
| needs: setup-local-runner | ||
| runs-on: zephyr-xlarge-runner | ||
| container: | ||
| image: ghcr.io/zephyrproject-rtos/ci:v0.26-branch |
There was a problem hiding this comment.
We have a container made specifically for Ocre; Please check zephyr.yml to see how it is used in other workflows. It would be beneficial to use it since it would reduce the steps here (like getting wasi-sdk for example).
.github/workflows/hardware-bu585.yml
Outdated
| run: | | ||
| python3 -m venv ./.venv | ||
| source .venv/bin/activate | ||
| pip install littlefs-python | ||
| pip install west | ||
|
|
||
| - name: Setup west environment | ||
| run: | | ||
| source .venv/bin/activate | ||
| west update | ||
| west zephyr-export | ||
| west packages pip --install | ||
| west sdk install -t \ | ||
| x86_64-zephyr-elf \ | ||
| aarch64-zephyr-elf \ | ||
| arm-zephyr-eabi |
There was a problem hiding this comment.
if you use our container, it already has the venv, zephyr SDK and everything needed to build (and probably run) this.
8a16c49 to
9b901df
Compare
c7a27da to
a946dc3
Compare
Combines mini and demo flash and test steps to simply workflow jobs. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
a946dc3 to
7b38a12
Compare
Integrated use of pexpect into the demo, mini, and hello-world supervisor tests in order to improve consistency with tests. Includes addition of testlib.py file to include common test functionality such as establishing serial connections and formatting test output. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
c7cc1ca to
36bb7fe
Compare
…ial-bu585-testing
Code style updates, remove unnecessary whitespace and unused imports. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
…ial-bu585-testing
82e8e02 to
9894092
Compare
Clear serial buffer at the start and end of every serial connection during test cases to ensure runtime outputs from other github actions runs do not affect other runs. Also includes formatting updates in GHA workflow files and separates the demo and mini flashes to their own jobs outside of the container. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
9894092 to
bf88000
Compare
Refactor test scripts to be using more direct python string comparison rather than using pexect.expect() for output detection. Also includes minor format updates for related GHA file. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
ee25e20 to
146ae1c
Compare
src/ocre/commit_id.h
Outdated
| @@ -0,0 +1,2 @@ | |||
| /* Auto-generated file. DO NOT EDIT */ | |||
There was a problem hiding this comment.
this file should not be included in the PR, please remove it (and also delete it from your workspace)
|
We merged the formatting fix, so when you can , pleas rebase and all workflows will pass |
Removed autogenerated files not relevant to the PR. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
…ial-bu585-testing
Add extra check after pexpect timeout for the ocre shell prompt to make sure the shell prompt is not missed and cause a false negative on the testcase. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
6cfb041 to
1d5dea5
Compare
Removes additional unneeded steps in the GHA actions workflow regarding the west setup which should be unnecessary when using the dev container. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
ece6417 to
3224184
Compare
Aligns the hardware-bu585 west enviornment setup with how other GHA zephyr tests setup and manage the west enviornment. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
3224184 to
d6b2b1f
Compare
casaroli
left a comment
There was a problem hiding this comment.
Nice work. Thank you.
I think this is good for merging and we will monitor and see how it goes, and improve as necessary.
I have some suggestions that I think we should address in next PRs:
- thse python scripts are actually testing the mini/demo/supervisor programs: maybe we can extend/generalize these tests out of "hardware" and use it for testing these programs even on local machine (or other linux board) (call it "program tests" instead of "hardware tests")
- add python linter
- we now have system tests in Zephyr. We should add them to these workflows.
|
Due to multiple merge commits on this branch, I am squashing this PR. In the future, I'd recommend a bit better commit organization, so we would fast forward the whole branch and have a less compact history. |


Description
Includes a new basic test group and initial github actions file to establish framework for testing ocre runtime with physical hardware after the major refactor. The test plan tests to confirm the hello-world container works and establishes initial process for testing containers on the b_u585 board. Utilizes similar methods in the GHA workflow as before the major refactor to build the .wasm and build and flash the runtime. `
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Test scripts have been run against the board directly on a local workstation. GHA changes will be tested while PR is a draft and changes will be created in future commits to fix any problems that may arise.
Test Configuration (required):
Fedora 41 (x86)b_u585i_iot02aSTM32CubeProgrammer)Checklist: