Skip to content

Commit 73ca787

Browse files
authored
Merge pull request #1542 from plone/coredev-robottests
Add GHA wich runs coredev robottests with built bundle
2 parents 583af70 + 20535dd commit 73ca787

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Robot Tests (Coredev)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
approved:
7+
description: 'Finished review? Run coredev robottests.'
8+
required: true
9+
type: boolean
10+
11+
jobs:
12+
robot-tests:
13+
name: Coredev robot tests
14+
runs-on: ubuntu-latest
15+
env:
16+
PYTHONWARNINGS: ignore
17+
GIT_CLONE_DEPTH: 1
18+
zope_i18n_compile_mo_files: 'true'
19+
ROBOTSUITE_LOGLEVEL: ERROR
20+
ROBOTSUITE_PREFIX: ONLYROBOT
21+
NODE_OPTIONS: "--max_old_space_size=8192"
22+
23+
steps:
24+
- name: locale
25+
# needed for CMFPlone testUnicodeSplitter test on Ubuntu
26+
run: |
27+
sudo locale-gen nl_NL@euro
28+
sudo update-locale
29+
30+
# ── 1. Checkout repositories ─────────────────────────────────────────────
31+
- name: Checkout mockup
32+
uses: actions/checkout@v4
33+
34+
- name: Checkout buildout.coredev
35+
uses: actions/checkout@v4
36+
with:
37+
repository: plone/buildout.coredev
38+
path: tests
39+
40+
# ── 2. Node.js setup ──────────────────────────────────────────────────────
41+
- name: Set up Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: "22"
45+
cache: yarn
46+
47+
- name: Install yarn dependencies
48+
run: yarn install
49+
50+
# ── 3. Python / make install ─────────────────────────────────────────────
51+
- name: Set up Python 3.12
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: "3.12"
55+
cache: pip
56+
cache-dependency-path: tests/requirements.txt
57+
58+
- name: Mark plone.staticresources as source checkout for mxdev
59+
working-directory: tests
60+
run: |
61+
python3 -c "
62+
import configparser
63+
cfg = configparser.ConfigParser()
64+
cfg.read('mxcheckouts.ini')
65+
if not cfg.has_section('plone.staticresources'):
66+
cfg.add_section('plone.staticresources')
67+
cfg.set('plone.staticresources', 'use', 'true')
68+
with open('mxcheckouts.ini', 'w') as f:
69+
cfg.write(f)
70+
"
71+
72+
- name: make install (checks out plone.staticresources via mxdev)
73+
working-directory: tests
74+
run: make install
75+
76+
# ── 2b. Build mockup bundle into tests/src/plone.staticresources ─────────
77+
- name: Build mockup for tests (webpack)
78+
run: yarn build:webpack:tests
79+
80+
# ── 4. Install Playwright / rfbrowser ────────────────────────────────────
81+
- name: make rfbrowser
82+
working-directory: tests
83+
run: make rfbrowser
84+
85+
# ── 5. Coredev robot tests ───────────────────────────────────────────────
86+
- name: Run Coredev robot tests
87+
working-directory: tests
88+
run: TEST_ARGS="--all -t ONLYROBOT" make test
89+
90+
- name: Upload robot test results
91+
if: always()
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: robot-results
95+
path: tests/parts/tests/
96+
if-no-files-found: ignore

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"build:webpack": "NODE_ENV=production webpack --config webpack.config.js",
8888
"build:webpack:dev": "NODE_ENV=development webpack --config webpack.config.js",
8989
"build:webpack:plone": "NODE_ENV=production DEPLOYMENT=plone webpack --config webpack.config.js",
90+
"build:webpack:tests": "NODE_ENV=production DEPLOYMENT=tests webpack --config webpack.config.js",
9091
"build:webpack:docs": "NODE_ENV=production DEPLOYMENT=docs webpack --config webpack.config.js",
9192
"build:webpack:dev:plone": "NODE_ENV=development DEPLOYMENT=plone webpack --config webpack.config.js",
9293
"build:docs": "ELEVENTY_ENV=production npx @11ty/eleventy --pathprefix=mockup",

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ module.exports = () => {
162162
"../plone.staticresources/src/plone/staticresources/static/bundle-plone/"
163163
);
164164
}
165+
if (process.env.DEPLOYMENT === "tests") {
166+
config.output.path = path.resolve(
167+
__dirname,
168+
"./tests/src/plone.staticresources/src/plone/staticresources/static/bundle-plone/"
169+
);
170+
}
165171

166172
//console.log(JSON.stringify(config, null, 4));
167173

0 commit comments

Comments
 (0)