Skip to content

Commit 0887429

Browse files
authored
add relay backend (#964)
* add relay backend * update relay github workflow * extract shared e2e test helpers to new shared folder and other refactorings and improvements * try fix docker test and make relay tests run sequentially * try fix docker test * try fix docker test
1 parent d23c5e4 commit 0887429

53 files changed

Lines changed: 2276 additions & 91 deletions

Some content is hidden

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

.GITIGNORE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
dist
33
.idea
44
out
5-
auxil
5+
auxil
6+
/meta_configurator/public/test-fixtures/

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ jobs:
6060
uses: actions/upload-artifact@v4
6161
with:
6262
name: playwright-report
63-
path: ${{ github.workspace }}/meta_configurator/playwright-report/
63+
path: ${{ github.workspace }}/meta_configurator/playwright-report/

.github/workflows/relay-tests.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Relay Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- 'relay/**'
7+
- 'meta_configurator/e2e/**'
8+
- 'meta_configurator/src/**'
9+
- 'meta_configurator/package.json'
10+
- 'meta_configurator/package-lock.json'
11+
- 'tests/shared/**'
12+
workflow_dispatch:
13+
14+
jobs:
15+
relay-tests:
16+
name: Relay tests
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Install relay dependencies
26+
working-directory: ./relay
27+
run: pip install -r requirements.txt -r requirements-dev.txt
28+
29+
- name: Run relay Python tests
30+
working-directory: ./relay
31+
run: pytest tests/ -v
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v4
35+
36+
- name: Set up Docker Compose
37+
uses: docker/setup-compose-action@v2
38+
39+
- name: Show Docker tool versions
40+
run: |
41+
docker version
42+
docker buildx version
43+
docker compose version
44+
45+
- name: Run relay Docker smoke tests
46+
run: bash relay/tests/test_docker.sh
47+
48+
- uses: actions/setup-node@v3
49+
with:
50+
node-version: '18'
51+
52+
- name: Cache npm dependencies
53+
uses: actions/cache@v3
54+
with:
55+
path: |
56+
meta_configurator/node_modules
57+
key: ${{ runner.os }}-node-${{ hashFiles('meta_configurator/package-lock.json') }}
58+
restore-keys: |
59+
${{ runner.os }}-node-
60+
61+
- name: Cache Playwright browsers
62+
uses: actions/cache@v3
63+
with:
64+
path: ~/.cache/ms-playwright
65+
key: ${{ runner.os }}-playwright-${{ hashFiles('meta_configurator/package-lock.json') }}
66+
restore-keys: |
67+
${{ runner.os }}-playwright-
68+
69+
- name: Install MetaConfigurator dependencies
70+
working-directory: ./meta_configurator
71+
run: npm ci
72+
73+
- name: Build MetaConfigurator
74+
working-directory: ./meta_configurator
75+
run: npm run build --if-present
76+
77+
- name: Install Playwright browsers
78+
working-directory: ./meta_configurator
79+
run: npx playwright install --with-deps
80+
81+
- name: Start dev server and run relay E2E tests
82+
working-directory: ./meta_configurator
83+
run: npx start-server-and-test dev http://localhost:5173 test:e2e:relay
84+
85+
- name: Upload relay Playwright HTML report
86+
if: always()
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: playwright-report-relay
90+
path: ${{ github.workspace }}/meta_configurator/playwright-report/

documentation_developer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To avoid/fix merge conflicts due to the automated formatting, you can do either:
4444

4545
## Tests
4646

47-
For detailed testing descriptions, see [the testing documentation](TESTING.md)
47+
For detailed testing descriptions, see [the testing documentation](../tests/README.md)
4848

4949
In short, run unit tests and end-to-end tests the following way:
5050

documentation_developer/TESTING.md

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

meta_configurator/e2e/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,29 @@ The individual panels are hidden and de-coupled from each other.
3535
We do not have to test the interaction between, for example, the `textEditor` and the `guiEditor` and any other specific combination of two panels.
3636
Instead, we can test each panel type in isolation, together with the internal state of MetaConfigurator.
3737
To manipulate or access the internal state of MetaConfigurator, the `test` panel can be used, see [utilsTestPanel.ts](utilsTestPanel.ts) for more information.
38+
39+
# Settings Fixtures
40+
41+
The `openApp` helper (in `utils.ts`) accepts an optional settings fixture file name. When provided, MetaConfigurator loads and merges those settings before rendering, which lets a test pre-configure anything that would otherwise require manual UI interaction:
42+
43+
- **Visible panels per mode** — the `panels` key controls which panel types are shown in each editor mode (`dataEditor`, `schemaEditor`, `settings`) and which are hidden from the selector (`hidden`).
44+
This is especially useful for enabling the `test` panel (hidden by default), which exposes internal state for reading and writing in tests.
45+
- **Any other setting** — toolbar title, data format, performance limits, etc.
46+
47+
The fixture file only needs to include the keys you want to override; all other settings retain their defaults (the merge is deep for objects, replacing for arrays).
48+
49+
Example (`test-fixtures/settings_testpanel.json`) enables the `test` panel in schema editor mode:
50+
51+
```json
52+
{
53+
"panels": {
54+
"schemaEditor": [
55+
{ "panelType": "textEditor", "mode": "schemaEditor", "size": 50 },
56+
{ "panelType": "test", "mode": "schemaEditor", "size": 50 }
57+
],
58+
"hidden": ["debug"]
59+
}
60+
}
61+
```
62+
63+
Providing a `schema` fixture alongside the `settings` fixture also skips the initial schema-selection dialog, which is required for any test that needs to interact with the app immediately after loading.

meta_configurator/e2e/changeMode.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from '@playwright/test';
2-
import {forceEditorMode, getCurrentEditorMode, openApp} from "./utils";
2+
import {forceEditorMode, getCurrentEditorMode, openApp} from "../../tests/shared/utils";
33
import {SessionMode} from "../src/store/sessionMode";
44

55

meta_configurator/e2e/csvImport.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {test, expect} from '@playwright/test';
2-
import {openApp} from './utils';
3-
import {tpGetData} from './utilsTestPanel';
2+
import {openApp} from '../../tests/shared/utils';
3+
import {tpGetData} from '../../tests/shared/utilsTestPanel';
44
import {
55
expandImportOptions,
66
openCsvImportDialog,
@@ -9,7 +9,7 @@ import {
99
submitCsvImport,
1010
uploadCsvFile,
1111
uploadCsvFileAndCheckProgress,
12-
} from './utilsCsvImport';
12+
} from '../../tests/shared/utilsCsvImport';
1313
import {SessionMode} from '../src/store/sessionMode';
1414

1515
test('Import CSV as standalone table with default paths', async ({page}) => {

meta_configurator/e2e/openApp.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
getCurrentEditorMode,
66
openApp,
77
openAppWithMode
8-
} from "./utils";
8+
} from "../../tests/shared/utils";
99
import {SessionMode} from "../src/store/sessionMode";
10-
import {tpGetData} from "./utilsTestPanel";
10+
import {tpGetData} from "../../tests/shared/utilsTestPanel";
1111

1212
test('Open the app and check that the initial mode is Data Editor', async ({ page }) => {
1313
// Go to the app
@@ -69,4 +69,4 @@ test('Go through the initial schema selection dialog', async ({ page }) => {
6969

7070
// Click the button with "Example Schema"
7171
await page.getByRole('button', { name: 'Example Schema' }).click()
72-
});
72+
});

meta_configurator/e2e/panelGuiEditor.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { test, expect } from '@playwright/test';
22
import {
33
forceEditorMode,
44
openApp, selectInitialSchemaFromExamples,
5-
} from "./utils";
5+
} from "../../tests/shared/utils";
66
import {
77
addArrayItem, checkPropertyExistence, checkPropertyRequired,
88
checkPropertySchemaViolation,
99
checkStringProperty, editBooleanProperty,
1010
editNumberOrIntProperty,
1111
editStringProperty, expandOrCollapseProperty
12-
} from "./utilsGuiEditor";
12+
} from "../../tests/shared/utilsGuiEditor";
1313
import {SessionMode} from "../src/store/sessionMode";
14-
import {tpForceCurrentSelectedElement, tpForceData, tpGetData} from "./utilsTestPanel";
14+
import {tpForceCurrentSelectedElement, tpForceData, tpGetData} from "../../tests/shared/utilsTestPanel";
1515

1616
test('Edit the feature testing example schema using the GUI Editor, testing basic editing and schema violations', async ({ page }) => {
1717
// Go to the app, pre-loading the test settings

0 commit comments

Comments
 (0)