feat(sourcetest): add -v flag with verbose manga list output
When -v is passed, test-sources.sh passes it through to go test -v. sourcetest.Run uses testing.Verbose() to print the full manga list from GetPopularManga and GetLatestUpdates, showing title + URL.
This commit is contained in:
+17
-8
@@ -2,9 +2,11 @@
|
||||
# test-sources.sh — run source integration tests inside the compose network.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/test-sources.sh # run all source packages
|
||||
# ./scripts/test-sources.sh ./sources/en/... # run specific packages
|
||||
# ./scripts/test-sources.sh -short # metadata-only, no network calls
|
||||
# ./scripts/test-sources.sh # run all source packages
|
||||
# ./scripts/test-sources.sh ./sources/en/... # run specific packages
|
||||
# ./scripts/test-sources.sh -short # metadata-only, no network calls
|
||||
# ./scripts/test-sources.sh -v # verbose (print manga lists)
|
||||
# ./scripts/test-sources.sh -v ./sources/en/aquamanga/... # verbose for one source
|
||||
#
|
||||
# Environment:
|
||||
# PARALLELISM number of packages to test in parallel (default: 4)
|
||||
@@ -229,12 +231,18 @@ ok "Network $NETWORK exists"
|
||||
# --- resolve packages to test ------------------------------------------------
|
||||
|
||||
SHORT_FLAG=""
|
||||
VERBOSE_FLAG=""
|
||||
FLAGS=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-short) SHORT_FLAG="-short"; FLAGS="$FLAGS -short"; shift ;;
|
||||
-v) VERBOSE_FLAG="-v"; FLAGS="$FLAGS -v"; shift ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
PACKAGES="./sources/en/... ./sources/all/..."
|
||||
elif [ "$1" = "-short" ]; then
|
||||
PACKAGES="./sources/en/... ./sources/all/..."
|
||||
SHORT_FLAG="-short"
|
||||
shift
|
||||
else
|
||||
PACKAGES="$*"
|
||||
fi
|
||||
@@ -243,6 +251,7 @@ info "Packages : $PACKAGES"
|
||||
info "Parallel : $PARALLELISM"
|
||||
info "Timeout : $PKG_TIMEOUT"
|
||||
[ -n "$SHORT_FLAG" ] && info "Mode : short (metadata only)" || info "Mode : full (live network)"
|
||||
[ -n "$VERBOSE_FLAG" ] && info "Verbose : on"
|
||||
|
||||
# --- run tests ---------------------------------------------------------------
|
||||
|
||||
@@ -258,7 +267,7 @@ docker run --rm \
|
||||
-v goyomi_go_build_cache:/root/.cache/go-build \
|
||||
-w /workspace \
|
||||
"$GO_IMAGE" \
|
||||
go test -json -count=1 -p "$PARALLELISM" -timeout "$PKG_TIMEOUT" $SHORT_FLAG $PACKAGES \
|
||||
go test -json -count=1 -p "$PARALLELISM" -timeout "$PKG_TIMEOUT" $FLAGS $PACKAGES \
|
||||
| python3 -u "$PRINTER_PY" "$JSON_LOG"
|
||||
EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
Reference in New Issue
Block a user