Skip to content

Commit d647408

Browse files
committed
Merge remote-tracking branch 'origin/local-db-insert' into feat/local-db-insert
2 parents 5c53744 + 91a5159 commit d647408

5 files changed

Lines changed: 30 additions & 26 deletions

File tree

.docker.test.env

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ server/workers/tests/testutils/
3333
local_dev/renv/*
3434
local_dev/dev.env
3535
local_dev/paper_preview
36+
.docker.test.env
3637

3738
# php files
3839
/server/classes/headstart/vendor

local_dev/tools/9d4dc6b920d1e2cc08a741f7c56821db.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import requests
2+
3+
def insert_visualization(vis_id):
4+
# load the vis data from file
5+
with open(f"{vis_id}.json", "r") as f:
6+
data = f.read()
7+
payload = {}
8+
payload["vis_id"] = vis_id
9+
# data is expected to be a json string
10+
payload["data"] = data
11+
# the post target may need to be adjusted to work with the current local docker network
12+
res = requests.post("http://127.0.0.1:8081/dev/persistence/createVisualization/dev",
13+
json=payload)
14+
print(res.status_code)
15+
print(res.text)
16+
17+
18+
def main():
19+
vis_ids = [
20+
"9d4dc6b920d1e2cc08a741f7c56821db"
21+
]
22+
for vis_id in vis_ids:
23+
insert_visualization(vis_id)
24+
25+
if __name__ == "__main__":
26+
main()

server/workers/tests/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ listen_addresses = 'localhost,headstart_db_1,headstart-db-1'
6969

7070
Run tests
7171

72+
Create a `.docker.test.env` file first, then run the following command:
73+
7274
```
7375
docker compose -f docker-compose-integration-tests.yml --env-file .docker.test.env run integration_tests
7476
```

0 commit comments

Comments
 (0)