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

Supress empty description test #1521

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

JaylonmcShan03
Copy link
Contributor

@JaylonmcShan03 JaylonmcShan03 commented Oct 28, 2024

Description

This pr adds a test for the suppress empty description logic we have in place for the Description attribute

When running the test, I am getting an weird error where after applying the first step, terraform still detects a change, which with my understanding means the suppression logic isn't taking affect as intended. I am not sure what the hiccup is, because after review the logic it looks perfectly fine to me! Can I get a second pair of eyes on this, there could be something I am not thinking of!

Logs from the test >

`st_name=TestAccResourceRelease_suppressEmptyDescription test_terraform_path=/opt/homebrew/bin/terraform
  error=
  | After applying this test step, the non-refresh plan was not empty.
  | stdout:
  | 
  | 
  | Terraform used the selected providers to generate the following execution
  | plan. Resource actions are indicated with the following symbols:
  |   ~ update in-place
  | 
  | Terraform will perform the following actions:
  | 
  |   # helm_release.test will be updated in-place
  |   ~ resource "helm_release" "test" {
  |       ~ id                         = "suppress-empty-zbqhn4f818" -> (known after apply)
  |       ~ metadata                   = {
  |           ~ app_version    = "1.19.5" -> (known after apply)
  |           ~ chart          = "test-chart" -> (known after apply)
  |           ~ first_deployed = 1730138553 -> (known after apply)
  |           ~ last_deployed  = 1730138566 -> (known after apply)
  |           ~ name           = "suppress-empty-zbqhn4f818" -> (known after apply)
  |           ~ namespace      = "terraform-acc-test-v08zv4w1zi" -> (known after apply)
  |           ~ revision       = 2 -> (known after apply)
  |           ~ values         = jsonencode({}) -> (known after apply)
  |           ~ version        = "1.2.3" -> (known after apply)
  |         } -> (known after apply)
  |         name                       = "suppress-empty-zbqhn4f818"
  |         # (27 unchanged attributes hidden)
  |     }
  | 
  | Plan: 0 to add, 1 to change, 0 to destroy.
  
    resource_helm_release_test.go:714: Step 2/2 error: After applying this test step, the non-refresh plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # helm_release.test will be updated in-place
          ~ resource "helm_release" "test" {
              ~ id                         = "suppress-empty-zbqhn4f818" -> (known after apply)
              ~ metadata                   = {
                  ~ app_version    = "1.19.5" -> (known after apply)
                  ~ chart          = "test-chart" -> (known after apply)
                  ~ first_deployed = 1730138553 -> (known after apply)
                  ~ last_deployed  = 1730138566 -> (known after apply)
                  ~ name           = "suppress-empty-zbqhn4f818" -> (known after apply)
                  ~ namespace      = "terraform-acc-test-v08zv4w1zi" -> (known after apply)
                  ~ revision       = 2 -> (known after apply)
                  ~ values         = jsonencode({}) -> (known after apply)
                  ~ version        = "1.2.3" -> (known after apply)
                } -> (known after apply)
                name                       = "suppress-empty-zbqhn4f818"
                # (27 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.`

Acceptance tests

  • Have you added an acceptance test for the functionality being added?

Release Note

Release note for CHANGELOG:

...

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@JaylonmcShan03 JaylonmcShan03 requested a review from a team as a code owner October 28, 2024 18:12
JaylonmcShan03 and others added 28 commits January 7, 2025 11:39
…ata models. This is the current working version of the data source
* rename: helmReleaseModel -> HelmReleaseModel

* tidying up during code review
* Fix acronyms in struct field names in kubeConfig.go and provider.go

* Fixed acronym in kubeConfig that wasnt pushed in previous pr

* Refactored debug handling to use a boolean variable

* removing unnessary comment

* Updating the debug two conditionals into one

* Fixing edge case logic

* Simpliyfing if statements

* Fixing location of debug variable
* remove duplicate logs

* refactor to use recomputeMetadata method

* use Equal for version check in useChartVersion

* more cleanup in useChartVersion / removing quotation removal from version

* refactor valuesKnown method in ModifyPlan

* remove null check in valuesKnown method

* separate conditionals in recomputeMetadata

* separate conditionals in valuesUnknown
…1476)

* Rename resolveChartName to buildChartNameWithRepository for clarity

* Updating logs to reflect the new function name change
* Refactor: Rename struct fields in HelmReleaseModel to CamelCase

* Fixing overlooked field, and making the struct names in alphabetical order
* remove m.Lock and more

* fix recomputeMetadata logic

* use count in concurrent testconfig

* removal changes in helm directory concurrent test 2

* remove extra tests
jrhouston and others added 21 commits January 7, 2025 11:45
…SingleNestedAttribute` (#1516)

* initial refactor of metadata to be SingleNestedAttribute

* fix unknown value error by using ObjectUnknown instead of ObjectNull()

* update tests to align with SingleNested metadata attribute and not list
* initial refactoring of plan.lint with lintModifyPlan

* replace tflog with diagnostics when cluster is unreachable

* set state.Version as StringNull instead of plan.Version

* Revert "initial refactoring of plan.lint with lintModifyPlan"

This reverts commit 974fdeb.
@jrhouston jrhouston requested a review from a team as a code owner January 7, 2025 18:47
@jrhouston jrhouston force-pushed the supress-empty-description-test branch from 7bf0603 to 1e957a3 Compare January 7, 2025 18:55
@github-actions github-actions bot added size/S and removed size/M labels Jan 7, 2025
Base automatically changed from helm-framework to main January 16, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants