Skip to content

Commit 9127aff

Browse files
committed
Merge branch 'master' into bugfix/pubmed-citations
2 parents 07b3aa1 + 301e401 commit 9127aff

110 files changed

Lines changed: 9732 additions & 5693 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": "> 0.25%, not dead"
7+
}
8+
],
9+
"@babel/preset-react",
10+
"@babel/preset-typescript"
11+
]
12+
}

.github/workflows/backend.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Backend CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
8+
jobs:
9+
persistence-unit-tests:
10+
name: Unit tests for persistence functions
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.10"
21+
22+
- name: Cache pip dependencies
23+
uses: actions/cache@v3
24+
with:
25+
path: ~/.cache/pip
26+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
27+
restore-keys: |
28+
${{ runner.os }}-pip-
29+
30+
- name: Give execution permissions to script
31+
run: chmod +x tests_runners/persistence/locally.sh
32+
33+
- name: Run tests
34+
run: tests_runners/persistence/locally.sh

.github/workflows/frontend.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Frontend CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
8+
jobs:
9+
test:
10+
name: Unit and snapshot tests
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Copy config file
18+
run: cp config.example.js config.js
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 18
24+
cache: "npm"
25+
26+
- name: Clean node_modules and lockfile
27+
run: rm -rf node_modules package-lock.json
28+
29+
- name: Install project dependencies
30+
run: npm install
31+
32+
- name: Run tests
33+
run: npm run test
34+
35+
build:
36+
name: Build the project like on production deployment
37+
needs: test
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
- name: Copy the config file for the vis
45+
run: cp config.example.js config.js
46+
47+
- name: Setup Node.JS
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 18
51+
cache: "npm"
52+
53+
- name: Install all project dependencies
54+
run: npm ci
55+
56+
- name: Build the project (prod)
57+
run: npx webpack

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Folders that should not be checked by Prettier
2+
.github/
3+
.pytest_cache/
4+
.vscode/
5+
api_cache/
6+
checks/
7+
dist/
8+
doc/
9+
examples/
10+
local_dev/
11+
node_modules/
12+
server/
13+
14+
# Exact files that should not be checked by Prettier
15+
.docker.test.env
16+
.flake8
17+
CHANGELOG.md

.prettierrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"quoteProps": "consistent",
8+
"jsxSingleQuote": false,
9+
"trailingComma": "all",
10+
"bracketSpacing": true,
11+
"bracketSameLine": false,
12+
"arrowParens": "always",
13+
"proseWrap": "always",
14+
"endOfLine": "lf",
15+
"embeddedLanguageFormatting": "auto"
16+
}

babel.config.js

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
services:
2-
3-
end2endtest:
2+
integration_tests:
43
build:
54
context: ./server/workers/tests
65
dockerfile: ./Dockerfile.tests
7-
container_name: end2endtest
8-
hostname: "end2endtest"
6+
container_name: integration_tests
7+
hostname: "integration_tests"
98
environment:
109
POSTGRES_USER: ${POSTGRES_USER}
1110
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
12-
POSTGRES_HOST: ${POSTGRES_HOST}
13-
POSTGRES_PORT: ${POSTGRES_PORT}
14-
POSTGRES_HOSTS: ${POSTGRES_HOST}
15-
POSTGRES_PORTS: ${POSTGRES_PORT}
16-
DEFAULT_DATABASE: ${POSTGRES_DATABASE}
11+
POSTGRES_HOSTS: ${POSTGRES_HOSTS}
12+
POSTGRES_PORTS: ${POSTGRES_PORTS}
13+
DEFAULT_DATABASE: ${POSTGRES_DB}
1714
SERVICE_VERSION: "test_version"
1815
ports:
1916
- "7575:80"
@@ -23,46 +20,55 @@ services:
2320
- db
2421
- backend
2522
restart: "no"
26-
entrypoint: ["pytest", '/app/workers/tests/test_end2end.py', '-s', '-rfA']
23+
entrypoint:
24+
["pytest", "/app/workers/tests/integration-tests.py", "-s", "-rfA"]
2725
networks:
2826
- test
2927

