Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

[WIP] Setting up scaffolding for backend tests

Open devforfu opened this issue 2 years ago • 5 comments

Establishes a setup for testing described in #84.

The purpose of this PR is to enable users for writing unit tests for the backend and, probably, discord-bot components of the Open-Assistant repo.

So far, it only has a trivial test that runs against a single API endpoint. (The app is instantiated in debug mode via the .env file.) But I decided to open a draft PR in order to keep the process transparent and communicate to other contributors. Also, to see if I'm on the right track with this issue.

cc @jack-michaud @andreaskoepf

devforfu avatar Jan 10 '23 20:01 devforfu

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jan 10 '23 20:01 github-actions[bot]

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jan 12 '23 21:01 github-actions[bot]

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jan 29 '23 20:01 github-actions[bot]

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jan 29 '23 20:01 github-actions[bot]

I guess it was somehow automatically closed because of rebasing/merging the fork 🤔

I made one more attempt to restructure the dependencies a bit and try injecting them without a single "context" class including all possible repositories at once. Also, I had to move FrontendUserId into a separate file to avoid circular imports. Plus, I deleted one test as I am not sure how to deal with a nested @managed_tx_function.

devforfu avatar Jan 29 '23 20:01 devforfu