modernisation-platform
modernisation-platform copied to clipboard
Review Testing Strategy for Instance Scheduler Module
User Story
As a MP Engineer I expect the tests on the Instance Scheduler module to be representative of the environment that it will be run in So that i have confidence when making changes/maintenance to the module
Value / Purpose
We recently made some maintenance updates to the container build in the instance scheduler module and the status checks/unit tests passed successfully.
We subsequently found that there was an issue with the container when it was run in the unit tests for the lambda function module as can be seen in this example
│ Error: invoking Lambda Function (instance-scheduler-lambda-function-114): {"errorType":"Runtime.ExitError","errorMessage":"RequestId: 075fdbb1-d817-42eb-a662-165f3f7f5610 Error: Runtime exited with error: exit status 127"}
│
│ with aws_lambda_invocation.test_invocation,
│ on main.tf line 152, in resource "aws_lambda_invocation" "test_invocation":
│ 152: resource "aws_lambda_invocation" "test_invocation" {
│
╵}
apply.go:15:
Error Trace: /home/runner/work/modernisation-platform-terraform-lambda-function/modernisation-platform-terraform-lambda-function/test/apply.go:15
/home/runner/work/modernisation-platform-terraform-lambda-function/modernisation-platform-terraform-lambda-function/test/module_test.go:20
Error: Received unexpected error:
FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: invoking Lambda Function (instance-scheduler-lambda-function-114): {"errorType":"Runtime.ExitError","errorMessage":"RequestId: 075fdbb1-d817-42eb-a662-165f3f7f5610 Error: Runtime exited with error: exit status 127"}
│
│ with aws_lambda_invocation.test_invocation,
│ on main.tf line 152, in resource "aws_lambda_invocation" "test_invocation":
│ 152: resource "aws_lambda_invocation" "test_invocation" {
│
╵}
Test: TestLambdaCreation
The purpose of this story is to investigate why the tests on the instance scheduler repo are not replicant of the ones in the lambda function module as the container build updates which were made caused the instance scheduler to fail the next time it was triggered.
Useful Contacts
@richgreen-moj @ASTRobinson @connormaglynn
Additional Information
No response
Definition of Done
- [ ] Review testing strategy to see if any improvement can be made
- [ ] Carry out any identified improvements
- [ ] Update any documentation as required