agama/service/run_tests_in_container.sh
Josef Reidinger c3932bc301
Apply suggestions from code review
Co-authored-by: Martin Vidner <mvidner@suse.cz>
2023-10-30 22:13:34 +01:00

18 lines
793 B
Bash

#! /bin/bash
set -ex
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
podman create -ti --rm --entrypoint '["sh", "-c"]' --name agama_ruby_tests -v $SCRIPT_DIR/..:/checkout registry.opensuse.org/yast/head/containers_tumbleweed/yast-ruby sh
podman start agama_ruby_tests
podman exec agama_ruby_tests zypper --non-interactive install yast2-iscsi-client ruby3.2-rubygem-eventmachine
if podman exec --workdir /checkout/service agama_ruby_tests rake test:unit; then
if [ "$KEEP_RUNNING" != "1" ]; then
podman stop agama_ruby_tests
fi
echo "Tests passed"
else
echo "Tests failed"
echo "To get into container use:"; echo " podman attach agama_ruby_tests"
echo " cd /checkout"
echo "To remove container use:"; echo " podman rm agama_ruby_tests"
fi