Skip to content

Add test for example 1 complete workflow#23

Merged
alexlovelltroy merged 4 commits intoOpenCHAMI:mainfrom
bmcdonald3:testing
Dec 9, 2025
Merged

Add test for example 1 complete workflow#23
alexlovelltroy merged 4 commits intoOpenCHAMI:mainfrom
bmcdonald3:testing

Conversation

@bmcdonald3
Copy link
Member

@bmcdonald3 bmcdonald3 commented Nov 12, 2025

Adds E2E test for Example 1 (Basic CRUD)

This PR introduces a true end-to-end test for the 01-basic-crud example, validating the entire user workflow from fabrica init to a fully functional, live API.

What this PR does

  • Adds a new test, TestExample1_EndToEnd, to clean_test.go.
  • This test programmatically follows all steps in the Example 1 README:
    1. Initializes a project.
    2. Adds a Device resource.
    3. Customizes the pkg/resources/device/device.go file with the example's DeviceSpec.
    4. Generates code.
    5. Builds the server.
    6. Starts the server as a background process.
    7. Tests the live API by using the generated client to perform a full CRUD operation.
  • Adds new helper functions to helpers.go (Example1_CustomizeResource, Example1_ConfigureServer) to support the file modifications.

Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>
@alexlovelltroy alexlovelltroy merged commit 77e8829 into OpenCHAMI:main Dec 9, 2025
3 checks passed
alexlovelltroy pushed a commit that referenced this pull request Jan 6, 2026
* Add import
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>

* Add helpers
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>

* Add example 1 test
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>

* Remove outdated step
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>
davidallendj pushed a commit that referenced this pull request Feb 3, 2026
* Add import
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>

* Add helpers
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>

* Add example 1 test
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>

* Remove outdated step
Signed-off-by: Ben McDonald <ben.mcdonald@hpe.com>
Signed-off-by: David Allen <davidallendj@gmail.com>
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.

2 participants