You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`LABEL_STUDIO_ACCESS_TOKEN`| The access token for the Label Studio API. The access token for the Label Studio API. This can be obtained by logging into Label Studio and navigating to the [user account section](https://app.heartex.com/user/account), where the access token can be copied. |`abc123`|
8
+
|`LABEL_STUDIO_PROJECT_ID`| The project ID for the Label Studio API. This can be obtained by logging into Label Studio and navigating to the relevant project, where the project id will be in the URL, as in `https://app.heartex.com/projects/58475/`|`58475`|
9
+
|`LABEL_STUDIO_ORGANIZATION_ID`| The organization ID for the Label Studio API. This can be obtained by logging into Label Studio and navigating to the [Organization section](https://app.heartex.com/organization?page=1), where the organization ID can be copied. |`6758`|
10
+
|`GOOGLE_API_KEY`| The API key required for accessing the Google Custom Search API |`abc123`|
11
+
|`GOOGLE_CSE_ID`| The CSE ID required for accessing the Google Custom Search API |`abc123`|
12
+
|`POSTGRES_USER`| The username for the test database |`test_source_collector_user`|
13
+
|`POSTGRES_PASSWORD`| The password for the test database |`HanviliciousHamiltonHilltops`|
14
+
|`POSTGRES_DB`| The database name for the test database |`source_collector_test_db`|
15
+
|`POSTGRES_HOST`| The host for the test database |`127.0.0.1`|
16
+
|`POSTGRES_PORT`| The port for the test database |`5432`|
17
+
|`DS_APP_SECRET_KEY`| The secret key used for decoding JWT tokens produced by the Data Sources App. Must match the secret token that is used in the Data Sources App for encoding. |`abc123`|
Copy file name to clipboardExpand all lines: README.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ openai-playground | Scripts for accessing the openai API on PDAP's shared accoun
14
14
source_collectors| Tools for extracting metadata from different sources, including CKAN data portals and Common Crawler
15
15
collector_db | Database for storing data from source collectors
16
16
collector_manager | A module which provides a unified interface for interacting with source collectors and relevant data
17
+
core | A module which integrates other components, such as collector_manager and collector_db
18
+
api | API for interacting with collector_manager, core, and collector_db
19
+
local_database | Resources for setting up a test database for local development
17
20
18
21
## How to use
19
22
@@ -30,6 +33,29 @@ Thank you for your interest in contributing to this project! Please follow these
30
33
- If you want to work on something, create an issue first so the broader community can discuss it.
31
34
- If you make a utility, script, app, or other useful bit of code: put it in a top-level directory with an appropriate name and dedicated README and add it to the index.
32
35
36
+
# Testing
37
+
38
+
Note that prior to running tests, you need to install [Docker](https://docs.docker.com/get-started/get-docker/) and have the Docker engine running.
39
+
40
+
Tests can be run by spinning up the `docker-compose-test.yml` file in the root directory. This will start a two-container setup, consisting of the FastAPI Web App and a clean Postgres Database.
41
+
42
+
This can be done via the following command:
43
+
44
+
```bash
45
+
docker compose up -d
46
+
```
47
+
48
+
Note that while the container may mention the web app running on `0.0.0.0:8000`, the actual host may be `127.0.0.1:8000`.
49
+
50
+
To access the API documentation, visit `http://{host}:8000/docs`.
Be sure to inspect the `docker-compose.yml` file in the root directory -- some environment variables are dependant upon the Operating System you are using.
To spin up a development version of the client, run:
2
+
3
+
```bash
4
+
fastapi dev main.py
5
+
```
6
+
7
+
For the client to function properly in a local environment, the local database must be set up. Consult the `README.md` file in the `local_database` directory for further instructions.
0 commit comments