Skip to content

Commit

Permalink
update instructions to run integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssadai committed Oct 24, 2024
1 parent 3c951ab commit 7051c05
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,39 @@ If you get a 401 response to your API request with an `"Unauthorized: "` error m
Neurobagel API utilizes [Pytest](https://docs.pytest.org/en/7.2.x/) framework for testing.
To run the tests, first make sure you're in repository's main directory and in your environment where the dependencies are installed.
To run the tests, first ensure you're in the repository's root directory and in the environment where the dependencies are installed.
Next, make sure to launch the test SPARQL graph by:
Install the submodules used by the tests:
```bash
git submodule init
git submodule update
```
You can then run the tests by executing the following command in your terminal:
```bash
pytest tests
```
To run the integration tests of SPARQL queries (skipped by default), also launch the test graph store:
```bash
docker compose up -d test_graph
```
NOTE: Don't have a `.env` file in the root directory as it will conflict with the environment variable configuration of the docker compose file since docker compose will try to use that file by default.
_NOTE: Don't have a `.env` file in the root directory as it will conflict with the environment variable configuration of the docker compose file,
since docker compose will try to use `.env` by default._
You can then run the tests by executing the following command in your terminal:
Then, run all tests using:
```bash
pytest -m "integration or not integration"
# OR
pytest -m ""
```
Or, to run only the integration tests:
```bash
pytest tests
pytest -m "integration"
```
## The default Neurobagel SPARQL query
Expand Down

0 comments on commit 7051c05

Please sign in to comment.