Skip to content

Commit 2944875

Browse files
authored
Mock web api for dashboard tests (#1116)
* 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.
1 parent 083dc38 commit 2944875

3 files changed

Lines changed: 13702 additions & 5 deletions

File tree

.github/workflows/dashboard-src-new-with-playwright.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ jobs:
5151
- name: check ulimit
5252
run: ulimit -a
5353

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

76-
- name: Run Playwright tests
76+
- name: Run Playwright tests (1)
77+
run: yarn playwright test --project=chromium --reporter=line
78+
79+
- name: Run Playwright tests (2)
80+
run: yarn playwright test --project=chromium --reporter=line
81+
82+
- name: Run Playwright tests (3)
83+
run: yarn playwright test --project=chromium --reporter=line
84+
85+
- name: Run Playwright tests (4)
7786
run: yarn playwright test --project=chromium --reporter=line
7887

7988
# Upload orion backend log.
8089
- name: Get Orion backend log
8190
if: always()
8291
uses: actions/upload-artifact@v3
8392
with:
84-
name: orion-backend-log-artifact-${{ matrix.node-version }}
85-
path: dashboard/src/orion-backend-${{ matrix.node-version }}.log
93+
name: fake-orion-backend-log-artifact-${{ matrix.node-version }}
94+
path: dashboard/src/fake-orion-backend-${{ matrix.node-version }}.log

0 commit comments

Comments
 (0)