-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add acceptance tests for pipeline schedule #100
Conversation
52eb16b
to
c8a7988
Compare
This resource also lacked acceptance tests, so in order to guard against regressions we have added the following simple acceptance tests: * creating a schedule (with only the required attributes) * updating a schedule (e.g. changing its cronline) * importing a pipeline schedule This work required the addition of UUID to the pipeline schedule resource schema. The UUID is used to assemble the slug of an existing pipeline schedule.
c8a7988
to
01c57c3
Compare
Config: testAccPipelineScheduleConfigBasic("foo", "0 * * * *"), | ||
Check: resource.ComposeAggregateTestCheckFunc( | ||
// Schedules need a pipeline | ||
testAccCheckPipelineExists("buildkite_pipeline.foobar", &resourcePipeline), |
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.
do we need to check the pipeline in these tests, or can we assume it works thanks to the specific tests for the pipeline resource?
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.
Ahh, yeah this is the rub; we don't really need to know that it exists, but if we want to validate we put a schedule on the correct pipeline later, we need a reference, so we memref it to testAccCheckPipelineExists
which populates the (until now nil) value of resourcePipeline
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.
oooohhh, of course. I keep forgetting this methods are also about grabbing an in-memory copy of the data 👍
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.
lovely ❤️
I had a couple of non-blocking questions.
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 good to me, I've confirmed the new tests are green when run locally for me 👍
This resource also lacked acceptance tests, so in order to guard against regressions we have added the following simple acceptance tests:
This work required the addition of UUID to the pipeline schedule resource schema. The UUID is used to assemble the slug of an existing pipeline schedule.