Skip to content

docs(tests): add makefile commands for test standardisation, update documentation on usage - #251

Merged
lukeroantreeONS merged 5 commits into
mainfrom
242-unit-testing-clarify-how-to-run-locally-developer-expectations
Oct 27, 2026
Merged

lukeroantreeONS merged 5 commits into
mainfrom
242-unit-testing-clarify-how-to-run-locally-developer-expectations

Conversation

@lukeroantreeONS

Copy link
Copy Markdown
Contributor

📌 Pull Request Template

Please complete all sections

✨ Summary

Update documentation to reflect introduction of unit tests, and expected developer behaviour surrounding them.

📜 Changes Introduced

  • feat(make): added makefile commands for running unit tests (run-tests-... | all/vectorisers/indexers/...)
  • docs(tests): updated CONTRIBUTING.md to clarify expectations around test maintenance and improvement
  • docs(tests): updated README.md to clarify standardised local running of unit tests via make commands

✅ Checklist

Please confirm you've completed these checks before requesting a review.

  • Code passes linting with Ruff
  • Security checks pass using Bandit
  • API and Unit tests are written and pass using pytest
  • Terraform files (if applicable) follow best practices and have been validated (terraform fmt & terraform validate)
  • DocStrings follow Google-style and are added as per Pylint recommendations
  • Documentation has been updated if needed

🔍 How to Test

  • Try new make commands locally
  • Review the updated documentation

@lukeroantreeONS
lukeroantreeONS requested a review from a team as a code owner October 26, 2026 18:02
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 26, 2026

@frayle-ons frayle-ons left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, well laid out. I think one typo and 2 optional suggestions for thought

Comment thread CONTRIBUTING.md Outdated

- `make run-tests-all` : run all unit tests
- `make run-tests-vectorisers` : run unit tests associated with the vectorisers module
- `make run-tests-all` : run unit tests associated with the indexers module (WIP)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here - its the same as the first command to run all tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(line 88)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching, I'll push a correction now

Comment thread Makefile Outdated
uv run --extra all pytest tests/test_vectorisers

run-tests-indexers: ## run all available unit tests
uv run --extra all pytest tests/test_indexers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the --extra all flag here? If we're mocking the vectorisers during the indexers and other tests modules then i would think no? And maybe that would mean a slight speed up?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure, thought I'd play it safe - the indexers tests are empty at the moment, pending the PR introducing them, and wasn't sure if it would be needed after any changes we make.
I think you're right though, and we won't need it for this one.
I'll update it do disable this command until they're added though, like I have with the servers one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following a chat about this - I'll add to this PR to include updates to CONTRIBUTING.md and README.md to clarify developer environment requirements more explicitly

Comment thread README.md
make run-tests-evaluation # evaluation module tests (Planned - not yet available)
```


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a note about what our makefile is doing under the hood (using UV and Pytest)? And that we recommend/require running through make?

It would probably help developers understand system requirements and possibly allow them to carefully run tests locally even if they don't have access to libraries like uv but do have access to pytest another way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of the decision to standardise on uv for development, and the introduction of these make commands, is to standardise the developer setup as far as possible to minimise any developer-specific issues / environment differences.
So, I'd be against deviation from this approach in general.

@frayle-ons frayle-ons left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. I've test the new make commands on my machine and they work well. The new CONTRIBUTING.md text renders fine in my vs code preview.

Small punctuation question, but having looked at the rest of the repo not sure we have a super consistent way of formatting lists.

Should we resolve #250 before merging this?

Comment thread CONTRIBUTING.md Outdated
### Testing
We currently do not have a testing pipeline setup for this repository.
We are developing a testing harness of `pytest` unit tests to ensure changes to one area to not silently cause problems in another.
Developers can run these tests locally as they work to confirm their understanding of how their changes impact other areas of the codebase using the following commands;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hypercritical point here - shouldn't it be a colon, not a semi-colon preceding the list? "using the following commands:"

and should each item in the list end with a comma, before the final one ends with a full stop?

@frayle-ons frayle-ons left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've re-run the tests on my machine and they work after #250 was merged. Also changes for documentation look good.

@lukeroantreeONS
lukeroantreeONS merged commit f1f1d5d into main Oct 27, 2026
5 checks passed
@lukeroantreeONS
lukeroantreeONS deleted the 242-unit-testing-clarify-how-to-run-locally-developer-expectations branch October 27, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit Testing: clarify how to run locally & developer expectations

2 participants