3028
db:
31-
container_name: ${POSTGRES_HOST}
32-
image: 'postgres:12.2-alpine'
29+
container_name: ${POSTGRES_HOSTS}
30+
image: "postgres:12.2-alpine"
3331
restart: "no"
34-
hostname: ${POSTGRES_HOST}
32+
hostname: ${POSTGRES_HOSTS}
3533
environment:
3634
POSTGRES_USER: ${POSTGRES_USER}
3735
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
38-
POSTGRES_PORT: ${POSTGRES_PORT}
39-
DEFAULT_DATABASE: ${POSTGRES_DATABASE}
36+
POSTGRES_PORT: ${POSTGRES_PORTS}
37+
DEFAULT_DATABASE: ${POSTGRES_DB}
4038
command: postgres -c config_file=/etc/postgresql.conf -c hba_file=/etc/pg_hba.conf
4139
volumes:
4240
- ./server/workers/tests/test_data/pg_hba_test_local.conf:/etc/pg_hba.conf
4341
- ./server/workers/tests/test_data/postgresql_test_local.conf:/etc/postgresql.conf
4442
ports:
45-
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
43+
- "${POSTGRES_PORTS}:${POSTGRES_PORTS}"
4644
networks:
4745
- test
4846

4947
redis:
50-
image: 'redis:6.0-alpine'
51-
restart: unless-stopped
52-
hostname: "${REDIS_HOST}"
53-
# container_name: "${REDIS_HOST}"
54-
environment:
55-
REDIS_HOST: "${REDIS_HOST}"
56-
REDIS_PORT: "${REDIS_PORT}"
57-
REDIS_PASSWORD: "${REDIS_PASSWORD}"
58-
command: ["redis-server", "/etc/redis/redis.conf", "--bind", "${REDIS_HOST}", "--port", "${REDIS_PORT}"]
59-
volumes:
60-
- 'redis:/var/lib/redis/data'
61-
- ./local_dev/redis.conf:/etc/redis/redis.conf
62-
ports:
48+
image: "redis:6.0-alpine"
49+
restart: unless-stopped
50+
hostname: "${REDIS_HOST}"
51+
# container_name: "${REDIS_HOST}"
52+
environment:
53+
REDIS_HOST: "${REDIS_HOST}"
54+
REDIS_PORT: "${REDIS_PORT}"
55+
REDIS_PASSWORD: "${REDIS_PASSWORD}"
56+
command:
57+
[
58+
"redis-server",
59+
"/etc/redis/redis.conf",
60+
"--bind",
61+
"${REDIS_HOST}",
62+
"--port",
63+
"${REDIS_PORT}",
64+
]
65+
volumes:
66+
- "redis:/var/lib/redis/data"
67+
- ./local_dev/redis.conf:/etc/redis/redis.conf
68+
ports:
6369
- "127.0.0.1:${REDIS_PORT}:${REDIS_PORT}"
64-
networks:
65-
- test
70+
networks:
71+
- test
6672

6773
api:
6874
build:
@@ -81,13 +87,13 @@ services:
8187
FLASK_ENV: "${FLASK_ENV}"
8288
POSTGRES_USER: "${POSTGRES_USER}"
8389
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
84-
POSTGRES_HOST: "${POSTGRES_HOST}"
85-
DEFAULT_DATABASE: "${POSTGRES_DATABASE}"
90+
POSTGRES_HOST: "${POSTGRES_HOSTS}"
91+
DEFAULT_DATABASE: "${POSTGRES_DB}"
8692
command: ["python", "api/tests/mock_app.py"]
8793
depends_on:
8894
- redis
8995
- db
90-
networks:
96+
networks:
9197
- test
9298

9399
persistence:
@@ -101,11 +107,11 @@ services:
101107
SERVICE_VERSION: "test"
102108
BEHIND_PROXY: "false"
103109
FLASK_ENV: "development"
104-
POSTGRES_HOSTS: ${POSTGRES_HOST}
105-
POSTGRES_PORTS: ${POSTGRES_PORT}
110+
POSTGRES_HOSTS: ${POSTGRES_HOSTS}
111+
POSTGRES_PORTS: ${POSTGRES_PORTS}
106112
POSTGRES_USER: ${POSTGRES_USER}
107113
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
108-
DEFAULT_DATABASE: ${POSTGRES_DATABASE}
114+
DEFAULT_DATABASE: ${POSTGRES_DB}
109115
volumes:
110116
- ./server/workers/tests/mock_app.py:/persistence/mock_app.py
111117
command: ["python", "mock_app.py"]

0 commit comments

Comments
 (0)