Modernize onboard-db-init-docker image 23/143323/6 master
authorFiete Ostkamp <fiete.ostkamp@telekom.de>
Tue, 17 Feb 2026 10:21:48 +0000 (11:21 +0100)
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Wed, 11 Mar 2026 10:22:52 +0000 (10:22 +0000)
- use python:3.11-alpine image instead of onap/policy-jdk-alpine:2.4.4
- jdk is not needed in the image since the image is used to run cqlsh
  commands that is installed via python
- this updates the python version from 3.9 to 3.11
- this reduces the image size from 670MB to 75MB
- improve ui tests reliability by increasing a wait timeout
  and catching broader exceptions on the VspValidationPage

Issue-ID: SDC-4784
Signed-off-by: Fiete Ostkamp <fiete.ostkamp@telekom.de>
Change-Id: I8e464c7b5fa3ea2e59ccb1a46a432220978b1ca7

integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AttributesPage.java
integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspValidationPage.java
openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile

index 47b29b9..6461580 100644 (file)
@@ -80,7 +80,7 @@ public class AttributesPage extends ComponentPage {
         }
         waitForElementVisibility(By.xpath(XpathSelector.DELETE_BTN.getXpath(attributeName))).click();
         waitToBeClickable(By.xpath(XpathSelector.DELETE_ATTRIBUTE_CONFIRM_BTN.getXpath())).click();
-        waitForElementInvisibility(By.xpath(XpathSelector.DELETE_BTN.getXpath(attributeName)), 5);
+        waitForElementInvisibility(By.xpath(XpathSelector.DELETE_BTN.getXpath(attributeName)), 10);
     }
 
     public void editAttribute(final AttributeData attributeData) {
index 4b34e68..109481f 100644 (file)
@@ -25,6 +25,8 @@ import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
 import org.openqa.selenium.By;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 
 import java.io.File;
@@ -32,6 +34,8 @@ import java.util.List;
 
 public class VspValidationPage extends GeneralPageElements {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(VspValidationPage.class);
+
     private static final String ATTACHMENT_NAME_TEST_ID = ".//*[@data-test-id='validation-tree-node-name']";
     private static final String VALIDATION_ERROR_COUNT = ".//*[@data-test-id='validation-error-count']";
     private static final String VALIDATION_WARNING_COUNT = ".//*[@data-test-id='validation-warning-count']";
@@ -168,6 +172,7 @@ public class VspValidationPage extends GeneralPageElements {
     public static void navigateToVspAttachmentsValidationPage() {
         GeneralUIUtils.clickOnElementByTestId(SOFTWARE_PRODUCT_ATTACHMENTS);
         GeneralUIUtils.clickOnElementByTestId(ATTACHMENTS_TAB_VALIDATION);
+        GeneralUIUtils.ultimateWait();
     }
 
     private static boolean elementHasWarningCount(WebElement webElement) {
@@ -176,6 +181,9 @@ public class VspValidationPage extends GeneralPageElements {
             return true;
         } catch (NoSuchElementException ex) {
             return false;
+        } catch (Exception ex) {
+            LOGGER.warn("Unexpected exception while checking for warning count", ex);
+            return false;
         }
     }
 
@@ -185,14 +193,24 @@ public class VspValidationPage extends GeneralPageElements {
             return true;
         } catch (NoSuchElementException ex) {
             return false;
+        } catch (Exception ex) {
+            LOGGER.warn("Unexpected exception while checking for error count", ex);
+            return false;
         }
     }
 
     private static boolean hasAttachmentFileExtension(WebElement webElement, String extension) {
-        return webElement
-            .findElement(By.xpath(ATTACHMENT_NAME_TEST_ID))
-            .getText()
-            .endsWith(extension);
+        try {
+            return webElement
+                .findElement(By.xpath(ATTACHMENT_NAME_TEST_ID))
+                .getText()
+                .endsWith(extension);
+        } catch (NoSuchElementException ex) {
+            return false;
+        } catch (Exception ex) {
+            LOGGER.warn("Unexpected exception while checking attachment file extension", ex);
+            return false;
+        }
     }
 
     private static List<WebElement> getChildElements(WebElement webElement) throws Exception {
index d3a26b1..f73a6e2 100644 (file)
@@ -1,23 +1,21 @@
-FROM onap/policy-jdk-alpine:2.4.4
+FROM python:3.11-alpine
+
+RUN addgroup sdc && \
+    adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc
+
+RUN apk add --no-cache wget && \
+    pip install --no-cache-dir cqlsh==6.2.1
 
-USER root
-RUN addgroup sdc
-RUN adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc
 USER sdc
+
 RUN mkdir ~/.cassandra/ && \
-    echo  '[cql]' > ~/.cassandra/cqlshrc  && \
-    echo  'version=3.4.4' >> ~/.cassandra/cqlshrc
-USER root
+    echo '[cql]' > ~/.cassandra/cqlshrc && \
+    echo 'version=3.4.4' >> ~/.cassandra/cqlshrc
 
-RUN set -ex && \
-    for i in 1 2 3 4 5; do apk update && break || sleep 10; done && apk info > /dev/null && \
-    pip3 install --upgrade 'pip<23' 'setuptools<66' wheel && \
-    pip3 install cqlsh==6.1.0 && \
-    command -v cqlsh && \
-    mkdir ~/.cassandra/ && \
-    echo  '[cql]' > ~/.cassandra/cqlshrc  && \
-    echo  'version=3.4.4' >> ~/.cassandra/cqlshrc  && \
-    apk add --no-cache wget
+USER root
+RUN mkdir -p /root/.cassandra/ && \
+    echo '[cql]' > /root/.cassandra/cqlshrc && \
+    echo 'version=3.4.4' >> /root/.cassandra/cqlshrc
 
 USER sdc