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

Fix test for cyral_sidecar_instance_stats data source #466

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

VictorGFM
Copy link
Contributor

Description of the change

Fix test for cyral_sidecar_instance_stats data source so that it works running in parallel with other tests.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • Jira issue referenced in commit message and/or PR title

Testing

Before this fix:

Step #4 - "E2E":     data_source_cyral_sidecar_instance_stats_test.go:19: Step 4/4, expected an error with pattern, no match on: Error running apply: exit status 1
Step #4 - "E2E":         
Step #4 - "E2E":         Error: Unable to create sidecar
Step #4 - "E2E":         
Step #4 - "E2E":           with cyral_sidecar.test_sidecar,
Step #4 - "E2E":           on terraform_plugin_test.tf line 2, in resource "cyral_sidecar" "test_sidecar":
Step #4 - "E2E":            2: 	resource "cyral_sidecar" "test_sidecar" {
Step #4 - "E2E":         
Step #4 - "E2E":         error executing POST request; status code: 500; body: "{\"Message\":\"Failed
Step #4 - "E2E":         to register sidecar: rpc error: code = AlreadyExists desc = error creating
Step #4 - "E2E":         sidecar: rpc error: code = AlreadyExists desc = sidecar with name
Step #4 - "E2E":         `tfprov-acc-data-sidecar-instance-sidecar` already exists\"}\n"

After this fix:

=== RUN   TestAccSidecarInstanceStatsDataSource
=== PAUSE TestAccSidecarInstanceStatsDataSource
=== CONT  TestAccSidecarInstanceStatsDataSource
--- PASS: TestAccSidecarInstanceStatsDataSource (7.66s)
PASS
ok  	github.com/cyralinc/terraform-provider-cyral/cyral	8.266s

@sonarcloud
Copy link

sonarcloud bot commented Oct 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wcmjunior wcmjunior merged commit f8a8042 into main Oct 11, 2023
3 checks passed
@wcmjunior wcmjunior deleted the fix/sidecar-instance-stats-tests branch October 11, 2023 17:17
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.

2 participants