Skip to content

fix: Improve Terraform agent<->resource association testing #2187

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

Merged
merged 2 commits into from
Jun 8, 2022

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented Jun 8, 2022

An agent could be associated with multiple resources prior to this, which broke all workspace access (and doesn't make any sense). This adds tests based on Terraform output. The raw Terraform statefiles are pushed for fast testing, and can be iterated on by editing the Terraform and running generate.sh.

This should improve test times and provide a much more stable solution for resource association!

@kylecarbs kylecarbs self-assigned this Jun 8, 2022
@kylecarbs kylecarbs force-pushed the resource-association branch from 3f63dce to 5821ab5 Compare June 8, 2022 21:21
There were a few bugs with multiple agent association this fixes,
and it adds thorough tests using real Terraform state and plans.
@kylecarbs kylecarbs force-pushed the resource-association branch 2 times, most recently from b7eb9b5 to b208e8e Compare June 8, 2022 21:23
@bpmct
Copy link
Member

bpmct commented Jun 8, 2022

Does this encompass the bugs discovered in #1884?

@kylecarbs kylecarbs force-pushed the resource-association branch from b208e8e to 88f08b7 Compare June 8, 2022 21:38
@kylecarbs
Copy link
Member Author

@bpmct yup!

@kylecarbs kylecarbs force-pushed the resource-association branch from 88f08b7 to 4fa9a3b Compare June 8, 2022 21:42
Copy link
Contributor

@f0ssel f0ssel left a comment

Choose a reason for hiding this comment

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

go code lgtm, can't speak to the tf files

Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

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

The test cases are very epic

set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"

for d in */; do
Copy link
Member

Choose a reason for hiding this comment

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

I appreciate that you've included the script for this :)

@kylecarbs kylecarbs merged commit 1470149 into main Jun 8, 2022
@kylecarbs kylecarbs deleted the resource-association branch June 8, 2022 22:40
mafredri added a commit that referenced this pull request Jun 9, 2022
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
mafredri added a commit that referenced this pull request Jun 9, 2022
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
kylecarbs added a commit that referenced this pull request Jun 9, 2022
This was regressed in #2187. There was bad testing around this
before, and this should prevent a similiar situation from happening
again!
kylecarbs added a commit that referenced this pull request Jun 9, 2022
This was regressed in #2187. There was bad testing around this
before, and this should prevent a similiar situation from happening
again!
kylecarbs added a commit that referenced this pull request Jun 9, 2022
This was regressed in #2187. There was bad testing around this
before, and this should prevent a similiar situation from happening
again!
@kylecarbs kylecarbs restored the resource-association branch June 9, 2022 22:20
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
kylecarbs added a commit that referenced this pull request Jun 10, 2022
This was regressed in #2187. There was bad testing around this
before, and this should prevent a similiar situation from happening
again!
@github-actions github-actions bot deleted the resource-association branch February 4, 2023 20:05
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.

4 participants