Skip to content

Commit 80bf28d

Browse files
author
Rob Tjalma
authored
Merge pull request #41 from com-pas/adding-auto-alignment
Adding Auto Alignment + Latest version OpenSCD (v0.8.0)
2 parents a51bba9 + 181635d commit 80bf28d

10 files changed

+84
-20
lines changed

.github/workflows/run-integration-tests-basex.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
push:
99
branches:
1010
- '**'
11-
- '!main'
1211
pull_request:
1312
branches:
1413
- 'main'

.github/workflows/run-integration-tests-postgresql.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
push:
99
branches:
1010
- '**'
11-
- '!main'
1211
pull_request:
1312
branches:
1413
- 'main'

compas/docker-compose-basex.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ services:
3939
scl-data-service:
4040
labels:
4141
compas: true
42-
image: "lfenergy/compas-scl-data-service:0.9.0-basex"
42+
image: "lfenergy/compas-scl-data-service:0.9.1-basex"
4343
environment:
4444
- BASEX_HOST=basex
4545
- BASEX_PORT=1984
@@ -67,7 +67,7 @@ services:
6767
cim-mapping:
6868
labels:
6969
compas: true
70-
image: "lfenergy/compas-cim-mapping:0.7.6"
70+
image: "lfenergy/compas-cim-mapping:0.7.7"
7171
environment:
7272
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
7373
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
@@ -86,10 +86,32 @@ services:
8686
depends_on:
8787
- keycloak
8888

89+
scl-auto-alignment:
90+
labels:
91+
compas: true
92+
image: "lfenergy/compas-scl-auto-alignment:0.0.2"
93+
environment:
94+
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
95+
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
96+
- JWT_VERIFY_CLIENT_ID=scl-auto-alignment
97+
- JWT_GROUPS_PATH=resource_access/scl-auto-alignment/roles
98+
- USERINFO_WHO_CLAIMNAME=name
99+
deploy:
100+
restart_policy:
101+
condition: on-failure
102+
max_attempts: 3
103+
healthcheck:
104+
test: ["CMD", "curl", "-f", "http://localhost:8080/compas-scl-auto-alignment/q/health/ready"]
105+
interval: 15s
106+
timeout: 10s
107+
retries: 5
108+
depends_on:
109+
- keycloak
110+
89111
open-scd:
90112
labels:
91113
compas: true
92-
image: "lfenergy/compas-open-scd:v0.7.1-compas-4"
114+
image: "lfenergy/compas-open-scd:v0.8.0-compas-1"
93115
healthcheck:
94116
test: ["CMD", "curl", "-f", "http://localhost/"]
95117
interval: 30s

compas/docker-compose-postgresql.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ services:
4646
scl-data-service:
4747
labels:
4848
compas: true
49-
image: "lfenergy/compas-scl-data-service:0.9.0-postgresql"
49+
image: "lfenergy/compas-scl-data-service:0.9.1-postgresql"
5050
environment:
5151
- POSTGRESQL_HOST=postgresql
5252
- POSTGRESQL_DB=compas
@@ -74,7 +74,7 @@ services:
7474
cim-mapping:
7575
labels:
7676
compas: true
77-
image: "lfenergy/compas-cim-mapping:0.7.6"
77+
image: "lfenergy/compas-cim-mapping:0.7.7"
7878
environment:
7979
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
8080
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
@@ -93,10 +93,32 @@ services:
9393
depends_on:
9494
- keycloak
9595

96+
scl-auto-alignment:
97+
labels:
98+
compas: true
99+
image: "lfenergy/compas-scl-auto-alignment:0.0.2"
100+
environment:
101+
- JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs
102+
- JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas
103+
- JWT_VERIFY_CLIENT_ID=scl-auto-alignment
104+
- JWT_GROUPS_PATH=resource_access/scl-auto-alignment/roles
105+
- USERINFO_WHO_CLAIMNAME=name
106+
deploy:
107+
restart_policy:
108+
condition: on-failure
109+
max_attempts: 3
110+
healthcheck:
111+
test: ["CMD", "curl", "-f", "http://localhost:8080/compas-scl-auto-alignment/q/health/ready"]
112+
interval: 15s
113+
timeout: 10s
114+
retries: 5
115+
depends_on:
116+
- keycloak
117+
96118
open-scd:
97119
labels:
98120
compas: true
99-
image: "lfenergy/compas-open-scd:v0.7.1-compas-4"
121+
image: "lfenergy/compas-open-scd:v0.8.0-compas-1"
100122
healthcheck:
101123
test: ["CMD", "curl", "-f", "http://localhost/"]
102124
interval: 30s

