Onboarding Intake(1/3): Intake Runner#1086
Onboarding Intake(1/3): Intake Runner#1086devanshcache wants to merge 23 commits intostackitcloud:mainfrom
Conversation
| @@ -0,0 +1,160 @@ | |||
| package runner_test | |||
There was a problem hiding this comment.
Could you move this file please to stackit/internal/services/intake/intake_acc_test.go please?
We have one acc test for each service usually. See https://github.com/stackitcloud/terraform-provider-stackit/blob/da2bb41b1e1c702e8aa53ae5221f5a49bd6a9251/stackit/internal/services/git/git_acc_test.go for reference 😅
89b2fc8 to
540b360
Compare
|
@yago-123 could you please resolve the comments you adressed already? I will only start with another review as soon as all open comments are resolved. |
|
And please check that failing CI pipeline. Maybe run a |
Yes! notice this is still in progress though |
9d5b54d to
3922287
Compare
a2fdb55 to
e00faf5
Compare
@rubenhoenle this should be ready now |
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
|
|
||
| # stackit_intake_runner (Data Source) | ||
|
|
||
| Datasource for STACKIT Intake Runner. |
| resource.TestCheckResourceAttr(intakeRunnerResource, "max_message_size_kib", "1024"), | ||
| resource.TestCheckResourceAttr(intakeRunnerResource, "max_messages_per_hour", "1000"), | ||
| resource.TestCheckResourceAttrSet(intakeRunnerResource, "id"), | ||
| resource.TestCheckResourceAttrSet(intakeRunnerResource, "region"), |
There was a problem hiding this comment.
please check for the actual value (testutil.Region)
| ConfigVariables: testConfigVarsMinUpdated(), | ||
| Config: testutil.IntakeProviderConfig() + "\n" + resourceMin, | ||
| Check: resource.ComposeAggregateTestCheckFunc( | ||
| resource.TestCheckResourceAttr(intakeRunnerResource, "name", intakeRunnerMinNameUpdated), |
There was a problem hiding this comment.
also check all the other fields here please
| resource.TestCheckResourceAttr(intakeRunnerResource, "labels.created_by", "terraform-provider-stackit"), | ||
| resource.TestCheckResourceAttrSet(intakeRunnerResource, "runner_id"), | ||
| resource.TestCheckResourceAttrSet(intakeRunnerResource, "id"), | ||
| resource.TestCheckResourceAttrSet(intakeRunnerResource, "region"), |
There was a problem hiding this comment.
same here, check the actual value
| resource.TestCheckResourceAttr(intakeRunnerResource, "project_id", testutil.ConvertConfigVariable(testConfigVarsMax["project_id"])), | ||
| resource.TestCheckResourceAttr(intakeRunnerResource, "name", testutil.ConvertConfigVariable(testConfigVarsMax["name"])), | ||
| resource.TestCheckResourceAttr(intakeRunnerResource, "description", "An example runner for Intake"), | ||
| resource.TestCheckResourceAttr(intakeRunnerResource, "max_message_size_kib", "1024"), |
There was a problem hiding this comment.
please use a variable instead of hardcoding these values (max_message_size_kib, description, max_messages_per_hour, ...)
| { | ||
| ConfigVariables: testConfigVarsMaxUpdated(), | ||
| Config: testutil.IntakeProviderConfig() + "\n" + resourceMax, | ||
| Check: resource.ComposeAggregateTestCheckFunc( |
There was a problem hiding this comment.
check all fields here please
| const intakeRunnerResource = "stackit_intake_runner.example" | ||
|
|
||
| const ( | ||
| intakeRunnerMinName = "intake-min-runner" |
There was a problem hiding this comment.
This belongs into testConfigVarsMin please. Define and consume the values from there.
| intakeRunnerMaxNameUpdated = "intake-max-runner-upd" | ||
| ) | ||
|
|
||
| var testConfigVarsMin = config.Variables{ |
There was a problem hiding this comment.
| var testConfigVarsMin = config.Variables{ | |
| var testIntakeRunnerConfigVarsMin = config.Variables{ |
There was a problem hiding this comment.
applies to the others as well
| ) | ||
|
|
||
| //go:embed testdata/resource-min.tf | ||
| var resourceMin string |
There was a problem hiding this comment.
| var resourceMin string | |
| var resourceIntakeRunnerMin string |
| var resourceMin string | ||
|
|
||
| //go:embed testdata/resource-max.tf | ||
| var resourceMax string |
There was a problem hiding this comment.
| var resourceMax string | |
| var resourceIntakeRunnerMax string |
Description
This PR onboards the new STACKIT Intake (ticket) service into the Terraform provider.
Intake is composed of three components:
This PR contains the Intake Runners part only to make a quicker and less overwhelming review.
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)