Skip to content

Commit

Permalink
Fix Renovate and module tests configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidePrincipi committed Nov 14, 2024
1 parent f1f0282 commit b205f20
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 39 deletions.
23 changes: 4 additions & 19 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -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/(?<depName>.+):(?<currentValue>[-0-9\\.a-z]+)"
],
"datasourceTemplate": "docker"
}
]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>NethServer/.github:ns8"
]
}
47 changes: 27 additions & 20 deletions test-module.sh
Original file line number Diff line number Diff line change
@@ -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 <<EOF
set -e
echo "$ssh_key" > /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}

0 comments on commit b205f20

Please sign in to comment.