Skip to content

Commit 237bda5

Browse files
authored
XIVY-18231 add portal start performance test (#974)
1 parent 5fb31d7 commit 237bda5

38 files changed

+214
-104
lines changed

build/performance/Jenkinsfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
pipeline {
2+
agent {
3+
label 'windows-vscode'
4+
}
5+
6+
tools {
7+
jdk 'temurin-jdk-25.0.2.10'
8+
maven '3.9'
9+
}
10+
11+
options {
12+
buildDiscarder(logRotator(numToKeepStr: '60', artifactNumToKeepStr: '2'))
13+
disableConcurrentBuilds()
14+
}
15+
16+
triggers {
17+
cron '@midnight'
18+
}
19+
20+
environment {
21+
CI = 'true'
22+
RUN_STABLE_VERSION = 'true'
23+
}
24+
25+
stages {
26+
stage('Cleanup globalStorage') {
27+
steps {
28+
script {
29+
dir("${env.USERPROFILE}\\AppData\\Roaming\\Code\\User\\globalStorage") {
30+
deleteDir()
31+
}
32+
}
33+
}
34+
}
35+
36+
stage('Build') {
37+
steps {
38+
nodejs(nodeJSInstallationName: '24.11.0') {
39+
bat 'pnpm run update:axonivy:next'
40+
bat 'pnpm install --no-frozen-lockfile'
41+
bat 'pnpm run build:production'
42+
bat 'pnpm run test:playwright:download:vscode'
43+
bat 'git clone https://github.com/axonivy-market/portal.git playwright/tests/workspaces/portalPerformance/portal || exit /b 0'
44+
bat 'git -C playwright/tests/workspaces/portalPerformance/portal checkout project-conversion-lmu'
45+
}
46+
}
47+
}
48+
49+
stage('Playwright Performance Tests') {
50+
steps {
51+
nodejs(nodeJSInstallationName: '24.11.0') {
52+
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
53+
bat 'pnpm run test:playwright:performance'
54+
}
55+
archiveArtifacts artifacts: 'playwright/test-results/**', allowEmptyArchive: true
56+
withChecks('Performance Tests') {
57+
junit testDataPublishers: [[$class: 'StabilityTestDataPublisher']], testResults: 'node_modules/**/report.xml'
58+
}
59+
}
60+
}
61+
}
62+
}
63+
64+
post {
65+
success {
66+
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
67+
cleanWs()
68+
}
69+
}
70+
}
71+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
"sbom": "pnpm dlx @cyclonedx/cdxgen -t pnpm",
2727
"test": "pnpm run -r test",
2828
"test:ci": "pnpm run -r test:ci",
29-
"test:playwright": "pnpm run --filter @axonivy/vscode-designer-playwright ui-tests",
29+
"test:playwright": "pnpm run --filter @axonivy/vscode-designer-playwright test:ui",
3030
"test:playwright:browser": "RUN_IN_BROWSER=true pnpm run test:playwright",
3131
"test:playwright:download:vscode": "pnpm run --filter @axonivy/vscode-designer-playwright download:vscode",
32+
"test:playwright:performance": "pnpm run --filter @axonivy/vscode-designer-playwright test:ui:performance",
3233
"type": "pnpm run -r type",
3334
"update:axonivy:next": "npx --yes npm-check-updates @axonivy* -ws -t semver -u",
3435
"raise:version": "lerna version --allow-peer-dependencies-update --no-git-tag-version --no-push --ignore-scripts --exact --yes",

playwright/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"scripts": {
55
"type": "tsc --noEmit",
66
"download:vscode": "node --experimental-strip-types tests/utils/download-vscode.ts",
7-
"ui-tests": "playwright test"
7+
"test:ui": "playwright test --project=integration",
8+
"test:ui:performance": "playwright test --project=performance"
89
},
910
"devDependencies": {
1011
"@playwright/test": "1.58.2",

playwright/playwright.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ export default defineConfig({
88
screenshot: 'only-on-failure',
99
video: 'retain-on-failure'
1010
},
11-
testDir: './tests',
1211
workers: 1,
1312
timeout: 40_000,
1413
expect: { timeout: 30_000 },
15-
reporter: process.env.CI ? [['junit', { outputFile: 'report.xml' }], ['list']] : 'html'
14+
reporter: process.env.CI ? [['junit', { outputFile: 'report.xml' }], ['list']] : 'html',
15+
projects: [
16+
{ name: 'integration', testDir: './tests/integration' },
17+
{ name: 'performance', testDir: './tests/performance', timeout: 120_000, expect: { timeout: 60_000 } }
18+
]
1619
});

