-
Notifications
You must be signed in to change notification settings - Fork 15
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 pulumi tests #1894
Add pulumi tests #1894
Conversation
2a51abd
to
cb3d095
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Helpful as an example when we write more Pulumi tests in the future.
Having to .apply()
does make tests a bit untidy but I suppose that is just what happens when working with promises.
If we wanted to do more "abstract" tests like
assert "Internet" not in sre_nsg.rules.allowed
we might have to write bespoke functions or lambdas in test functions.
@JimMadge I think the kind of abstract test you're thinking of could be better covered by property tests on deployed infrastructure. |
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.🚦 Depends on
n/a
Adds some proof-of-concept Pulumi unit tests for the SRE ApplicationGateway component.
Note that much of what is described in the Pulumi documentation about Mocking does not seem to work with inline programs.
Important notes:
Outputs
should be tested within anapply
loop withrun_with_unknowns
enabled, otherwise they will silently succeed on encountering any unknown valuesresource_assertions.py
) as rawassert
cannot be used inside anapply
looppulumi.runtime.test
or they will silently succeedSREApplicationGateway
now hasself.application_gateway = ...
in its constructor so that we can test the ApplicationGateway resource.🌂 Related issues
Closes #1835
🔬 Tests