Skip to content

Commit 32f95fd

Browse files
tortmayrplanger
andauthored
v2.0.0
Co-authored-by: Philip Langer <[email protected]>
1 parent 01fd03d commit 32f95fd

28 files changed

+2690
-2718
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"source.organizeImports": true
1111
},
1212
"eslint.validate": ["javascript", "typescript"],
13-
"prettier.prettierPath": "node_modules/prettier",
1413
"search.exclude": {
1514
"**/node_modules": true,
1615
"**/lib": true

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Eclipse GLSP Playwright Changelog
2+
3+
## [v2.0.0 - 24/10/2023]((https://github.com/eclipse-glsp/glsp-playwright/releases/tag/v2.0.0))
4+
5+
Inception of the GLSP Playwright project.
6+
This project provides a Playwright-based page object framework for testing GLSP diagrams in different tool platform integration scenarios.

Jenkinsfile

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
def kubernetes_config = """
2+
apiVersion: v1
3+
kind: Pod
4+
spec:
5+
containers:
6+
- name: node
7+
image: eclipseglsp/ci:alpine-v5.0
8+
tty: true
9+
resources:
10+
limits:
11+
memory: "2Gi"
12+
cpu: "1"
13+
requests:
14+
memory: "2Gi"
15+
cpu: "1"
16+
command:
17+
- cat
18+
volumeMounts:
19+
- mountPath: "/home/jenkins"
20+
name: "jenkins-home"
21+
readOnly: false
22+
- mountPath: "/.yarn"
23+
name: "yarn-global"
24+
readOnly: false
25+
- mountPath: "/.cache"
26+
name: "playwright-cache"
27+
readOnly: false
28+
volumes:
29+
- name: "jenkins-home"
30+
emptyDir: {}
31+
- name: "yarn-global"
32+
emptyDir: {}
33+
- name: "playwright-cache"
34+
emptyDir: {}
35+
"""
36+
37+
pipeline {
38+
agent {
39+
kubernetes {
40+
label 'glsp-theia-agent-pod'
41+
yaml kubernetes_config
42+
}
43+
}
44+
options {
45+
buildDiscarder logRotator(numToKeepStr: '15')
46+
}
47+
48+
environment {
49+
YARN_CACHE_FOLDER = "${env.WORKSPACE}/yarn-cache"
50+
SPAWN_WRAP_SHIM_ROOT = "${env.WORKSPACE}"
51+
EMAIL_TO= "[email protected]"
52+
}
53+
54+
stages {
55+
stage('Build') {
56+
steps {
57+
timeout(30) {
58+
container('node') {
59+
sh "yarn install --unsafe-perm"
60+
script {
61+
// Fail the step if there are uncommited changes to the yarn.lock file
62+
if (sh(returnStatus: true, script: 'git diff --name-only | grep -q "^yarn.lock"') == 0) {
63+
echo 'The yarn.lock file has uncommited changes!'
64+
error 'The yarn.lock file has uncommited changes!'
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
72+
stage('Codechecks (ESLint)'){
73+
steps {
74+
container('node') {
75+
timeout(30){
76+
sh "yarn lint:ci"
77+
}
78+
}
79+
}
80+
}
81+
82+
stage('Deploy (main only)') {
83+
when {
84+
allOf {
85+
branch 'main'
86+
expression {
87+
/* Only trigger the deployment job if the changeset contains changes in
88+
the `packages` or `examples/workflow-theia` directory */
89+
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep -q "^packages\\|examples/workflow-test"') == 0
90+
}
91+
}
92+
}
93+
steps {
94+
container('node') {
95+
timeout(30) {
96+
withCredentials([string(credentialsId: 'npmjs-token', variable: 'NPM_AUTH_TOKEN')]) {
97+
sh 'printf "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}\n" >> $WORKSPACE/.npmrc'
98+
}
99+
sh 'git config user.email "[email protected]"'
100+
sh 'git config user.name "eclipse-glsp-bot"'
101+
sh 'yarn publish:next'
102+
}
103+
}
104+
}
105+
}
106+
}
107+
108+
post {
109+
success {
110+
// Record & publish ESLint issues
111+
recordIssues enabledForFailure: true, publishAllIssues: true, aggregatingResults: true,
112+
tools: [esLint(pattern: 'node_modules/**/*/eslint.xml')],
113+
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
114+
}
115+
failure {
116+
script {
117+
if (env.BRANCH_NAME == 'main') {
118+
echo "Build result FAILURE: Send email notification to ${EMAIL_TO}"
119+
emailext attachLog: true,
120+
121+
body: 'Job: ${JOB_NAME}<br>Build Number: ${BUILD_NUMBER}<br>Build URL: ${BUILD_URL}',
122+
mimeType: 'text/html', subject: 'Build ${JOB_NAME} (#${BUILD_NUMBER}) FAILURE', to: "${EMAIL_TO}"
123+
}
124+
}
125+
}
126+
unstable {
127+
script {
128+
if (env.BRANCH_NAME == 'main') {
129+
echo "Build result UNSTABLE: Send email notification to ${EMAIL_TO}"
130+
emailext attachLog: true,
131+
132+
body: 'Job: ${JOB_NAME}<br>Build Number: ${BUILD_NUMBER}<br>Build URL: ${BUILD_URL}',
133+
mimeType: 'text/html', subject: 'Build ${JOB_NAME} (#${BUILD_NUMBER}) UNSTABLE', to: "${EMAIL_TO}"
134+
}
135+
}
136+
}
137+
fixed {
138+
script {
139+
if (env.BRANCH_NAME == 'main') {
140+
echo "Build back to normal: Send email notification to ${EMAIL_TO}"
141+
emailext attachLog: false,
142+
143+
body: 'Job: ${JOB_NAME}<br>Build Number: ${BUILD_NUMBER}<br>Build URL: ${BUILD_URL}',
144+
mimeType: 'text/html', subject: 'Build ${JOB_NAME} back to normal (#${BUILD_NUMBER})', to: "${EMAIL_TO}"
145+
}
146+
}
147+
}
148+
}
149+
}

examples/workflow-test/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eclipse-glsp/workflow-test",
3-
"version": "0.1.0",
3+
"version": "2.0.0",
44
"private": true,
55
"description": "Example project for glsp-playwright",
66
"homepage": "https://www.eclipse.org/glsp/",
@@ -35,7 +35,7 @@
3535
"clean": "rimraf lib tsconfig.tsbuildinfo server/*.log",
3636
"lint": "eslint --ext .ts,.tsx ./src ./tests",
3737
"lint:all": "yarn check-types && yarn lint",
38-
"lint:fix": "yarn lint --fix",
38+
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
3939
"prepare": "yarn clean && yarn build && yarn lint && playwright install",
4040
"start:server": "node node_modules/@eclipse-glsp-examples/workflow-server-bundled/wf-glsp-server-node.js",
4141
"test": "playwright test",
@@ -45,9 +45,10 @@
4545
"watch": "tsc -w"
4646
},
4747
"devDependencies": {
48-
"@eclipse-glsp-examples/workflow-server-bundled": "next",
49-
"@eclipse-glsp/glsp-playwright": "0.1.0",
48+
"@eclipse-glsp-examples/workflow-server-bundled": "~2.0.1",
49+
"@eclipse-glsp/glsp-playwright": "~2.0.0",
5050
"@playwright/test": "^1.34.3",
51+
"@theia/playwright": "^1.39.0",
5152
"commander": "^10.0.1",
5253
"dotenv": "^16.0.3",
5354
"mvn-artifact-download": "5.1.0",

examples/workflow-test/src/app/workflow-app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
********************************************************************************/
16-
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
16+
import { GLSPApp } from '@eclipse-glsp/glsp-playwright';
1717
import { WorkflowToolPalette } from '../features/tool-palette/workflow-tool-palette';
1818
import { WorkflowGraph } from '../graph/workflow.graph';
1919

examples/workflow-test/src/features/tool-palette/workflow-tool-palette.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
GLSPToolPaletteOptions,
2020
ToolPaletteContentGroup,
2121
ToolPaletteContentItem
22-
} from '@eclipse-glsp/glsp-playwright/glsp';
22+
} from '@eclipse-glsp/glsp-playwright';
2323

2424
export class WorkflowToolPalette extends GLSPToolPalette {
2525
override readonly content: WorkflowToolPaletteContent;

examples/workflow-test/src/graph/elements/activity-node-fork.po.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
*
1414
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
********************************************************************************/
16-
import { NodeMetadata } from '@eclipse-glsp/glsp-playwright';
17-
import { PNode } from '@eclipse-glsp/glsp-playwright/glsp';
16+
import { NodeMetadata, PNode } from '@eclipse-glsp/glsp-playwright';
1817

1918
@NodeMetadata({
2019
type: 'activityNode:fork'

examples/workflow-test/src/graph/elements/edge.po.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
*
1414
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
********************************************************************************/
16-
import { Mix, useClickableFlow, useRoutingPointCapability } from '@eclipse-glsp/glsp-playwright/extension';
17-
import { EdgeMetadata, PEdge } from '@eclipse-glsp/glsp-playwright/glsp';
16+
import { EdgeMetadata, Mix, PEdge, useClickableFlow, useRoutingPointCapability } from '@eclipse-glsp/glsp-playwright/';
1817

1918
const EdgeMixin = Mix(PEdge).flow(useClickableFlow).capability(useRoutingPointCapability).build();
2019

examples/workflow-test/src/graph/elements/label-heading.po.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
*
1414
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
********************************************************************************/
16-
import { Mix, useClickableFlow, useRenameableFlow } from '@eclipse-glsp/glsp-playwright/extension';
17-
import { ModelElementMetadata, PLabel } from '@eclipse-glsp/glsp-playwright/glsp';
16+
import { Mix, ModelElementMetadata, PLabel, useClickableFlow, useRenameableFlow } from '@eclipse-glsp/glsp-playwright/';
1817

1918
export const LabelHeadingMixin = Mix(PLabel).flow(useClickableFlow).flow(useRenameableFlow).build();
2019

examples/workflow-test/src/graph/elements/task-automated.po.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@
1414
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
********************************************************************************/
1616
import {
17+
ChildrenAccessor,
1718
Mix,
19+
NodeMetadata, PNode, SVGMetadataUtils,
1820
useClickableFlow,
1921
useCommandPaletteCapability,
2022
useDraggableFlow,
2123
useHoverableFlow,
2224
useMarkerCapability,
2325
usePopupCapability,
2426
useResizeHandleCapability
25-
} from '@eclipse-glsp/glsp-playwright/extension';
26-
import { ChildrenAccessor, NodeMetadata, PNode, SVGMetadataUtils } from '@eclipse-glsp/glsp-playwright/glsp';
27+
} from '@eclipse-glsp/glsp-playwright/';
2728
import { LabelHeading } from './label-heading.po';
2829

2930
export const TaskAutomatedMixin = Mix(PNode)

0 commit comments

Comments
 (0)