Skip to content

[API Gateway] refactors and restructures the end-to-end (E2E) test data generation #212

Closed
ivma1-nhs wants to merge 11 commits intomainfrom
test/ivma-dynamodb-data-uploader
Closed

[API Gateway] refactors and restructures the end-to-end (E2E) test data generation #212
ivma1-nhs wants to merge 11 commits intomainfrom
test/ivma-dynamodb-data-uploader

Conversation

@ivma1-nhs
Copy link
Copy Markdown
Contributor

Description

This PR refactors and restructures the end-to-end (E2E) test data generation and upload process for DynamoDB in the eligibility-signposting-api project.
Key updates include:

  • Replacement of the monolithic generate_test_data.py with a new modular generate_dynamo_data.py script.
  • Migration and renaming of DynamoDB test data JSON files under tests/e2e/data/dynamoDB/ to tests/e2e/data/in/dynamoDB/.
  • Enhanced date placeholder handling, e.g. replacing <<DATE_LAST_WEEK>> with <<DATE_DAY_-7>>.
  • Introduction of helpers for dynamic test data generation and uploading to DynamoDB using new Python modules.
  • Streamlined and reworked Behave feature steps and environment setup for mTLS and AWS integration.
  • Removal of obsolete test configuration and utility files (e.g. conftest.py, api_client.py, pytest.ini).
  • Updated feature files for improved test scenarios and workflow clarity.

Context

These changes are required to support new automated test data pipelines, enable better reproducibility for E2E integration scenarios, and simplify test data management for eligibility signposting API validation.
The update addresses earlier limitations in test data generation and cloud resource setup, aligns with AWS best practices, and removes deprecated logic and configuration.

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the [contributing guidelines](../docs/CONTRIBUTING.md)
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others' privacy, we kindly ask you to NOT include [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that does contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

…dynamic header support

- Updated multiple response JSON files to include detailed eligibility suggestions for COVID, MMR, and RSV conditions.
- Modified the eligibility_check.feature to include additional test cases for various NHS numbers and corresponding JSON responses.
- Refactored eligibility_check_steps.py to support querying the eligibility API with dynamic headers, improving flexibility and maintainability.
- Added functionality to log and save actual API responses for better debugging and validation.
@ivma1-nhs ivma1-nhs self-assigned this Jul 15, 2025
- Modified lastUpdated timestamps in AUTO_RSV_SB_003 to AUTO_RSV_SB_014.json files.
- Updated eligibility cohorts and actions for RSV conditions in response files.
- Changed status and statusText values to reflect actionable states.
- Removed redundant COVID and MMR conditions from processedSuggestions.
- Added new campaign configuration file AUTO_RSV_SB_001.json for automation testing.
- Deleted obsolete patient_s3_sample.json file.
…Automation Framework. +File formatting required
@adam-wallernhs1 adam-wallernhs1 deleted the test/ivma-dynamodb-data-uploader branch November 13, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants