Skip to content

Commit d1468e6

Browse files
authored
VED-000: Update README with linting info and tests/e2e_automation/.env.example… (#1258)
* Update README with linting info and tests/e2e_automation/.env.example.dynamic with apigee env info * Address review comments
1 parent b9ace00 commit d1468e6

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,22 @@ Steps:
142142
pip install poetry
143143
```
144144
145-
8. Install pre-commit hooks. Ensure you have installed nodejs at the same version or later as per .tool-versions and
145+
### Install Pre-Commit Hooks
146+
147+
[Husky](https://typicode.github.io/husky/) is used to perform automatic checks upon making a commit.
148+
It is configured within `.husky/pre-commit` to run the checks defined in the root level `package.json` under `lint-staged`.
149+
To set this up:
150+
151+
1. Ensure you have installed nodejs at the same version or later as per .tool-versions and
146152
then, from the repo root, run:
153+
147154
```
148155
npm install
149156
```
150157
158+
2. Run `cd quality_checks` then `poetry install --no-root`. This will make sure your version of ruff is the same as used in the GitHub pipeline.
159+
You can check your version is correct by running `poetry run ruff --version` from within the `quality_checks` directory and comparing to the version in the poetry.lock file.
160+
151161
### Setting up a virtual environment with poetry
152162
153163
The steps below must be performed in each Lambda function folder and e2e_automation folder to ensure the environment is correctly configured.
@@ -206,18 +216,6 @@ Steps:
206216
207217
It is not necessary to activate the virtual environment (using `source .venv/bin/activate`) before running a unit test suite from the command line; `direnv` will pick up the correct configurations for us. Run `pip list` to verify that the expected packages are installed. You should for example see that `recordprocessor` is specifically running `moto` v4, regardless of which if any `.venv` is active.
208218
209-
### Setting up the root level environment
210-
211-
The root-level virtual environment is primarily used for linting, as we create separate virtual environments for each folder that contains Lambda functions.
212-
Steps:
213-
214-
1. Follow instructions above to [install dependencies](#install-dependencies) & [set up a virtual environment](#setting-up-a-virtual-environment-with-poetry).
215-
**Note: While this project uses Python 3.11 (e.g. for Lambdas), the NHSDigital/api-management-utils repository — which orchestrates setup and linting — defaults to Python 3.8.
216-
The linting command is executed from within that repo but calls the Makefile in this project, so be aware of potential Python version mismatches when running or debugging locally or in the pipeline.**
217-
2. Run `make lint`. This will:
218-
- Check the linting of the API specification yaml.
219-
- Run Flake8 on all Python files in the repository, excluding files inside .venv and .terraform directories.
220-
221219
## IDE setup
222220
223221
The current team uses VS Code mainly. So this setup is targeted towards VS code. If you use another IDE please add the documentation to set up workspaces here.

tests/e2e_automation/.env.example.dynamic

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ scope=
1111
# Set all the below values based on the environment you are testing e.g. pr-xxx, internal-dev, internal-qa
1212
baseUrl=https://internal-dev.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4-pr-123
1313
aws_token_refresh=False
14-
aws_profile_name={your-aws-profile}
14+
aws_profile_name=your-aws-profile# e.g. 345594581768_DEV-IMMS-Devops
1515

1616
S3_env=pr-123
1717
LOCAL_RUN_FILE_NAME=HPV_Vaccinations_v5_V0V8L_20251111T16304982.csv
1818
AWS_DOMAIN_NAME=pr-123.imms.dev.vds.platform.nhs.uk
1919

2020
PROXY_NAME=immunisation-fhir-api-pr-123
2121
# See README for details on how to obtain this
22-
APIGEE_ACCESS_TOKEN={use-the-apigee-get-token-utility}
23-
APIGEE_USERNAME={your-apigee-developer-email}
24-
APIGEE_ENVIRONMENT={the-relevant-apigee-env}# E.g. internal-dev, internal-qa
22+
APIGEE_ACCESS_TOKEN=use-the-apigee-get-token-utility-and-paste-token-here
23+
APIGEE_USERNAME=forename.surname1@nhs.net
24+
# E.g. internal-dev, internal-qa for running the e2e test locally. Refer to manifest_template.yml in the root directory
25+
# to see the defined apigee environments. Note: use internal-dev (i.e. NOT pr-123) for testing your PR locally
26+
APIGEE_ENVIRONMENT=internal-dev

0 commit comments

Comments
 (0)