playwright/tests/browser-view.spec.ts renamed to playwright/tests/integration/browser-view.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect, test } from './fixtures/baseTest';
2-
import { BrowserView } from './page-objects/browser-view';
1+
import { expect, test } from '../fixtures/baseTest';
2+
import { BrowserView } from '../page-objects/browser-view';
33

44
test.describe('Browser View', () => {
55
let browserView: BrowserView;

playwright/tests/case-map-editor.spec.ts renamed to playwright/tests/integration/case-map-editor.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from '@playwright/test';
2-
import { test } from './fixtures/baseTest';
3-
import { CaseMapEditor } from './page-objects/case-map-editor';
4-
import { OutputView } from './page-objects/output-view';
2+
import { test } from '../fixtures/baseTest';
3+
import { CaseMapEditor } from '../page-objects/case-map-editor';
4+
import { OutputView } from '../page-objects/output-view';
55

66
test.describe('Case Map Editor', () => {
77
test('Read, write', async ({ page }) => {

playwright/tests/cms-editor.spec.ts renamed to playwright/tests/integration/cms-editor.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { expect } from '@playwright/test';
2-
import { test } from './fixtures/baseTest';
3-
import { CmsEditor } from './page-objects/cms-editor';
4-
import { Editor } from './page-objects/editor';
5-
import { FileExplorer, ProjectExplorerView } from './page-objects/explorer-view';
6-
import { OutputView } from './page-objects/output-view';
2+
import { test } from '../fixtures/baseTest';
3+
import { CmsEditor } from '../page-objects/cms-editor';
4+
import { Editor } from '../page-objects/editor';
5+
import { FileExplorer, ProjectExplorerView } from '../page-objects/explorer-view';
6+
import { OutputView } from '../page-objects/output-view';
77

88
test('Open by command', async ({ page }) => {
99
const editor = new CmsEditor(page);

playwright/tests/create-data-class.spec.ts renamed to playwright/tests/integration/create-data-class.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { expect } from '@playwright/test';
2-
import { test } from './fixtures/baseTest';
3-
import { DataClassEditor } from './page-objects/data-class-editor';
4-
import { Editor } from './page-objects/editor';
5-
import { FileExplorer } from './page-objects/explorer-view';
2+
import { test } from '../fixtures/baseTest';
3+
import { DataClassEditor } from '../page-objects/data-class-editor';
4+
import { Editor } from '../page-objects/editor';
5+
import { FileExplorer } from '../page-objects/explorer-view';
66

77
test.describe('Create Data Class', () => {
88
test('Add new Data Class', async ({ page }) => {

playwright/tests/create-process.spec.ts renamed to playwright/tests/integration/create-process.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from '@playwright/test';
2-
import { test } from './fixtures/baseTest';
3-
import { FileExplorer } from './page-objects/explorer-view';
4-
import { ProcessEditor } from './page-objects/process-editor';
2+
import { test } from '../fixtures/baseTest';
3+
import { FileExplorer } from '../page-objects/explorer-view';
4+
import { ProcessEditor } from '../page-objects/process-editor';
55

66
test.describe('Create Process', () => {
77
let explorer: FileExplorer;

playwright/tests/create-project.spec.ts renamed to playwright/tests/integration/create-project.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import path from 'path';
2-
import { test } from './fixtures/baseTest';
3-
import { FileExplorer } from './page-objects/explorer-view';
4-
import { ProblemsView } from './page-objects/problems-view';
5-
import { ProcessEditor } from './page-objects/process-editor';
6-
import { empty } from './workspaces/workspace';
2+
import { test } from '../fixtures/baseTest';
3+
import { FileExplorer } from '../page-objects/explorer-view';
4+
import { ProblemsView } from '../page-objects/problems-view';
5+
import { ProcessEditor } from '../page-objects/process-editor';
6+
import { empty } from '../workspaces/workspace';
77

88
test.describe('Create Project', () => {
99
test.use({ workspace: empty });

0 commit comments

Comments
 (0)