compas/reverse-proxy/nginx.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ http {
106106
proxy_redirect off;
107107
}
108108

109+
# Forwarding to the SCL Auto Alignment Service container.
110+
location /compas-scl-auto-alignment/ {
111+
include /etc/nginx/include/authenticate.include;
112+
113+
proxy_set_header X-Real-IP $remote_addr;
114+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
115+
proxy_set_header X-Forwarded-Proto $scheme;
116+
proxy_set_header X-Forwarded-Port $server_port;
117+
proxy_set_header Authorization "Bearer ${access_token}";
118+
119+
# Added Header back to browser to get JWT Content for Debugging, should not do this in production.
120+
add_header X-Debug-Bearer "Bearer ${access_token}" always;
121+
122+
proxy_pass http://scl-auto-alignment:8080/compas-scl-auto-alignment/;
123+
124+
proxy_set_header Host $http_host;
125+
proxy_cache_bypass $http_upgrade;
126+
proxy_redirect off;
127+
}
128+
109129
# redirect server error pages to the static page /40x.html
110130
error_page 404 /404.html;
111131
location = /40x.html {

integration-testing/TestSuite001-basic-compas.robot

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TestCase001-01
1919
Open local file ${sclname} ${scltype}
2020

2121
Select Tab Substation
22-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
22+
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")
2323

2424
TestCase001-02
2525
[Documentation] Open project from Local File and Add to CoMPAS
@@ -33,10 +33,10 @@ TestCase001-02
3333
Set Test Variable ${scltype} CID
3434

3535
Open Menu Save project
36-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
36+
Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0
3737

3838
Select Tab Substation
39-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
39+
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")
4040

4141
TestCase001-03
4242
[Documentation] Open project from CoMPAS
@@ -51,7 +51,7 @@ TestCase001-03
5151
Set Test Variable ${scltype} CID
5252

5353
Open Menu Save project
54-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
54+
Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0
5555

5656
Close OpenSCD
5757
Open OpenSCD and Login
@@ -60,7 +60,7 @@ TestCase001-03
6060
Open from CoMPAS ${sclname} ${scltype} 1.0.0
6161

6262
Select Tab Substation
63-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
63+
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")
6464

6565
TestCase001-04
6666
[Documentation] Open project from CoMPAS and Save to Local File
@@ -75,7 +75,7 @@ TestCase001-04
7575
Set Test Variable ${scltype} CID
7676

7777
Open Menu Save project
78-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
78+
Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0
7979

8080
Open Menu Save project
8181
Save to local file ${sclname} ${scltype}

integration-testing/TestSuite002-versions-compas.robot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Initialize Versions
3434
Set Test Variable ${scltype} CID
3535

3636
Open Menu Save project
37-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
37+
Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0
3838

3939
Select Tab CoMPAS Versions
4040
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
@@ -48,9 +48,9 @@ Initialize Versions
4848
Delete first substation
4949
Select Tab Substation
5050
# Got to the Substation tab and remove the first substation (Sub1), next the first substation should be Sub2.
51-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
51+
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")
5252
Click ${substation-editor-selector} > abbr[title="Remove"] > mwc-icon-button[icon="delete"]
53-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub2")
53+
Get Text ${substation-editor-selector} section > h1:has-text("Sub2")
5454

5555

5656
*** Test Cases ***

integration-testing/TestSuite003-cim-mapping.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ TestCase003-01
2828
Open Project from CIM ${sclname} ${scltype}
2929

3030
Select Tab Substation
31-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
31+
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")

integration-testing/include/general-compas.robot

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ Open from CoMPAS
2222
Close Menu
2323

2424
Add to CoMPAS
25-
[Arguments] ${name} ${type} ${expectedVersion}
25+
[Arguments] ${initialValue} ${name} ${type} ${expectedVersion}
26+
# Make sure the initial value is entered. so we can continue.
27+
Get Text ${dialog-selector} compas-save mwc-textfield#name input == ${initialValue}
2628
Fill Text ${dialog-selector} compas-save mwc-textfield#name input ${name}-${current-date}
2729
Click ${dialog-selector} compas-save compas-scltype-radiogroup mwc-list > mwc-radio-list-item[value="${type.upper()}"]
2830
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button

integration-testing/include/general-openscd.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Resource ./general-config.robot
1010
# Variables of Selectors commonly used.
1111
${menu-selector} mwc-drawer[id="menu"]
1212
${dialog-selector} wizard-dialog
13-
${substation-editor-selector} substation-editor:first-child > editor-container
13+
${substation-editor-selector} substation-editor:first-child > action-pane
1414

1515
*** Keywords ***
1616
Initialize and Start OpenSCD

0 commit comments

Comments
 (0)