Skip to content
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

Merged
merged 1 commit into from
Feb 4, 2022
Merged

feat: Add echo provisioner #162

merged 1 commit into from
Feb 4, 2022

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented Feb 4, 2022

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!

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.
@kylecarbs kylecarbs self-assigned this Feb 4, 2022
@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #162 (44e8ee2) into main (65de6ee) will decrease coverage by 1.04%.
The diff coverage is 56.17%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittest-go-macos-latest 62.49% <56.17%> (-1.23%) ⬇️
unittest-go-ubuntu-latest 63.78% <56.17%> (-1.60%) ⬇️
unittest-go-windows-latest 61.64% <56.17%> (-1.81%) ⬇️
unittest-js 64.21% <ø> (ø)
Impacted Files Coverage Δ
coderd/projects.go 67.22% <ø> (ø)
provisioner/echo/serve.go 52.43% <52.43%> (ø)
coderd/coderdtest/coderdtest.go 100.00% <100.00%> (ø)
coderd/provisionerdaemons.go 47.80% <100.00%> (-5.98%) ⬇️
peer/channel.go 84.75% <0.00%> (-2.44%) ⬇️
peer/conn.go 77.17% <0.00%> (-2.06%) ⬇️
provisionerd/provisionerd.go 68.43% <0.00%> (-0.97%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65de6ee...44e8ee2. Read the comment docs.

Comment on lines +39 to +42
// 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 {
Copy link
Contributor

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{{
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool 👍

Copy link
Contributor

@bryphe-coder bryphe-coder left a 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

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.

None yet

2 participants