-
Notifications
You must be signed in to change notification settings - Fork 582
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
feat: Add echo provisioner #162
Conversation
This replaces the cdr-basic provisioner type with "echo". It reads binary data from the directory and returns the responses in order. This is used to test project and workspace job logic.
Codecov Report
@@ Coverage Diff @@
## main #162 +/- ##
==========================================
- Coverage 66.38% 65.34% -1.05%
==========================================
Files 105 106 +1
Lines 5501 5580 +79
Branches 68 68
==========================================
- Hits 3652 3646 -6
- Misses 1508 1578 +70
- Partials 341 356 +15
Continue to review full report at Codecov.
|
// The echo provisioner serves as a dummy provisioner primarily | ||
// used for testing. It echos responses from JSON files in the | ||
// format %d.protobuf. It's used for testing. | ||
type echo struct { |
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.
Neat! It's actually really nice to have an example of the most-simple-possible provisioner, just to understand how all the pieces fit together
projectHistory := setupProjectHistory(t, server.Client, user, project, map[string]string{ | ||
"main.tf": `resource "null_resource" "test" {}`, | ||
}) | ||
data, err := echo.Tar(echo.ParseComplete, []*proto.Provision_Response{{ |
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.
Cool 👍
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.
Looks great! Thanks for splitting out the echo
provisioner for tests
This replaces the cdr-basic provisioner type with
"echo". It reads binary data from the directory
and returns the responses in order.
This is used to test project and workspace job logic.
I'm going to fix up tests that consume this to increase coverage in a subsequent PR!