raportointi muutoksia
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 16s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m15s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m18s
CI Feature / Report Summary (push) Successful in 3s

This commit is contained in:
moilanik
2026-06-28 09:22:30 +03:00
parent ae2be1ca35
commit beef556556
3 changed files with 19 additions and 6 deletions
+4 -5
View File
@@ -81,11 +81,10 @@ generate_index() {
} > "$REPORT_DIR/index.html" } > "$REPORT_DIR/index.html"
} }
STAGED="reports/${SHA8}/${SUITE}" mkdir -p "$SUITE"
mkdir -p "$STAGED"
if [ "$TOTAL" -eq 1 ]; then if [ "$TOTAL" -eq 1 ]; then
cp -a "$REPORT_DIR/." "$STAGED/" cp -a "$REPORT_DIR/." "$SUITE/"
sh .ci/scripts/publish-git-pages.sh "$SUITE" sh .ci/scripts/publish-git-pages.sh "$SUITE"
first_entry=$(echo "$ENTRIES" | head -1) 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" sh .ci/scripts/report-status.sh "$STATUS" "$DESCRIPTION" "$CONTEXT" "" "$URL"
else else
generate_index generate_index
cp -a "$REPORT_DIR/." "$STAGED/" cp -a "$REPORT_DIR/." "$SUITE/"
sh .ci/scripts/publish-git-pages.sh "$SUITE" sh .ci/scripts/publish-git-pages.sh "$SUITE"
sh .ci/scripts/report-status.sh "$STATUS" "$DESCRIPTION" "$CONTEXT" "$SUITE" sh .ci/scripts/report-status.sh "$STATUS" "$DESCRIPTION" "$CONTEXT" "$SUITE"
fi 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; } [ -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) WORK=$(mktemp -d)
TAR=$(mktemp) TAR=$(mktemp)
trap 'rm -rf "$WORK" "$TAR"' EXIT trap 'rm -rf "$WORK" "$TAR"' EXIT
+9 -1
View File
@@ -15,7 +15,7 @@ setup() {
teardown() { teardown() {
mock_stop mock_stop
rm -rf "unit-tests" "sub" rm -rf "unit-tests" "sub" "empty-suite"
} }
@test "missing suite_path argument → exit 1" { @test "missing suite_path argument → exit 1" {
@@ -58,6 +58,14 @@ teardown() {
[[ "$output" == *"not a directory"* ]] [[ "$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" { @test "valid publish returns report base URL" {
mock_set_sequence '[ mock_set_sequence '[
{"code":200,"body":"published"} {"code":200,"body":"published"}