mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
The Manjaro workspace job failed test-unit-ruby with "cannot load such file -- minitest". Debian vendors minitest in libruby, but Arch ships it as ruby-minitest and Fedora and CentOS Stream as rubygem-minitest, none of which ruby pulls in. ensure_ruby_present now probes `require "minitest"` and installs the distro package when the probe fails, then fails loudly if minitest is still missing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
28 lines
816 B
Bash
Executable File
28 lines
816 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
#
|
|
# Runs the Ruby unit suite through minitest, which scripts/install/ruby.sh provisions.
|
|
|
|
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[@]}"
|