Files
computer-playbook/scripts/tests/unit/ruby.sh
T
kevinveenbirkenbach 50a3edf3c2 feat(test): report the javascript, php and ruby suites in the CI summary
The step summary renders every junit report under build/test-reports,
so the three suites were absent from it for want of a report file. They
now write one under the same name the python runner derives from
INFINITO_TEST_TYPE.

minitest ships no junit reporter, and a gem for one file would be a
dependency the otherwise stdlib-only suite does not need, so it gets a
small plugin instead. The runners also provision their own toolchain
now that the host-side make prerequisites are gone.
2026-08-22 22:27:12 +02:00

28 lines
804 B
Bash
Executable File

#!/usr/bin/env bash
# shellcheck shell=bash
#
# Runs the Ruby unit suite through minitest, which ships with Ruby itself.
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../../.." && pwd)"
cd "${REPO_ROOT}"
bash scripts/install/ruby.sh
suite="tests/unit/ruby"
mapfile -t tests < <(find "${suite}" -name '*_test.rb' | sort)
if ((${#tests[@]} == 0)); then
printf 'ERROR test-unit-ruby: no Ruby unit tests in %s\n' "${suite}" >&2
exit 1
fi
export INFINITO_JUNIT_REPORT="${REPO_ROOT}/build/test-reports/${INFINITO_TEST_TYPE:?INFINITO_TEST_TYPE must be set}.xml" # nocheck: makefile-supplied
exec ruby -I"${suite}" -r"${REPO_ROOT}/tests/utils/minitest_junit.rb" \
-e 'ARGV.each { |f| require File.expand_path(f) }' "${tests[@]}"