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

Implement Pulumi tests #1835

Closed
5 tasks done
jemrobinson opened this issue Apr 25, 2024 · 2 comments · Fixed by #1894
Closed
5 tasks done

Implement Pulumi tests #1835

jemrobinson opened this issue Apr 25, 2024 · 2 comments · Fixed by #1894
Labels
enhancement New functionality that should be added to the Safe Haven

Comments

@jemrobinson
Copy link
Member

jemrobinson commented Apr 25, 2024

✅ Checklist

  • I have searched open and closed issues for duplicates.
  • This is a request for a new feature in the Data Safe Haven or an upgrade to an existing feature.
  • The feature is still missing in the latest version.
  • I have read through the documentation.
  • This isn't an open-ended question (open a discussion if it is).

🍓 Suggested change

With our infrastructure deployed by Pulumi, we should be able to write some infrastructure tests.

🚂 How could this be done?

Look at the Pulumi testing docs: https://www.pulumi.com/docs/using-pulumi/testing/

Note this issue which implies it won't be trivial to add unit tests to an inline program.

@jemrobinson jemrobinson added the enhancement New functionality that should be added to the Safe Haven label Apr 25, 2024
@jemrobinson jemrobinson added this to the Release 5.0.0rc2 milestone Apr 25, 2024
@JimMadge
Copy link
Member

The property and integration tests deploy real infrastructure.

Unit tests look quite simple to implement though, there is a guide.
It more or less involved mocking the Pulumi SDKs deploy function.

So, we wouldn't be able to check that the Pulumi calls will definitely work, but you can check that, for example, dsh deploy shm would deploy a set of Pulumi objects with certain arguments.

That is very similar to what I've done with mocking some Azure SDK functions.

@JimMadge
Copy link
Member

From a conversation with @jemrobinson,

The property tests can check a series of assertions against deployed infrastructure. Probably too costly to put in CI. However, that could be a really interesting test we could run before releases, and to provide as a dsh validate command to help ensure a deployed TRE is behaving as expected.

This was referenced May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality that should be added to the Safe Haven
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants