From b205f20ffe097dd96782fb4e4c1b7f29ae545d56 Mon Sep 17 00:00:00 2001 From: Davide Principi Date: Thu, 14 Nov 2024 09:21:55 +0100 Subject: [PATCH] Fix Renovate and module tests configuration --- renovate.json | 23 ++++------------------- test-module.sh | 47 +++++++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/renovate.json b/renovate.json index e4addf0..9e80693 100644 --- a/renovate.json +++ b/renovate.json @@ -1,21 +1,6 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base" - ], - "ignorePaths": [ - "**/ui/**" - ], - "regexManagers": [ - { - "customType": "regex", - "fileMatch": [ - "build-images.sh" - ], - "matchStrings": [ - "\\bdocker\\.io/(?.+):(?[-0-9\\.a-z]+)" - ], - "datasourceTemplate": "docker" - } - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>NethServer/.github:ns8" + ] } diff --git a/test-module.sh b/test-module.sh index ed9df60..9a443f3 100755 --- a/test-module.sh +++ b/test-module.sh @@ -1,30 +1,37 @@ #!/bin/bash +set -e + LEADER_NODE=$1 +IMAGE_URL=$2 +shift 2 SSH_KEYFILE=${SSH_KEYFILE:-$HOME/.ssh/id_rsa} -ssh_key="$(cat $SSH_KEYFILE)" +ssh_key="$(< $SSH_KEYFILE)" + +cleanup() { + set +e + podman cp rf-core-runner:/home/pwuser/outputs tests/ + podman stop rf-core-runner + podman rm rf-core-runner +} +trap cleanup EXIT podman run -i \ - --volume=site-packages:/home/pwuser/.local/lib/python3.8/site-packages:Z \ + --network=host \ -v .:/home/pwuser/ns8-module:z \ - --name rf-core-runner ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:v10.0.3 \ + --volume=site-packages:/home/pwuser/.local/lib/python3.12/site-packages:z \ + --name rf-core-runner ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:18.9.1 \ bash -l -s < /home/pwuser/ns8-key - set -x - pip install -r /home/pwuser/ns8-module/tests/pythonreq.txt - mkdir ~/outputs - cd /home/pwuser/ns8-module - robot -v NODE_ADDR:${LEADER_NODE} \ - -v SSH_KEYFILE:/home/pwuser/ns8-key \ - -d ~/outputs /home/pwuser/ns8-module/tests/ +set -e +echo "$ssh_key" > /home/pwuser/ns8-key +pip install -q -r /home/pwuser/ns8-module/tests/pythonreq.txt +mkdir ~/outputs +cd /home/pwuser/ns8-module +exec robot -v NODE_ADDR:${LEADER_NODE} \ + -v IMAGE_URL:${IMAGE_URL} \ + -v SSH_KEYFILE:/home/pwuser/ns8-key \ + --name ldapproxy \ + --skiponfailure unstable \ + -d ~/outputs ${@} /home/pwuser/ns8-module/tests/ EOF - -tests_res=$? - -podman cp rf-core-runner:/home/pwuser/outputs tests/ -podman stop rf-core-runner -podman rm rf-core-runner - -exit ${tests_res}