-
Notifications
You must be signed in to change notification settings - Fork 3
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-unit-tests #492
Conversation
|
|
Issue
ministryofjustice/modernisation-platform#6490 Add unit tests where missing
What's changed
I've added unit tests for the backup module within the baselines module and a GH actions workflow file to run them.
As the baselines module is made up of a series of other modules, some of which have constraints that mean they won't be possible to unit test easily (e.g. IAM access analyser can only be built once per region) I decided to specifically target the backup child module with it's own dedicated
backup-test
directory but have kept a singlebaselines_test.go
file that we can add to if there are any more child modules that can be tested.Testing
I tested it locally and now via GH Actions as shown in the status checks below.
I've also added a draft PR ministryofjustice/modernisation-platform#7315 to update the baselines module to use this revision and it reports no changes on a terraform plan: https://github.com/ministryofjustice/modernisation-platform/actions/runs/9645571244/job/26600097925?pr=7315#step:7:318
This is to be expected as I've created variables and set the default values to the original names used for the various resources. The only change will be on apply where some extra outputs will be generated.
Future action
This just tests the backup module, in future we can add more tests for the others where possible. I will write some stories for ones which should be possible.