diff --git a/.github/workflows/run-integration-tests-basex.yml b/.github/workflows/run-integration-tests-basex.yml index 7f22493..caf4c8b 100644 --- a/.github/workflows/run-integration-tests-basex.yml +++ b/.github/workflows/run-integration-tests-basex.yml @@ -8,7 +8,6 @@ on: push: branches: - '**' - - '!main' pull_request: branches: - 'main' diff --git a/.github/workflows/run-integration-tests-postgresql.yml b/.github/workflows/run-integration-tests-postgresql.yml index f2660c4..5bd5264 100644 --- a/.github/workflows/run-integration-tests-postgresql.yml +++ b/.github/workflows/run-integration-tests-postgresql.yml @@ -8,7 +8,6 @@ on: push: branches: - '**' - - '!main' pull_request: branches: - 'main' diff --git a/compas/docker-compose-basex.yml b/compas/docker-compose-basex.yml index 8b56450..ff1b7c8 100644 --- a/compas/docker-compose-basex.yml +++ b/compas/docker-compose-basex.yml @@ -39,7 +39,7 @@ services: scl-data-service: labels: compas: true - image: "lfenergy/compas-scl-data-service:0.9.0-basex" + image: "lfenergy/compas-scl-data-service:0.9.1-basex" environment: - BASEX_HOST=basex - BASEX_PORT=1984 @@ -67,7 +67,7 @@ services: cim-mapping: labels: compas: true - image: "lfenergy/compas-cim-mapping:0.7.6" + image: "lfenergy/compas-cim-mapping:0.7.7" environment: - JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs - JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas @@ -86,10 +86,32 @@ services: depends_on: - keycloak + scl-auto-alignment: + labels: + compas: true + image: "lfenergy/compas-scl-auto-alignment:0.0.2" + environment: + - JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs + - JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas + - JWT_VERIFY_CLIENT_ID=scl-auto-alignment + - JWT_GROUPS_PATH=resource_access/scl-auto-alignment/roles + - USERINFO_WHO_CLAIMNAME=name + deploy: + restart_policy: + condition: on-failure + max_attempts: 3 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/compas-scl-auto-alignment/q/health/ready"] + interval: 15s + timeout: 10s + retries: 5 + depends_on: + - keycloak + open-scd: labels: compas: true - image: "lfenergy/compas-open-scd:v0.7.1-compas-4" + image: "lfenergy/compas-open-scd:v0.8.0-compas-1" healthcheck: test: ["CMD", "curl", "-f", "http://localhost/"] interval: 30s diff --git a/compas/docker-compose-postgresql.yml b/compas/docker-compose-postgresql.yml index bf48233..0032a4e 100644 --- a/compas/docker-compose-postgresql.yml +++ b/compas/docker-compose-postgresql.yml @@ -46,7 +46,7 @@ services: scl-data-service: labels: compas: true - image: "lfenergy/compas-scl-data-service:0.9.0-postgresql" + image: "lfenergy/compas-scl-data-service:0.9.1-postgresql" environment: - POSTGRESQL_HOST=postgresql - POSTGRESQL_DB=compas @@ -74,7 +74,7 @@ services: cim-mapping: labels: compas: true - image: "lfenergy/compas-cim-mapping:0.7.6" + image: "lfenergy/compas-cim-mapping:0.7.7" environment: - JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs - JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas @@ -93,10 +93,32 @@ services: depends_on: - keycloak + scl-auto-alignment: + labels: + compas: true + image: "lfenergy/compas-scl-auto-alignment:0.0.2" + environment: + - JWT_VERIFY_KEY=http://keycloak:8080/auth/realms/compas/protocol/openid-connect/certs + - JWT_VERIFY_ISSUER=http://${COMPAS_HOSTNAME}/auth/realms/compas + - JWT_VERIFY_CLIENT_ID=scl-auto-alignment + - JWT_GROUPS_PATH=resource_access/scl-auto-alignment/roles + - USERINFO_WHO_CLAIMNAME=name + deploy: + restart_policy: + condition: on-failure + max_attempts: 3 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/compas-scl-auto-alignment/q/health/ready"] + interval: 15s + timeout: 10s + retries: 5 + depends_on: + - keycloak + open-scd: labels: compas: true - image: "lfenergy/compas-open-scd:v0.7.1-compas-4" + image: "lfenergy/compas-open-scd:v0.8.0-compas-1" healthcheck: test: ["CMD", "curl", "-f", "http://localhost/"] interval: 30s diff --git a/compas/reverse-proxy/nginx.conf b/compas/reverse-proxy/nginx.conf index 00cbe30..3ef8026 100644 --- a/compas/reverse-proxy/nginx.conf +++ b/compas/reverse-proxy/nginx.conf @@ -106,6 +106,26 @@ http { proxy_redirect off; } + # Forwarding to the SCL Auto Alignment Service container. + location /compas-scl-auto-alignment/ { + include /etc/nginx/include/authenticate.include; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header Authorization "Bearer ${access_token}"; + + # Added Header back to browser to get JWT Content for Debugging, should not do this in production. + add_header X-Debug-Bearer "Bearer ${access_token}" always; + + proxy_pass http://scl-auto-alignment:8080/compas-scl-auto-alignment/; + + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } + # redirect server error pages to the static page /40x.html error_page 404 /404.html; location = /40x.html { diff --git a/integration-testing/TestSuite001-basic-compas.robot b/integration-testing/TestSuite001-basic-compas.robot index 26f3e76..fef90ad 100644 --- a/integration-testing/TestSuite001-basic-compas.robot +++ b/integration-testing/TestSuite001-basic-compas.robot @@ -19,7 +19,7 @@ TestCase001-01 Open local file ${sclname} ${scltype} Select Tab Substation - Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1") + Get Text ${substation-editor-selector} section > h1:has-text("Sub1") TestCase001-02 [Documentation] Open project from Local File and Add to CoMPAS @@ -33,10 +33,10 @@ TestCase001-02 Set Test Variable ${scltype} CID Open Menu Save project - Add to CoMPAS ${sclname} ${scltype} 1.0.0 + Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0 Select Tab Substation - Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1") + Get Text ${substation-editor-selector} section > h1:has-text("Sub1") TestCase001-03 [Documentation] Open project from CoMPAS @@ -51,7 +51,7 @@ TestCase001-03 Set Test Variable ${scltype} CID Open Menu Save project - Add to CoMPAS ${sclname} ${scltype} 1.0.0 + Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0 Close OpenSCD Open OpenSCD and Login @@ -60,7 +60,7 @@ TestCase001-03 Open from CoMPAS ${sclname} ${scltype} 1.0.0 Select Tab Substation - Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1") + Get Text ${substation-editor-selector} section > h1:has-text("Sub1") TestCase001-04 [Documentation] Open project from CoMPAS and Save to Local File @@ -75,7 +75,7 @@ TestCase001-04 Set Test Variable ${scltype} CID Open Menu Save project - Add to CoMPAS ${sclname} ${scltype} 1.0.0 + Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0 Open Menu Save project Save to local file ${sclname} ${scltype} diff --git a/integration-testing/TestSuite002-versions-compas.robot b/integration-testing/TestSuite002-versions-compas.robot index 1a4f22a..66a1396 100644 --- a/integration-testing/TestSuite002-versions-compas.robot +++ b/integration-testing/TestSuite002-versions-compas.robot @@ -34,7 +34,7 @@ Initialize Versions Set Test Variable ${scltype} CID Open Menu Save project - Add to CoMPAS ${sclname} ${scltype} 1.0.0 + Add to CoMPAS MiniGrid.scd ${sclname} ${scltype} 1.0.0 Select Tab CoMPAS Versions Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1 @@ -48,9 +48,9 @@ Initialize Versions Delete first substation Select Tab Substation # Got to the Substation tab and remove the first substation (Sub1), next the first substation should be Sub2. - Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1") + Get Text ${substation-editor-selector} section > h1:has-text("Sub1") Click ${substation-editor-selector} > abbr[title="Remove"] > mwc-icon-button[icon="delete"] - Get Text ${substation-editor-selector} div#header > h1:has-text("Sub2") + Get Text ${substation-editor-selector} section > h1:has-text("Sub2") *** Test Cases *** diff --git a/integration-testing/TestSuite003-cim-mapping.robot b/integration-testing/TestSuite003-cim-mapping.robot index e1b9fcb..1682ad8 100644 --- a/integration-testing/TestSuite003-cim-mapping.robot +++ b/integration-testing/TestSuite003-cim-mapping.robot @@ -28,4 +28,4 @@ TestCase003-01 Open Project from CIM ${sclname} ${scltype} Select Tab Substation - Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1") + Get Text ${substation-editor-selector} section > h1:has-text("Sub1") diff --git a/integration-testing/include/general-compas.robot b/integration-testing/include/general-compas.robot index 4335583..e09fa51 100644 --- a/integration-testing/include/general-compas.robot +++ b/integration-testing/include/general-compas.robot @@ -22,7 +22,9 @@ Open from CoMPAS Close Menu Add to CoMPAS - [Arguments] ${name} ${type} ${expectedVersion} + [Arguments] ${initialValue} ${name} ${type} ${expectedVersion} + # Make sure the initial value is entered. so we can continue. + Get Text ${dialog-selector} compas-save mwc-textfield#name input == ${initialValue} Fill Text ${dialog-selector} compas-save mwc-textfield#name input ${name}-${current-date} Click ${dialog-selector} compas-save compas-scltype-radiogroup mwc-list > mwc-radio-list-item[value="${type.upper()}"] Click ${dialog-selector} mwc-button[slot="primaryAction"] > button diff --git a/integration-testing/include/general-openscd.robot b/integration-testing/include/general-openscd.robot index dd0d8a5..495c58b 100644 --- a/integration-testing/include/general-openscd.robot +++ b/integration-testing/include/general-openscd.robot @@ -10,7 +10,7 @@ Resource ./general-config.robot # Variables of Selectors commonly used. ${menu-selector} mwc-drawer[id="menu"] ${dialog-selector} wizard-dialog -${substation-editor-selector} substation-editor:first-child > editor-container +${substation-editor-selector} substation-editor:first-child > action-pane *** Keywords *** Initialize and Start OpenSCD