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

Add tests for driftctl #399

Merged
merged 2 commits into from
Mar 31, 2021
Merged

Add tests for driftctl #399

merged 2 commits into from
Mar 31, 2021

Conversation

eliecharra
Copy link
Contributor

Q A
πŸ› Bug fix? no
πŸš€ New feature? no
⚠ Deprecations? no
❌ BC Break no
πŸ”— Related issues none
❓ Documentation no

Description

Add test for driftctl.go

@eliecharra eliecharra added the kind/maintenance Refactoring or changes to the workspace label Mar 31, 2021
@eliecharra eliecharra added this to the v0.8.0 milestone Mar 31, 2021
@eliecharra eliecharra requested a review from a team March 31, 2021 14:34
@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #399 (46475cc) into main (0847e21) will increase coverage by 1.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
+ Coverage   69.19%   70.23%   +1.04%     
==========================================
  Files         281      281              
  Lines        6149     6149              
==========================================
+ Hits         4255     4319      +64     
+ Misses       1542     1476      -66     
- Partials      352      354       +2     
Impacted Files Coverage Ξ”
pkg/driftctl.go 62.29% <ΓΈ> (+62.29%) ⬆️
pkg/middlewares/aws_instance_block_device.go 100.00% <0.00%> (+2.32%) ⬆️
pkg/middlewares/aws_sns_topic_policy_expander.go 81.81% <0.00%> (+3.03%) ⬆️
pkg/middlewares/s3_bucket_acl.go 100.00% <0.00%> (+5.55%) ⬆️
pkg/middlewares/aws_instance_eip.go 100.00% <0.00%> (+8.69%) ⬆️
pkg/middlewares/aws_default_sqs_queue_policy.go 100.00% <0.00%> (+13.63%) ⬆️
pkg/middlewares/aws_default_vpc.go 100.00% <0.00%> (+16.66%) ⬆️
pkg/middlewares/iam_policy_attachment_sanitizer.go 100.00% <0.00%> (+25.00%) ⬆️
pkg/middlewares/aws_default_subnet.go 44.44% <0.00%> (+44.44%) ⬆️

sundowndev
sundowndev previously approved these changes Mar 31, 2021
Copy link
Contributor

@wbeuil wbeuil left a comment

Choose a reason for hiding this comment

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

We should have done that way sooner ! Love it, just one small comment on one test

ty, _ := gocty.ImpliedType(data)
val, _ := gocty.ToCtyValue(data, ty)
return &val
}(),
Copy link
Contributor

Choose a reason for hiding this comment

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

You could have written the CtyVal like we did in the filter_engine tests:

CtyVal: func() *cty.Value {
  v := cty.ObjectVal(map[string]cty.Value{
    "test_field": cty.StringVal("value to filter on"),
  })
  return &v
}(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously 🀦🏻 This is waaaay more readable thanks πŸ‘πŸ»

@eliecharra eliecharra merged commit a1a56c2 into main Mar 31, 2021
@eliecharra eliecharra deleted the add_functional_test branch March 31, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/maintenance Refactoring or changes to the workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants