Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated actions and Playwright API usage #13491

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Performance (browser)
uses: GabrielBB/xvfb-action@v1
uses: coactions/setup-xvfb@v1
marcdumais-work marked this conversation as resolved.
Show resolved Hide resolved
with:
run: yarn performance:startup:browser

- name: Performance (Electron)
uses: GabrielBB/xvfb-action@v1
uses: coactions/setup-xvfb@v1
marcdumais-work marked this conversation as resolved.
Show resolved Hide resolved
with:
run: yarn performance:startup:electron
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ATM this test suite does not seem to work - however it's the same on master, so it's not a problem caused by this PR.

I added trace "analyseTrace(): profilePath ..." - it seems that the trace files, that we attempt to parse using JSON.parse(), are binary files not json...

$ yarn -s electron rebuild && cd scripts/performance && node electron-performance.js --name 'Electron Frontend Startup' --folder electron --runs 10
native node modules are already rebuilt for electron
analyseTrace(): profilePath: /home/user/theia/scripts/performance/profiles/electron/1.json
[Performance][Electron Frontend Startup][1] Largest Contentful Paint (LCP) failed to obtain a measurement: Unexpected token o in JSON at position 1
Failed to obtain a measurement. The most likely cause is that the performance trace file was incomplete because the script did not wait long enough for "Largest Contentful Paint (LCP)".
SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at analyzeTrace (/home/user/theia/scripts/performance/common-performance.js:151:26)
    at measure (/home/user/theia/scripts/performance/common-performance.js:86:26)
analyseTrace(): profilePath: /home/user/theia/scripts/performance/profiles/electron/2.json
[Performance][Electron Frontend Startup][2] Largest Contentful Paint (LCP) failed to obtain a measurement: Unexpected token o in JSON at position 1
Failed to obtain a measurement. The most likely cause is that the performance trace file was incomplete because the script did not wait long enough for "Largest Contentful Paint (LCP)".
SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at analyzeTrace (/home/user/theia/scripts/performance/common-performance.js:151:26)
    at measure (/home/user/theia/scripts/performance/common-performance.js:86:26)

[...]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for looking into this!
I get the same error (in this PR and on master). I think this workflow file has not been used for a long time, also I don't see any runs of this workflow on GH. I just updated it to avoid leaving the deprecated action there.


Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,5 @@ jobs:
yarn --cwd examples/playwright build

- name: Test (playwright)
uses: GabrielBB/xvfb-action@v1
with:
run: yarn --cwd examples/playwright ui-tests-ci
shell: bash
run: yarn --cwd examples/playwright ui-tests-ci
5 changes: 2 additions & 3 deletions .github/workflows/production-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ jobs:
yarn --cwd examples/playwright build

- name: Run Smoke Test (examples/playwright/src/tests/theia-app)
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test:playwright theia-app
shell: bash
run: yarn test:playwright theia-app
4 changes: 2 additions & 2 deletions examples/playwright/src/theia-quick-command-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export class TheiaQuickCommandPalette extends TheiaPageObject {
if (!await this.isOpen()) {
this.open();
}
const input = await this.page.waitForSelector(`${this.selector} .monaco-inputbox .input`);
const input = this.page.locator(`${this.selector} .monaco-inputbox .input`);
if (input != null) {
await input.focus();
await input.type(value, { delay: USER_KEY_TYPING_DELAY });
await input.pressSequentially(value, { delay: USER_KEY_TYPING_DELAY });
if (confirm) {
await this.page.keyboard.press('Enter');
}
Expand Down
5 changes: 2 additions & 3 deletions examples/playwright/src/theia-rename-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
// *****************************************************************************

import { TheiaDialog } from './theia-dialog';
import { OSUtil, USER_KEY_TYPING_DELAY } from './util';
import { OSUtil } from './util';

export class TheiaRenameDialog extends TheiaDialog {

async enterNewName(newName: string): Promise<void> {
const inputField = await this.page.waitForSelector(`${this.blockSelector} .theia-input`);
await inputField.press(OSUtil.isMacOS ? 'Meta+a' : 'Control+a');
await inputField.type(newName, { delay: USER_KEY_TYPING_DELAY });
await this.page.waitForTimeout(USER_KEY_TYPING_DELAY);
await inputField.fill(newName);
}

async confirm(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class TheiaTerminal extends TheiaView {
async write(text: string): Promise<void> {
await this.activate();
const input = await this.waitForInputArea();
await input.type(text);
await input.fill(text);
}

async contents(): Promise<string> {
Expand Down
Loading