Fix/git pages gitea reports 1 #49

Merged
niko merged 2 commits from fix/git-pages-gitea-reports-1 into main 2026-06-28 09:25:41 +03:00
3 changed files with 19 additions and 6 deletions
Showing only changes of commit beef556556 - Show all commits
+4 -5
View File
@@ -81,11 +81,10 @@ generate_index() {
} > "$REPORT_DIR/index.html"
}
STAGED="reports/${SHA8}/${SUITE}"
mkdir -p "$STAGED"
mkdir -p "$SUITE"
if [ "$TOTAL" -eq 1 ]; then
cp -a "$REPORT_DIR/." "$STAGED/"
cp -a "$REPORT_DIR/." "$SUITE/"
sh .ci/scripts/publish-git-pages.sh "$SUITE"
first_entry=$(echo "$ENTRIES" | head -1)
@@ -102,9 +101,9 @@ if [ "$TOTAL" -eq 1 ]; then
sh .ci/scripts/report-status.sh "$STATUS" "$DESCRIPTION" "$CONTEXT" "" "$URL"
else
generate_index
cp -a "$REPORT_DIR/." "$STAGED/"
cp -a "$REPORT_DIR/." "$SUITE/"
sh .ci/scripts/publish-git-pages.sh "$SUITE"
sh .ci/scripts/report-status.sh "$STATUS" "$DESCRIPTION" "$CONTEXT" "$SUITE"
fi
rm -rf "$STAGED"
rm -rf "$SUITE"
+6
View File
@@ -19,6 +19,12 @@ PAGES_USER="${GIT_PAGES_PUBLISH_USER:-publish}"
[ -d "$SUITE" ] || { echo "ERROR: not a directory: $SUITE" >&2; exit 1; }
EMPTY=1
for _f in "$SUITE"/* "$SUITE"/.*; do
[ -e "$_f" ] && { EMPTY=0; break; }
done
[ "$EMPTY" -eq 0 ] || { echo "ERROR: no files to publish in $SUITE" >&2; exit 1; }
WORK=$(mktemp -d)
TAR=$(mktemp)
trap 'rm -rf "$WORK" "$TAR"' EXIT
+9 -1
View File
@@ -15,7 +15,7 @@ setup() {
teardown() {
mock_stop
rm -rf "unit-tests" "sub"
rm -rf "unit-tests" "sub" "empty-suite"
}
@test "missing suite_path argument → exit 1" {
@@ -58,6 +58,14 @@ teardown() {
[[ "$output" == *"not a directory"* ]]
}
@test "empty directory → exit 1" {
mkdir -p "empty-suite"
run bash scripts/publish-git-pages.sh "empty-suite"
[ "$status" -eq 1 ]
[[ "$output" == *"no files to publish"* ]]
rm -rf "empty-suite"
}
@test "valid publish returns report base URL" {
mock_set_sequence '[
{"code":200,"body":"published"}