add gotestfmt log output to complement script and CI output
Signed-off-by: strawberry <june@girlboss.ceo>
This commit is contained in:
parent
51d29bc1cb
commit
90fee4f50e
3 changed files with 37 additions and 16 deletions
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
|
@ -176,6 +176,13 @@ jobs:
|
||||||
path: complement_test_results.jsonl
|
path: complement_test_results.jsonl
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload Complement logs (gotestfmt)
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: complement_test_logs_gotestfmt.log
|
||||||
|
path: complement_test_logs_gotestfmt.log
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Diff Complement results with checked-in repo results
|
- name: Diff Complement results with checked-in repo results
|
||||||
run: |
|
run: |
|
||||||
diff -u --color=always tests/test_results/complement/test_results.jsonl complement_test_results.jsonl > >(tee -a complement_diff_output.log)
|
diff -u --color=always tests/test_results/complement/test_results.jsonl complement_test_results.jsonl > >(tee -a complement_diff_output.log)
|
||||||
|
@ -186,22 +193,23 @@ jobs:
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
run: |
|
run: |
|
||||||
if [ ${GH_JOB_STATUS} == 'success' ]; then
|
if [ ${GH_JOB_STATUS} == 'success' ]; then
|
||||||
echo '# ✅ completed suwuccessfully' >> $GITHUB_STEP_SUMMARY
|
echo '# ✅ CI completed suwuccessfully' >> $GITHUB_STEP_SUMMARY
|
||||||
else
|
else
|
||||||
echo '# CI failure' >> $GITHUB_STEP_SUMMARY
|
echo '# ❌ CI failed (last 100 lines of output)' >> $GITHUB_STEP_SUMMARY
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
tail -n 40 test_output.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
|
tail -n 100 test_output.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
echo '# Complement diff results' >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo '```diff' >> $GITHUB_STEP_SUMMARY
|
|
||||||
tail -n 100 complement_diff_output.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Run cargo clean test artifacts to free up space
|
echo '# Complement diff results (last 100 lines)' >> $GITHUB_STEP_SUMMARY
|
||||||
run: |
|
echo '```diff' >> $GITHUB_STEP_SUMMARY
|
||||||
cargo clean --profile test
|
tail -n 100 complement_diff_output.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
echo '# Complement gotestfmt logs (last 100 lines)' >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo '```diff' >> $GITHUB_STEP_SUMMARY
|
||||||
|
tail -n 100 complement_test_logs_gotestfmt.log | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
|
|
|
@ -10,15 +10,15 @@ set -euo pipefail
|
||||||
COMPLEMENT_SRC="${COMPLEMENT_SRC:-$1}"
|
COMPLEMENT_SRC="${COMPLEMENT_SRC:-$1}"
|
||||||
|
|
||||||
# A `.jsonl` file to write test logs to
|
# A `.jsonl` file to write test logs to
|
||||||
LOG_FILE="$2"
|
LOG_FILE="${2:-complement_test_logs.jsonl}"
|
||||||
|
|
||||||
# A `.jsonl` file to write test results to
|
# A `.jsonl` file to write test results to
|
||||||
RESULTS_FILE="$3"
|
RESULTS_FILE="${3:-complement_test_results.jsonl}"
|
||||||
|
|
||||||
OCI_IMAGE="complement-conduwuit:main"
|
OCI_IMAGE="complement-conduwuit:main"
|
||||||
|
|
||||||
# Complement tests that are skipped due to flakiness/reliability issues
|
# Complement tests that are skipped due to flakiness/reliability issues or we don't implement such features and won't for a long time
|
||||||
SKIPPED_COMPLEMENT_TESTS='-skip=TestPartialStateJoin.*'
|
#SKIPPED_COMPLEMENT_TESTS='-skip=TestPartialStateJoin.*'
|
||||||
|
|
||||||
# $COMPLEMENT_SRC needs to be a directory to Complement source code
|
# $COMPLEMENT_SRC needs to be a directory to Complement source code
|
||||||
if [ -f "$COMPLEMENT_SRC" ]; then
|
if [ -f "$COMPLEMENT_SRC" ]; then
|
||||||
|
@ -34,6 +34,7 @@ toplevel="$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
pushd "$toplevel" > /dev/null
|
pushd "$toplevel" > /dev/null
|
||||||
|
|
||||||
|
# if using macOS, use linux-complement
|
||||||
#bin/nix-build-and-cache just .#linux-complement
|
#bin/nix-build-and-cache just .#linux-complement
|
||||||
bin/nix-build-and-cache just .#complement
|
bin/nix-build-and-cache just .#complement
|
||||||
|
|
||||||
|
@ -45,7 +46,8 @@ set +o pipefail
|
||||||
env \
|
env \
|
||||||
-C "$COMPLEMENT_SRC" \
|
-C "$COMPLEMENT_SRC" \
|
||||||
COMPLEMENT_BASE_IMAGE="$OCI_IMAGE" \
|
COMPLEMENT_BASE_IMAGE="$OCI_IMAGE" \
|
||||||
go test -tags="conduwuit_blacklist" "$SKIPPED_COMPLEMENT_TESTS" -v -timeout 1h -json ./tests/... | tee "$LOG_FILE"
|
COMPLEMENT_ENABLE_DIRTY_RUNS=1 \ # reuses the same complement container for faster complement, at the possible expense of test environment pollution
|
||||||
|
go test -tags="conduwuit_blacklist" -v -timeout 1h -json ./tests/... | tee "$LOG_FILE"
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Post-process the results into an easy-to-compare format, sorted by Test name for reproducible results
|
# Post-process the results into an easy-to-compare format, sorted by Test name for reproducible results
|
||||||
|
@ -55,3 +57,13 @@ cat "$LOG_FILE" | jq -s -c 'sort_by(.Test)[]' | jq -c '
|
||||||
and .Test != null
|
and .Test != null
|
||||||
) | {Action: .Action, Test: .Test}
|
) | {Action: .Action, Test: .Test}
|
||||||
' > "$RESULTS_FILE"
|
' > "$RESULTS_FILE"
|
||||||
|
|
||||||
|
grep '^{"Time":' "$LOG_FILE" | gotestfmt > "${LOG_FILE}_gotestfmt.log"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo "complement logs saved at $LOG_FILE"
|
||||||
|
echo "complement results saved at $RESULTS_FILE"
|
||||||
|
echo "complement logs in gotestfmt pretty format outputted at ${LOG_FILE}_gotestfmt.log (use an editor/terminal that interprets ANSI colours)"
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
|
|
@ -161,6 +161,7 @@
|
||||||
|
|
||||||
# Needed for our script for Complement
|
# Needed for our script for Complement
|
||||||
jq
|
jq
|
||||||
|
gotestfmt
|
||||||
|
|
||||||
# Needed for finding broken markdown links
|
# Needed for finding broken markdown links
|
||||||
lychee
|
lychee
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue