8000 benchmark: skip (don't fail) needs_repo tests · libgit2/libgit2@e68d0b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e68d0b4

Browse files
committed
benchmark: skip (don't fail) needs_repo tests
If a test needs a repo that isn't provide it, mark it as skipped and avoid failing the execution.
1 parent d4222f8 commit e68d0b4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

tests/benchmarks/benchmark.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,19 @@ for TEST_PATH in "${BENCHMARK_DIR}"/*; do
213213
ERROR_FILE="${OUTPUT_DIR}/${TEST_FILE}.err"
214214

215215
FAILED=
216-
${TEST_PATH} --cli "${TEST_CLI}" --baseline-cli "${BASELINE_CLI}" --json "${JSON_FILE}" ${SHOW_OUTPUT} >"${OUTPUT_FILE}" 2>"${ERROR_FILE}" || FAILED=1
216+
{
217+
${TEST_PATH} --cli "${TEST_CLI}" --baseline-cli "${BASELINE_CLI}" --json "${JSON_FILE}" ${SHOW_OUTPUT} >"${OUTPUT_FILE}" 2>"${ERROR_FILE}";
218+
FAILED=$?
219+
} || true
217220

218-
if [ "${FAILED}" = "1" ]; then
221+
if [ "${FAILED}" = "2" ]; then
222+
if [ "${VERBOSE}" != "1" ]; then
223+
echo "skipped!"
224+
fi
225+
226+
indent < "${ERROR_FILE}"
227+
continue
228+
elif [ "${FAILED}" != "0" ]; then
219229
if [ "${VERBOSE}" != "1" ]; then
220230
echo "failed!"
221231
fi

tests/benchmarks/benchmark_helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,6 @@ needs_repo() {
408408
echo "remote repository ('${REPO_REMOTE_URL}') locally then set," 1>&2
409409
echo "the 'BENCHMARK_${REPO_UPPER}_REPOSITORY' environment variable to the path that" 1>&2
410410
echo "contains the repository locally, then run this benchmark again." 1>&2
411-
exit 1
411+
exit 2
412412
fi
413413
}

0 commit comments

Comments
 (0)
0