Skip to content

fix(tests): Skip onprem unsupported policy types #510

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
May 13, 2024

Conversation

jacalvo
Copy link
Collaborator

@jacalvo jacalvo commented May 8, 2024

  • Do not run cloud policy types tests with tf_acc_onprem_secure tag

  • Use TypeSet instead of TypeList for rules

},
}

if !buildinfo.OnpremSecure {
Copy link
Contributor

Choose a reason for hiding this comment

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

Love this method. I was thinking we would have to separate out these steps into new file. Great job

Copy link
Contributor

@rosenbloomb-sysdig rosenbloomb-sysdig left a comment

Choose a reason for hiding this comment

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

Awesome!

@dbonf
Copy link
Collaborator

dbonf commented May 9, 2024

Change rules order in customPolicyWithName() to fix TestAccCustomPolicy

don't you think this can happen in a real life scenario? if order is not important maybe you want to use TypeSet instead of TypeList here

@jacalvo
Copy link
Collaborator Author

jacalvo commented May 10, 2024

Change rules order in customPolicyWithName() to fix TestAccCustomPolicy

don't you think this can happen in a real life scenario? if order is not important maybe you want to use TypeSet instead of TypeList here

@dbonf I've pushed 7ea0555 changing to TypeSet and reverting the no longer necessary rule order change in the test. Please let me know if it's ok to edit the description and go ahead with the merge or better to split in two different PRs as this change may be a bit out of scope of the original purpose.

@jacalvo jacalvo force-pushed the skip-unsupported-policy-types-onprem branch 2 times, most recently from e817f78 to 7ea0555 Compare May 10, 2024 13:07
Copy link
Contributor

@rosenbloomb-sysdig rosenbloomb-sysdig left a comment

Choose a reason for hiding this comment

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

Great job!

Copy link
Collaborator

@jcelaya jcelaya left a comment

Choose a reason for hiding this comment

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

❤️

@jacalvo jacalvo requested a review from dbonf May 13, 2024 09:13
Copy link

@storres1912 storres1912 left a comment

Choose a reason for hiding this comment

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

Thank you @jacalvo!

@jacalvo jacalvo force-pushed the skip-unsupported-policy-types-onprem branch from 7ea0555 to 839fbe7 Compare May 13, 2024 17:49
jacalvo added 2 commits May 13, 2024 20:37
* Do not run cloud policy types tests with `tf_acc_onprem_secure` tag

* Change rules order to fix `TestAccCustomPolicy`:

```
resource_sysdig_secure_custom_policy_test.go:19: Step 2/12 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.

          map[string]string{
        -	"rules.0.name": "Write below etc",
        +	"rules.0.name": "TERRAFORM TEST 6yf1pzvnbf - Terminal Shell",
        -	"rules.1.name": "TERRAFORM TEST 6yf1pzvnbf - Terminal Shell",
        +	"rules.1.name": "Write below etc",
          }
```
Reverts the order change in the test which is no longer needed.
@jacalvo jacalvo force-pushed the skip-unsupported-policy-types-onprem branch from 839fbe7 to 2bd6571 Compare May 13, 2024 18:38
@jacalvo jacalvo enabled auto-merge (squash) May 13, 2024 18:39
@jacalvo jacalvo merged commit 4d9d8b5 into master May 13, 2024
23 checks passed
@jacalvo jacalvo deleted the skip-unsupported-policy-types-onprem branch May 13, 2024 18:54
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.

8 participants