Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/regression_reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ jobs:
run_workdir/requirements_coverage.json
run_workdir/monitor.log
run_workdir/failure_analysis.md
run_workdir/cm-status-*.db*
- name: ↟ Upload CLI coverage
uses: actions/upload-artifact@v7
if: success() || failure()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upgrade_reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ jobs:
run_workdir/scheduling.log
run_workdir/errors_all.log
run_workdir/failure_analysis.md
run_workdir/cm-status-*.db*
- name: ↟ Upload CLI coverage
uses: actions/upload-artifact@v7
if: success() || failure()
Expand Down
2 changes: 1 addition & 1 deletion cardano_node_tests/cluster_management/status_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
The current status can be inspected with the stock `sqlite3` CLI. The `overview` view
combines all status records into one human-readable table:

db=/tmp/pytest-of-$USER/pytest-0/status.db
db=/tmp/pytest-of-$USER/pytest-0/cm-status.db
sqlite3 -readonly -header "$db" 'SELECT * FROM overview ORDER BY instance_num, kind'

The underlying tables (`test_running`, `resources`, `flags`) can be queried directly
Expand Down
3 changes: 3 additions & 0 deletions runner/node_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ fi

_last_cleanup

# Copy cluster status databases to workdir
./runner/status_dbs.sh "$ARTIFACTS_DIR" "$WORKDIR" || :

# prepare artifacts for upload in GitHub Actions
if [ -n "${GITHUB_ACTIONS:-}" ]; then
# save testing artifacts
Expand Down
3 changes: 3 additions & 0 deletions runner/regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ fi
# Create results archive
./runner/create_results.sh "$REPORTS_DIR" "$WORKDIR" || :

# Copy cluster status databases to workdir
./runner/status_dbs.sh "$ARTIFACTS_DIR" "$WORKDIR" || :

# Save testing artifacts
./runner/save_artifacts.sh "$ARTIFACTS_DIR" "$WORKDIR" || :

Expand Down
45 changes: 45 additions & 0 deletions runner/status_dbs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash

set -euo pipefail

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <artifacts_dir> <output_dir>" >&2
exit 1
fi

artifacts_dir="$1"
output_dir="$2"

mkdir -p "$output_dir" || { echo "Cannot create $output_dir" >&2; exit 1; }

# The status database was copied from the pytest temp dir to the artifacts dir together
# with the other testing artifacts. Copy the database of each pytest run to the output
# dir. The output databases are numbered in the run order (e.g. one per node upgrade
# step) - the `pytest-N` component of the artifacts subdir names cannot be used directly,
# as the number comes from pytest's numbered basetemp counter that is shared by all
# pytest invocations in a testrun, including those that don't collect artifacts.
# Copy also the WAL sidecar, which is present when database connections were still open
# during artifacts collection - without it the database copy would miss the
# not-yet-checkpointed writes. The `-shm` file is skipped on purpose, it is transient
# and not needed for an offline copy.
found=0
num=0
while read -r db; do
# Skip the unexpanded pattern when the glob didn't match anything
[ -f "$db" ] || continue
num=$((num + 1))
cp "$db" "${output_dir}/cm-status-${num}.db" \
|| { echo "Failed to copy $db" >&2; continue; }
found=1
if [ -e "${db}-wal" ]; then
cp "${db}-wal" "${output_dir}/cm-status-${num}.db-wal" \
|| echo "Failed to copy ${db}-wal" >&2
fi
done < <(printf '%s\n' "$artifacts_dir"/pytest-*/cm-status.db | sort -V)

if [ "$found" -eq 0 ]; then
echo "No status database copied from $artifacts_dir" >&2
if [ -n "${GITHUB_ACTIONS:-}" ]; then
echo "::warning::No cluster status database was copied from the testing artifacts, none uploaded."
fi
fi
Loading