From 5a42e9779a4ed38c1a07b15e673a337816786371 Mon Sep 17 00:00:00 2001 From: Daniel Biehl Date: Sat, 10 Oct 2026 01:50:28 +0200 Subject: [PATCH 1/4] ci: test and build the packages The test job runs the unit tests, the static analysis and the acceptance tests under Xvfb, with the Browser library built from the fork with the adoptContext hook. The build job runs after it and attaches the wheels and sdists to the run. --- .github/workflows/ci.yml | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fcaaa33 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,100 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 45 + defaults: + run: + working-directory: robotframework-electron-vscode + steps: + - name: Check out the repository + uses: actions/checkout@v7 + with: + path: robotframework-electron-vscode + + # Until the adoptContext hook is in a Browser release, the workspace takes + # robotframework-browser from a clone next to the repository. + - name: Check out the Browser library with the adoptContext hook + uses: actions/checkout@v7 + with: + repository: d-biehl/robotframework-browser + ref: adopt-context-hook + path: robotframework-browser + + - uses: actions/setup-node@v7 + with: + node-version: 24 + + - uses: astral-sh/setup-uv@v10 + + - name: Install Xvfb and Openbox + run: sudo apt-get update && sudo apt-get install -y xvfb openbox + + # Ubuntu restricts unprivileged user namespaces, which the Chromium sandbox + # of Electron and VS Code needs. + - name: Allow the Chromium sandbox + run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + + - name: Build the Browser library + working-directory: robotframework-browser + run: | + uv venv .venv + uv pip install --python .venv/bin/python pip -r Browser/dev-requirements.txt + . .venv/bin/activate + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 inv build + PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install --with-deps chromium + + # Not --locked: the lock file records the Browser clone's dependencies, + # which change with the branch. + - name: Install the workspace + run: uv sync + + - name: Unit tests + run: uv run pytest + + - name: Static analysis + run: uv run robotcode -r . analyze code + + - name: Acceptance tests + run: uv run robotcode -r . -p xvfb robot + + - name: Upload the test results + if: always() + uses: actions/upload-artifact@v7 + with: + name: test-results + path: robotframework-electron-vscode/results/ + if-no-files-found: ignore + + build: + needs: test + runs-on: ubuntu-latest + steps: + - name: Check out the repository + uses: actions/checkout@v7 + + - uses: astral-sh/setup-uv@v10 + + - name: Build the packages + run: uv build --all-packages -o dist + + - name: Upload the packages + uses: actions/upload-artifact@v7 + with: + name: packages + path: dist/ + if-no-files-found: error From d70fda389f44c32f9cc48e29be026314100c16e6 Mon Sep 17 00:00:00 2001 From: Daniel Biehl Date: Sat, 10 Oct 2026 01:51:13 +0200 Subject: [PATCH 2/4] ci: pin setup-uv to a full version setup-uv publishes no moving major tags. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcaaa33..179b33c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: with: node-version: 24 - - uses: astral-sh/setup-uv@v10 + - uses: astral-sh/setup-uv@v10.3.0 - name: Install Xvfb and Openbox run: sudo apt-get update && sudo apt-get install -y xvfb openbox @@ -87,7 +87,7 @@ jobs: - name: Check out the repository uses: actions/checkout@v7 - - uses: astral-sh/setup-uv@v10 + - uses: astral-sh/setup-uv@v10.3.0 - name: Build the packages run: uv build --all-packages -o dist From 7d3f97424bc87111b675f1be382271086eb95eed Mon Sep 17 00:00:00 2001 From: Daniel Biehl Date: Sat, 10 Oct 2026 01:57:21 +0200 Subject: [PATCH 3/4] test(vscode): run the development extension's command from a fresh palette On a slower machine, VS Code registers the commands of the development extension after the palette has opened, and an open palette does not refresh. The tests retry with a fresh palette, as the install test already did. --- packages/vscode/atest/install_extension.robot | 9 --------- packages/vscode/atest/open_vs_code.robot | 12 ++++-------- packages/vscode/atest/resources/vscode.resource | 8 ++++++++ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/vscode/atest/install_extension.robot b/packages/vscode/atest/install_extension.robot index 7fcd118..499c28f 100644 --- a/packages/vscode/atest/install_extension.robot +++ b/packages/vscode/atest/install_extension.robot @@ -30,12 +30,3 @@ Only The Given Instance Gets The Extension ${installed} = List Directories In Directory ${second_instance}/extensions robot.test-extension-* Length Should Be ${installed} 0 - -*** Keywords *** -Run Command From A Fresh Palette - [Arguments] ${title} - Keyboard Key press Escape - Keyboard Key press F1 - Keyboard Input type ${title} - Wait For Elements State .quick-input-list .monaco-list-row[aria-label*="${title}"] visible timeout=2s - Keyboard Key press Enter diff --git a/packages/vscode/atest/open_vs_code.robot b/packages/vscode/atest/open_vs_code.robot index 1762aa3..b1c711f 100644 --- a/packages/vscode/atest/open_vs_code.robot +++ b/packages/vscode/atest/open_vs_code.robot @@ -19,10 +19,8 @@ Local Installation Development Extension Is Active Open Test VS Code extension_development_path=${TEST_EXTENSION} - Keyboard Key press F1 - Keyboard Input type Robot Test: Say Hello - Get Text .quick-input-list .monaco-list-row[aria-label*="Robot Test: Say Hello"] *= Say Hello - Keyboard Key press Enter + # VS Code registers the commands of the development extension shortly after the start, and an open palette does not refresh. + Wait Until Keyword Succeeds 30s 1s Run Command From A Fresh Palette Robot Test: Say Hello Get Text .notifications-toasts .notification-list-item-message == Hello Robot Folder @@ -34,10 +32,8 @@ Video Of The Workbench ... extension_development_path=${TEST_EXTENSION} record_video=${{ {"size": {"width": 1280, "height": 800}} }} Should Start With ${page}[video_path] ${OUTPUT_DIR}${/}browser${/}video${/} Set Viewport Size 1280 800 - Keyboard Key press F1 - Keyboard Input type Robot Test: Say Hello - Wait For Elements State .quick-input-list .monaco-list-row[aria-label*="Robot Test: Say Hello"] visible - Keyboard Key press Enter + # VS Code registers the commands of the development extension shortly after the start, and an open palette does not refresh. + Wait Until Keyword Succeeds 30s 1s Run Command From A Fresh Palette Robot Test: Say Hello Get Text .notifications-toasts .notification-list-item-message == Hello Robot Close VS Code File Should Not Be Empty ${page}[video_path] diff --git a/packages/vscode/atest/resources/vscode.resource b/packages/vscode/atest/resources/vscode.resource index 592192a..eba32b6 100644 --- a/packages/vscode/atest/resources/vscode.resource +++ b/packages/vscode/atest/resources/vscode.resource @@ -25,3 +25,11 @@ VS Code Instance Has Exited [Arguments] ${instance} ${processes} = Count Processes With --user-data-dir=${instance}/user-data Should Be Equal As Integers ${processes} 0 + +Run Command From A Fresh Palette + [Arguments] ${title} + Keyboard Key press Escape + Keyboard Key press F1 + Keyboard Input type ${title} + Wait For Elements State .quick-input-list .monaco-list-row[aria-label*="${title}"] visible timeout=2s + Keyboard Key press Enter From 2db750ef5bffb7575ebc9e7ef428569f4153e44d Mon Sep 17 00:00:00 2001 From: Daniel Biehl Date: Sat, 10 Oct 2026 02:08:00 +0200 Subject: [PATCH 4/4] ci: leave the VS Code caches out of the test results The caches of the VS Code instances made up most of the 95 MB artifact. Their logs and settings stay in it. --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 179b33c..f17e54e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,12 +72,17 @@ jobs: - name: Acceptance tests run: uv run robotcode -r . -p xvfb robot + # Without the caches of the VS Code instances, but with their logs and settings. - name: Upload the test results if: always() uses: actions/upload-artifact@v7 with: name: test-results - path: robotframework-electron-vscode/results/ + path: | + robotframework-electron-vscode/results/ + !robotframework-electron-vscode/results/vscode/*/user-data/Cached*/** + !robotframework-electron-vscode/results/vscode/*/user-data/*Cache/** + !robotframework-electron-vscode/results/vscode/*/user-data/Dictionaries/** if-no-files-found: ignore build: