Skip to content

Commit

Permalink
Mock web api for dashboard tests (#1116)
Browse files Browse the repository at this point in the history
* Add important comment into Github Workflow before running orion sever, about necessary `ulimit -n` to set so that MongoDB works correctly.

* Add a script to call orion server with requests.
Add script to Github workfloe 3 times.
Also run playwright 3 times.

* Add starting message, and request timeout (10 minutes).

* Remove urls.json, directly add urls into script.

* Try to increase ulimit -i, -l and -u

* Try to set soft ulimit

* Do not try anymore to set ulimit.

* Get back to PickledDB for frontend unit tests.

* Back to MongoDB.

* Add a fake server to mock orion server for dashboard tests.

* Use fake server in dashboard tests.

* Move back to original call_orion_server
Create gunicorn_tmp_dir in CI before launching fake server

* Clean-up and add doc.
  • Loading branch information
notoraptor authored Aug 21, 2023
1 parent 083dc38 commit 2944875
Show file tree
Hide file tree
Showing 3 changed files with 13,702 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/dashboard-src-new-with-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ jobs:
- name: check ulimit
run: ulimit -a

- name: Start Orion backend
- name: Start fake Orion backend
run: |
# Start Orion backend in repository root folder.
cd ../../
mkdir -p gunicorn_tmp_dir
orion -vv serve -c .github/workflows/orion/orion_config_mongodb.yaml > dashboard/src/orion-backend-${{ matrix.node-version }}.log 2>&1 &
python .github/workflows/fake_orion_server.py > dashboard/src/fake-orion-backend-${{ matrix.node-version }}.log 2>&1 &
cd dashboard/src/
- name: Install dependencies
Expand All @@ -73,13 +73,22 @@ jobs:
- name: Serve build
run: ./node_modules/.bin/serve -l 3000 build/ &

- name: Run Playwright tests
- name: Run Playwright tests (1)
run: yarn playwright test --project=chromium --reporter=line

- name: Run Playwright tests (2)
run: yarn playwright test --project=chromium --reporter=line

- name: Run Playwright tests (3)
run: yarn playwright test --project=chromium --reporter=line

- name: Run Playwright tests (4)
run: yarn playwright test --project=chromium --reporter=line

# Upload orion backend log.
- name: Get Orion backend log
if: always()
uses: actions/upload-artifact@v3
with:
name: orion-backend-log-artifact-${{ matrix.node-version }}
path: dashboard/src/orion-backend-${{ matrix.node-version }}.log
name: fake-orion-backend-log-artifact-${{ matrix.node-version }}
path: dashboard/src/fake-orion-backend-${{ matrix.node-version }}.log
Loading

0 comments on commit 2944875

Please sign in to comment.