-
Notifications
You must be signed in to change notification settings - Fork 17
tests: Add initial test case for Modbus Server Container #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Previous PR had some messy git history and unverified commit really early in the commit history. Recreated PR with relevant changes to clean up git history. |
| name: Build | ||
| concurrency: | ||
| group: pr-workflows | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth explaining this change in the commit message (we need to run workflows for different PRs in serial instead of synchronous since they are sharing a common resource).
| sample: | ||
| - name: hello-world | ||
| expected: "powered by Ocre" | ||
| - name: generic-hello-world |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought changing the name of the hello world artifact was out of scope but I guess it's okay given that we are extending usage of board specific container image (thus it makes sense to clarify what is board specific vs generic). So, I guess no changes needed.
| conn.reset_input_buffer() | ||
| conn.send_break(duration=1) | ||
|
|
||
| # Wait for modbus server to be up and board to get networking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rephrase to "board to complete it's DHCP client process and initialize networking."
| sys.exit(exitCode) | ||
|
|
||
| """ | ||
| This testcase is to be used following a modbus server being installed on a board. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This testcase is to be run against a b_u585i_iot02a board which has its board specific modbus server container running on it."
|
|
||
| print("----* Waiting for updates to Modbus server container before continuing *---") | ||
|
|
||
| # print("----* Test reading 32 bit floats *----") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented out code. I realize you are just "waiting" for these aspects of the modbus server to get fixed, but let's not pushed commented out code. :)
PatrickRobbIOL
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few minor comments but it looks good. Approving this PR with the understanding that Matt will push an update per my comments. What do you think @kr-t ?
Includes new test group for the modbus server, alongside the initial test case where the modbus server is coneceted to by a client on the github action's runner. Currently, the github actions runner connects to the modbus server to read and write to the LED and Button register(s). Will need to update test case as registers are implemented in the modbus server container. This commit also includes a refactoring of parts of build.yml. Sets the concurrency stategy for running multiple PR workflows to be in serial rather than syncronous to prevent different runs affecting each other. Added the ability for the github actions runner to flash the b_u585i_iot02a board with the modbus server container. Also changes overall workflow slightly in order to make future container testing on the the b_u585i_iot02a board easier to implement. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
06cf3b7 to
c4fb70f
Compare
|
Hi, can you merge the master/rebase so we can see that it works correctly with erase step? |
…us-server-testing
Adds back a STM32_Programmer_CLI commands accidentally missed / deleted in previous merge. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
|
@kr-t The actual content of this PR is fine, but do you need the commits re-organized in any way? When pulling from main, should we do a merge pull or rebase pull? @mgeeIOL It looks to me like you did a merge pull instead of rebase pull (which might be okay, we just need to hear back from Krystian regarding what is preferred). |
|
Hi @PatrickRobbIOL , I prefer merge pull, since it keeps the history in tact and we'll be squashing it in the end anyway. |
| build-file: filesystem-full.wasm | ||
| expected: "Directory listing for" | ||
| path: generic/filesystem-full | ||
| # Add here more samples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add generic-blinky sample here?
| flash-zephyr-base-b_u585i_iot02a: | ||
| needs: build-zephyr-base | ||
| # Build and upload wasm files as artifacts | ||
| build-wasm-files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to do everything related to the application in this job. We can avoid these steps and theoretically save time. Will mark with '+' below places am I thinking about
.github/workflows/build.yml
Outdated
|
|
||
| - name: Install build tools and WASI SDK | ||
| - name: Update Submodules | ||
| working-directory: application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+
.github/workflows/build.yml
Outdated
| - name: Setup Zephyr project | ||
| uses: zephyrproject-rtos/action-zephyr-setup@v1 | ||
| with: | ||
| app-path: application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+
.github/workflows/build.yml
Outdated
| expected: "blink (count: 1, state: -)" | ||
| # Add here more samples | ||
| steps: | ||
| - name: Install tools (xxd + WASI SDK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is relevant to build-wasm-files, it should work without it
.github/workflows/build.yml
Outdated
| with: | ||
| path: application | ||
|
|
||
| - name: Clone ocre-sdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are downloading .wasm file from artifacts, so ocre-sdk is unused here
.github/workflows/build.yml
Outdated
| # Add here more samples | ||
| steps: | ||
| steps: | ||
| - name: Install tools (xxd + WASI SDK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same thing as in build-and-run-linux-sample
.github/workflows/build.yml
Outdated
| run: | | ||
| git submodule update --init --recursive | ||
| - name: Install tools (xxd + WASI SDK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same thing as above
.github/workflows/build.yml
Outdated
|
|
||
|
|
||
| build-zephyr-modbus_server-b_u585i_iot02a: | ||
| needs: [build-wasm-files] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove square brackets please
|
I added some comments, I hope my theory is correct) |
All of your requested changes seem reasonable and simple. @mgeeIOL will work on it later today and push a new commit. I just need a little clarification on the artifact point. Yes, I see there are about 10 artifacts on each GHA run now. Which files or dirs are the ones you actually care about preserving? I.e. if we build a WASM container image for blinky, is there value in us saving that as an artifact so that reviewers can download the blinky artifact, or is this just wasting space on the server maintaining this repo and its GHA runs? Separately, @mgeeIOL please review and ensure that we are properly cleaning up on the Intel NUC i.e. are those tarballs we are wget'ing to meet dependencies getting cleared up when you run the generic cleanup workspace task? |
I would go with the idea that it's a waste of space, I don't think the user needs .wasm files. build-wasm-files -> upload .wasm artifact -> build-and-run-platform-sample -> download .wasm artifact -> run it -> check expected log -> delete .wasm sample artifact But now I realized that it is not really possible to delete the .wasm artifacts because we are using many matrixes, so we do not know when this artifact is ready to be deleted or not(and if it's possible in general). |
|
I think essentially, we shall think what the end-user would use. The idea when we was thinking with @SorinOlari and @srberard about this was, that we shall keep the base minimum of useful applications, which are the firmware. It makes sense to just download built STM32U585 app (especially when we'll have Therefore, at this point, I believe we shouldn't have anything in kept artifacts but the firmware images and app of the ocre-runtime. |
Addresses comments brought up during review regarding unnecessary steps in the action workflow and minor syntax corrections. Still have to address the artifact storage method for .wasm files and their artifacts. (Squahsed with other commit to fix build errors arising from removing certain steps) Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
32e4f49 to
00a6eb6
Compare
Removed artifacting of log files and combined wasm artifact uploads into a singluar artifact. Currently the build wasm step saves all artifacts to a directory local on disk and they are artifacted in a seperate step. The directory used is cleaned at the end of the workflow to prevent runs from affecting each other. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
00a6eb6 to
cf6341a
Compare
|
I have updated the PR to include the optimization changes commented on by @SorinOlari , let me know if I missed anything. The logging artifacts are removed per the comment from @kr-t. As for removing the wasm artifacts I modified the workflow to have every wasm file be a part of the same artifact by saving them locally and uploading the directory as one artifact in a separate step. This is the most practical option we have for handling the wasm artifacts as there is no official way to delete github artifacts and some jobs of the workflow require the wasm files and are not run on the zephyr-xlarge-runner so we cannot just store them locally. To my knowledge the current artifacts are as close as we can get to the intention described earlier with the current workflow setup, if anything needs to change let me know. |
|
Looks good for me. |
This reverts commit 533f2f5. This commit is kept in the legacy branch.
This reverts commit 533f2f5. This commit is kept in the legacy branch. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 533f2f5. This commit is kept in the legacy branch. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>


Description
Includes new test group for the modbus server, alongside the initial test case where the modbus server is coneceted to by a client on the github action's runner. Currently, the github actions runner connects to the modbus server to read and write to the LED and Button register(s). Will need to update test case as registers are implemented in the modbus server container.
This commit also includes a refactoring of parts of build.yml in the github actions to allow the actions runner to flash the board with the modbus server. Also changes the overall workflow slighly in order to make future container testing on the b_u585i_iot02a board easier to implement.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Github actions changes will be tested when the PR is opened, given that it is a change to how the GHA workflows are set up.
Modbus server tests have been ran manually over a serial connection to the board with the appropriate container flashed.
Checklist: