Skip to content

Add initial test and GHA file for bu585#160

Merged
kr-t merged 18 commits intoproject-ocre:mainfrom
mgeeIOL:test-initial-bu585-testing
Mar 2, 2026
Merged

Add initial test and GHA file for bu585#160
kr-t merged 18 commits intoproject-ocre:mainfrom
mgeeIOL:test-initial-bu585-testing

Conversation

@mgeeIOL
Copy link
Contributor

@mgeeIOL mgeeIOL commented Feb 5, 2026

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.

  • CI system update
  • Test Coverage update

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):

  • Host OS type, version, and arch: Fedora 41 (x86)
  • Developer Board make & model: b_u585i_iot02a
  • Board Tools Installed: STM32CubeProgrammer)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch 9 times, most recently from b2c86c2 to 0a46424 Compare February 5, 2026 22:12
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>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from 0a46424 to 4bbb9a2 Compare February 5, 2026 22:20
submodules: recursive
fetch-depth: 0

- name: Make python venv
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

run: |
cd tests_hw && bash beginTests.sh "supervisor-helloWorld"

- name: Print Modbus Server Validation Logs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-label this from modbus to helloworld

with:
devcontainer-tag: ${{ needs.zephyr-devcontainer.outputs.devcontainer-tag }}

hardware-bu585:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to remove the container and also remove the image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

within what? And why is container capitalized but within not?





Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@mgeeIOL mgeeIOL marked this pull request as ready for review February 6, 2026 22:51
@mgeeIOL mgeeIOL requested review from kr-t and srberard as code owners February 6, 2026 22:51
@kr-t kr-t requested a review from casaroli February 9, 2026 08:34
Copy link
Collaborator

@kr-t kr-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

needs: setup-local-runner
runs-on: zephyr-xlarge-runner
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26-branch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +122 to +137
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you use our container, it already has the venv, zephyr SDK and everything needed to build (and probably run) this.

@casaroli casaroli linked an issue Feb 9, 2026 that may be closed by this pull request
@mgeeIOL mgeeIOL changed the title [DRAFT] Add initial test and GHA file for bu585 Add initial test and GHA file for bu585 Feb 10, 2026
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from 8a16c49 to 9b901df Compare February 10, 2026 19:50
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from c7a27da to a946dc3 Compare February 13, 2026 21:21
Combines mini and demo flash and test steps to simply workflow jobs.

Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from a946dc3 to 7b38a12 Compare February 13, 2026 21:34
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>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from c7cc1ca to 36bb7fe Compare February 17, 2026 21:54
Code style updates, remove unnecessary whitespace and unused imports.

Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch 2 times, most recently from 82e8e02 to 9894092 Compare February 19, 2026 21:35
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>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from 9894092 to bf88000 Compare February 20, 2026 18:34
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>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from ee25e20 to 146ae1c Compare February 20, 2026 20:08
@@ -0,0 +1,2 @@
/* Auto-generated file. DO NOT EDIT */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should not be included in the PR, please remove it (and also delete it from your workspace)

@casaroli
Copy link
Contributor

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>
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>
@kr-t
Copy link
Collaborator

kr-t commented Feb 26, 2026

I see that you are using our Ocre devcontainer to build. Great! Can you try removing west setup and see if it continues to work?
image

I think you don't need it, as per our other zephyr build/run sample.

@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from 6cfb041 to 1d5dea5 Compare February 26, 2026 17:13
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>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch 2 times, most recently from ece6417 to 3224184 Compare February 26, 2026 18:00
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>
@mgeeIOL mgeeIOL force-pushed the test-initial-bu585-testing branch from 3224184 to d6b2b1f Compare February 26, 2026 18:10
@mgeeIOL
Copy link
Contributor Author

mgeeIOL commented Feb 26, 2026

I see that you are using our Ocre devcontainer to build. Great! Can you try removing west setup and see if it continues to work? image

I think you don't need it, as per our other zephyr build/run sample.

After some testing I was able to remove the majority of the west setup. Let me know if you see any other changes that should be made.

Copy link
Contributor

@casaroli casaroli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kr-t
Copy link
Collaborator

kr-t commented Mar 2, 2026

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.
Thanks for the contribution, it's a very good progress that we will have hardware tests again.

@kr-t kr-t merged commit 1e415a6 into project-ocre:main Mar 2, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reintroduce testing zephyr application on real hardware (U585 board)

4 participants