Ved 1145 VED-1141 VED-1150 update test coverage#1359
Ved 1145 VED-1141 VED-1150 update test coverage#1359
Conversation
|
This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket: VED-1145 |
|
| def wait_for_file_to_move_archive(context, timeout=120, interval=5): | ||
| s3 = boto3.client("s3") | ||
| bucket_scope = context.S3_env if context.S3_env != "preprod" else context.sub_environment | ||
| if context.S3_env == "preprod": | ||
| bucket_scope = "int-green" | ||
| else: | ||
| bucket_scope = context.S3_env |
There was a problem hiding this comment.
Hardcoded preprod archive bucket scope could break int-blue runs
In wait_for_file_to_move_archive, preprod now always maps to int-green, ignoring sub_environment. That changes prior behavior and can point checks at the wrong bucket for int-blue.
| for msg in messages: | ||
| body = MnsEvent(**json.loads(msg["Body"])) | ||
| dataref = body.dataref | ||
|
|
||
| if dataref in expected_datarefs: | ||
| matched_messages.append(body) | ||
| print(f"Matched: {dataref}") | ||
|
|
||
| sqs.delete_message(QueueUrl=queue_url, ReceiptHandle=msg["ReceiptHandle"]) |
There was a problem hiding this comment.
Batch positive validation deletes all non-matching messages while polling. If an unexpected NullNHS message exists, it can be removed before the later “must not be created” assertion runs, producing a false pass.



Summary
Add any other relevant notes or explanations here. Remove this line if you have nothing to add.
Reviews Required
Review Checklist
ℹ️ This section is to be filled in by the reviewer.