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

feature - add teardown options to terraform fixture #24

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

marcoceppi
Copy link
Contributor

There's two ways I see to approach this. The first is what's in this PR where TEARDOWN_* is mapped to the right teardown value. The second is to just have a teardown member on the class that's set to pytest_terraform.options.teardown. That would yield:

from pytest_terraform import terraform


@terraform('aws_sqs', teardown=terraform.teardown.IGNORE)
def test_sqs(aws_sqs):
    assert aws_sqs["aws_sqs_queue.test_queue.tags"] == {
        "Environment": "production"
    }
   queue_url = aws_sqs['test_queue.queue_url']
   print(queue_url)

Open to either approach, or even something different, to make developer experience a little cleaner

@marcoceppi marcoceppi requested a review from kapilt September 10, 2020 12:58
@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

Merging #24 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
+ Coverage   92.51%   92.56%   +0.04%     
==========================================
  Files           8        8              
  Lines         454      457       +3     
==========================================
+ Hits          420      423       +3     
  Misses         34       34              
Impacted Files Coverage Δ
pytest_terraform/tf.py 96.24% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2676bf6...df0abb4. Read the comment docs.

@kapilt
Copy link
Contributor

kapilt commented Sep 10, 2020

ergonomics here favor terraform.TEARDOWN_IGNORE versus nested object usage, imo.

Copy link
Contributor

@kapilt kapilt left a comment

Choose a reason for hiding this comment

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

lgtm

@kapilt kapilt merged commit fc9f220 into master Sep 10, 2020
@marcoceppi marcoceppi deleted the streamline-teardown-options branch September 10, 2020 14:18
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