Skip to content

Commit 94d73fb

Browse files
authored
Merge pull request #264 from UW-Macrostrat/refactor
Refactor test suite and clean up unused elements
2 parents e74da8d + e3af857 commit 94d73fb

File tree

17 files changed

+1371
-5207
lines changed

17 files changed

+1371
-5207
lines changed
Lines changed: 329 additions & 335 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarnPath: .yarn/releases/yarn-4.9.1.cjs
1+
yarnPath: .yarn/releases/yarn-4.11.0.cjs

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ Redis is optional. When the API starts requests for all columns and all units
1717
are cached. If Redis is available it will be used, otherwise they are cached in
1818
the application memory.
1919

20-
The API requires `node` v14 or later to run. Recent testing has been conducted
21-
on `node` v18.
20+
The API requires `node` v20 or to run.
2221

23-
#### Data
22+
## Data
2423

25-
The following databases must be in place:
26-
27-
- MariaDB - macrostrat
28-
- Postgres - burwell, alice, wof, elevation
24+
The `macrostrat` PostgreSQL database must be available.
2925

3026
## Setup
3127

@@ -42,12 +38,6 @@ Next, install dependencies:
4238
yarn install
4339
```
4440

45-
NOTE: Postgres connections are completely broken in node v14 and v15 (as of
46-
2021-03-16). Use node v12!
47-
48-
This will also run the script `postinstall.sh` which copies credentials files
49-
into place.
50-
5141
## Running the API
5242

5343
Add environment variables to your shell or `.env` file. The
@@ -56,6 +46,17 @@ Add environment variables to your shell or `.env` file. The
5646
To start the API run `npm start <port|5000>`. This will start the API on the
5747
specified port (default 5000).
5848

49+
## Running tests
50+
51+
Tests can be run with `yarn test`. Currently, you must have a local instance of the
52+
API running separately (e.g., `yarn start` or `yarn run dev`). You can also set
53+
the `TEST_API_URL` variable to a different URL if you want to test a
54+
different instance.
55+
56+
Additionally, you can set a `TEST_PRODUCTION_API_URL` to run comparisons against
57+
another running instance of the API (e.g., production). This is useful for
58+
ensuring that new versions of the API return the same results as older versions.
59+
5960
## Generating a release
6061

6162
Update the version string in `package.json` and run:
@@ -74,6 +75,13 @@ instructions for generating a cache refresh key. The cache refresh key is used
7475
as a secret parameter to programmatically refresh the column cache, such as in
7576
situations in which the underlying data has been changed (editing, adding, etc).
7677

78+
## Data
79+
80+
Required databases (version 1):
81+
82+
- MariaDB - macrostrat
83+
- Postgres - burwell, alice, wof, elevation
84+
7785
## Running
7886

7987
To start the API simply run `npm start` which will start a process on port 5050.

api-tests/Makefile

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)