Skip to content

Commit

Permalink
Add env vars to github workflow file
Browse files Browse the repository at this point in the history
Database scripts use env vars, added those for github tests
  • Loading branch information
genie9 committed Dec 9, 2021
1 parent 7184a17 commit dec2e3c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ jobs:

runs-on: ${{ matrix.os }}

env:
MONGO_HOST: localhost:27017
MONGO_DATABASE: default
MONGO_AUTHDB: admin

name: Integration Tests

steps:
Expand All @@ -34,9 +29,16 @@ jobs:
docker-compose --env-file .env.example up -d --build
sleep 30
- name: Run Integration test
- name: Clear database
run: |
python tests/integration/clean_db.py
env:
MONGO_HOST: localhost:27017
MONGO_DATABASE: default
MONGO_AUTHDB: admin

- name: Run Integration test
run: |
python tests/integration/run_tests.py
- name: Collect logs from docker
Expand All @@ -63,9 +65,16 @@ jobs:
docker-compose -f docker-compose-tls.yml --env-file .env.example up -d
sleep 30
- name: Run Integration test
- name: Clear database
run: |
python tests/integration/clean_db.py --tls
env:
MONGO_HOST: localhost:27017
MONGO_DATABASE: default
MONGO_AUTHDB: admin

- name: Run Integration test
run: |
python tests/integration/run_tests.py
- name: Collect logs from docker
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ async def post_folder(sess, data):
"""
async with sess.post(f"{folders_url}", data=json.dumps(data)) as resp:
LOG.debug("Adding new folder")
assert resp.status == 201, "HTTP Status code error"
ans = await resp.json()
assert resp.status == 201, f"HTTP Status code error {resp.status} {ans}"
return ans["folderId"]


Expand Down Expand Up @@ -937,13 +937,13 @@ async def test_getting_folders_filtered_by_name(sess):
folders.append(await post_folder(sess, folder_data))

async with sess.get(f"{folders_url}?name=filter") as resp:
assert resp.status == 200
ans = await resp.json()
assert resp.status == 200, f"HTTP Status code error {resp.status} {ans}"
assert ans["page"]["totalFolders"] == 3

async with sess.get(f"{folders_url}?name=extra") as resp:
assert resp.status == 200
ans = await resp.json()
assert resp.status == 200, f"HTTP Status code error {resp.status} {ans}"
assert ans["page"]["totalFolders"] == 1

async with sess.get(f"{folders_url}?name=2021 special") as resp:
Expand Down

0 comments on commit dec2e3c

Please sign in to comment.