Use quick install script to test R builds

This commit is contained in:
Greg Lin 2022-08-10 18:53:42 -05:00
commit 83dfc554f2

26
test/test-zypper.sh Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -ex
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# Install quick install script prerequisites
if ! command -v curl > /dev/null 2>&1; then
zypper --non-interactive install curl
fi
# Run the quick install script. Use a locally built file if present, otherwise from the CDN.
tmpdir=$(mktemp -d)
cp -r "${SCRIPT_DIR}/../builder/integration/tmp/${OS_IDENTIFIER}/." "$tmpdir" > /dev/null 2>&1 || true
(cd "$tmpdir" && SCRIPT_ACTION=install R_VERSION="${R_VERSION}" RUN_UNATTENDED=1 "${SCRIPT_DIR}/../install.sh")
# Show RPM info
rpm -qi "R-${R_VERSION}"
"${SCRIPT_DIR}/test-r.sh"
zypper --non-interactive remove "R-${R_VERSION}"
if [ -d "/opt/R/${R_VERSION}" ]; then
echo "Failed to uninstall completely"
exit 1
fi