From: Fiete Ostkamp Date: Tue, 17 Feb 2026 10:21:48 +0000 (+0100) Subject: Modernize onboard-db-init-docker image X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=198539d00475b008e4312302e368e6d9255d54d2;p=sdc.git Modernize onboard-db-init-docker image - 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 Change-Id: I8e464c7b5fa3ea2e59ccb1a46a432220978b1ca7 --- diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AttributesPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AttributesPage.java index 47b29b9f23..6461580c30 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AttributesPage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/AttributesPage.java @@ -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) { diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspValidationPage.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspValidationPage.java index 4b34e6804f..109481faef 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspValidationPage.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/pages/VspValidationPage.java @@ -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 getChildElements(WebElement webElement) throws Exception { diff --git a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile index d3a26b1ce1..f73a6e2ae3 100644 --- a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile +++ b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile @@ -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