Feature/yksinkertaistetaan raportointi logiikkaa #22

Merged
niko merged 12 commits from feature/yksinkertaistetaan-raportointi-logiikkaa into main 2026-06-18 12:55:02 +03:00
2 changed files with 21 additions and 0 deletions
Showing only changes of commit 36b8af6cf3 - Show all commits
+8
View File
@@ -7,11 +7,19 @@ REPORT_DIR="${1:-}"
COVERAGE_DIR="$REPORT_DIR/coverage" COVERAGE_DIR="$REPORT_DIR/coverage"
echo "DEBUG[bats-coverage]: CWD=$(pwd)" >&2
echo "DEBUG[bats-coverage]: coverage dir exists? $([ -d coverage ] && echo YES || echo NO)" >&2
if [ -d coverage ]; then if [ -d coverage ]; then
echo "DEBUG[bats-coverage]: files in coverage/: $(ls coverage/ 2>/dev/null | wc -l)" >&2
echo "DEBUG[bats-coverage]: coverage/index.html exists? $([ -f coverage/index.html ] && echo YES || echo NO)" >&2
mkdir -p "$COVERAGE_DIR" mkdir -p "$COVERAGE_DIR"
cp -a coverage/. "$COVERAGE_DIR/" cp -a coverage/. "$COVERAGE_DIR/"
echo "DEBUG[bats-coverage]: copied to $COVERAGE_DIR" >&2
fi fi
echo "DEBUG[bats-coverage]: target $COVERAGE_DIR/index.html exists? $([ -f "$COVERAGE_DIR/index.html" ] && echo YES || echo NO)" >&2
if [ -d "$COVERAGE_DIR" ] && [ ! -f "$COVERAGE_DIR/index.html" ]; then if [ -d "$COVERAGE_DIR" ] && [ ! -f "$COVERAGE_DIR/index.html" ]; then
SHA8="${GITHUB_SHA:0:8}" SHA8="${GITHUB_SHA:0:8}"
{ {
+13
View File
@@ -28,6 +28,19 @@ while IFS= read -r -d '' d; do
[ -f "$d/index.html" ] && SUBDIRS+=("$name") [ -f "$d/index.html" ] && SUBDIRS+=("$name")
done < <(find "$REPORT_DIR" -maxdepth 1 -type d ! -name . -print0 2>/dev/null || true) done < <(find "$REPORT_DIR" -maxdepth 1 -type d ! -name . -print0 2>/dev/null || true)
echo "DEBUG[ci-report]: REPORT_DIR=$REPORT_DIR" >&2
echo "DEBUG[ci-report]: files found (${#FILES[@]}): ${FILES[*]:-}" >&2
echo "DEBUG[ci-report]: subdirs with index.html (${#SUBDIRS[@]}): ${SUBDIRS[*]:-}" >&2
echo "DEBUG[ci-report]: TOTAL=$(( ${#FILES[@]} + ${#SUBDIRS[@]} ))" >&2
echo "DEBUG[ci-report]: ls -la $REPORT_DIR/:" >&2
find "$REPORT_DIR" -maxdepth 2 -not -path '*/\.*' 2>/dev/null | while IFS= read -r p; do
if [ -f "$p" ]; then
echo " FILE $(basename "$p")" >&2
elif [ -d "$p" ] && [ "$p" != "$REPORT_DIR" ]; then
echo " DIR $(basename "$p")/ has-index.html=$([ -f "$p/index.html" ] && echo YES || echo NO)" >&2
fi
done
TOTAL=$(( ${#FILES[@]} + ${#SUBDIRS[@]} )) TOTAL=$(( ${#FILES[@]} + ${#SUBDIRS[@]} ))
if [ "$TOTAL" -eq 0 ]; then if [ "$TOTAL" -eq 0 ]; then