diff --git a/.github/actions/download-artifact-extract/action.yml b/.github/actions/download-artifact-extract/action.yml index eb064b8a078a6..6a9ec3308511f 100644 --- a/.github/actions/download-artifact-extract/action.yml +++ b/.github/actions/download-artifact-extract/action.yml @@ -29,6 +29,14 @@ inputs: runs: using: "composite" steps: + - name: Download artifact + shell: bash + run: | + echo "::group::๐Ÿ“ฆ Downloading ${{ inputs.artifact-name }}" + echo "Artifact: ${{ inputs.artifact-name }}" + echo "Run ID: ${{ inputs.run-id }}" + echo "::endgroup::" + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: ${{ inputs.artifact-name }} @@ -40,6 +48,7 @@ runs: shell: bash working-directory: ${{ inputs.extract-path }} run: | + echo "::group::๐Ÿ“‚ Extracting ${{ inputs.artifact-name }}" if [[ -f artifacts.tar ]]; then tar -xvf artifacts.tar elif [[ -f *.tar ]]; then @@ -51,9 +60,10 @@ runs: elif [[ -f *.zip ]]; then unzip *.zip else - echo "No archive file found to extract" + echo "โš ๏ธ No archive file found to extract" ls -la fi + echo "::endgroup::" - name: Copy files if specified if: inputs.files-to-copy != '' @@ -65,20 +75,24 @@ runs: shell: bash run: | + echo "::group::๐Ÿ“‹ Copying files from ${{ inputs.artifact-name }}" # Create destination directory mkdir -p "$DESTINATION_PATH" + FILE_COUNT=0 echo "$FILES_TO_COPY" | tr ',' '\n' | while read -r file; do # trim leading and trailing whitespaces file="$(echo "$file" | xargs)" if [[ -n "$file" ]]; then - echo "Copying $file to $DESTINATION_PATH" + echo "โœ“ Copying $(basename "$file") to $DESTINATION_PATH" cp -r "$EXTRACT_PATH/$file" "$DESTINATION_PATH/" + FILE_COUNT=$((FILE_COUNT + 1)) fi done # Cleanup if requested if [[ "$CLEANUP" == "true" ]]; then - echo "Cleaning up downloaded artifacts in $EXTRACT_PATH" + echo "๐Ÿงน Cleaning up temporary files in $EXTRACT_PATH" rm -rf "$EXTRACT_PATH" fi + echo "::endgroup::" diff --git a/.github/actions/zombienet-sdk/action.yml b/.github/actions/zombienet-sdk/action.yml index aea95a4ca3f59..83925553a3f5e 100644 --- a/.github/actions/zombienet-sdk/action.yml +++ b/.github/actions/zombienet-sdk/action.yml @@ -91,27 +91,3 @@ runs: # If we want to get rid of '--no-capture' some day, please use '--test-threads 1' or NEXTEST_TEST_THREADS=1 # Both options cannot coexist for cargo-nextest below v0.9.94 cargo nextest run --archive-file ./artifacts/${PREFIX}-zombienet-tests.tar.zst --no-capture -- ${TEST_FILTER} - - - name: process_logs - if: ${{ ! cancelled() }} - shell: bash - run: | - echo "Processing log files" - echo "::group::Logs" - # do not fail the whole run if this step fails - if ! ./.github/scripts/process-logs-zombienet-sdk.sh ; then - echo "::endgroup::" - echo "::warning ::WARNING: Failed to process logs" - else - echo "::endgroup::" - fi - - - - name: upload_logs - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: ${{ ! cancelled() }} - with: - name: zombienet-logs-${{ inputs.job-name }}-${{ github.sha }} - path: | - /tmp/zombie*/logs/* - diff --git a/.github/actions/zombienet/action.yml b/.github/actions/zombienet/action.yml index 654ee44e9e6be..6e37be32c17ac 100644 --- a/.github/actions/zombienet/action.yml +++ b/.github/actions/zombienet/action.yml @@ -87,26 +87,3 @@ runs: --concurrency=$CONCURRENCY \ --test="$TEST_DEFINITION" fi - - - name: process_logs - if: ${{ ! cancelled() }} - shell: bash - run: | - echo "Processing log files" - echo "::group::Logs" - # do not fail the whole run if this step fails - if ! ./.github/scripts/process-logs-zombienet-sdk.sh ; then - echo "::endgroup::" - echo "::warning ::WARNING: Failed to process logs" - else - echo "::endgroup::" - fi - - - name: upload_logs - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: ${{ ! cancelled() }} - with: - name: zombienet-logs-${{ inputs.job-name }}-${{ github.sha }} - path: | - /tmp/zombie*/logs/* - diff --git a/.github/scripts/process-logs-zombienet-sdk.sh b/.github/scripts/process-logs-zombienet-sdk.sh deleted file mode 100755 index cd6d8cc74118a..0000000000000 --- a/.github/scripts/process-logs-zombienet-sdk.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash - -# This script processes logs produced by nodes spawned using the zombienet-sdk framework. -# The logs are prepared for upload as GitHub artifacts. -# If Loki logging is available, the corresponding log URLs are also printed. -# NOTE: P2838773B5F7DE937 is the loki.cicd until we switch to loki.zombienet -LOKI_URL_FOR_NODE='https://grafana.teleport.parity.io/explore?orgId=1&left=%7B%22datasource%22:%22P2838773B5F7DE937%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22P2838773B5F7DE937%22%7D,%22editorMode%22:%22code%22,%22expr%22:%22%7Bzombie_ns%3D%5C%22{{namespace}}%5C%22,zombie_node%3D%5C%22{{podName}}%5C%22%7D%22,%22queryType%22:%22range%22%7D%5D,%22range%22:%7B%22from%22:%22{{from}}%22,%22to%22:%22{{to}}%22%7D%7D' - -BASE_DIR=$(ls -dt /tmp/zombie-* | head -1) -ZOMBIE_JSON="$BASE_DIR/zombie.json" - -LOKI_DIR_FOR_NATIVE_LOGS="/tmp/zombienet" - -JQ_QUERY_RELAY_V1='.relay[].name' -JQ_QUERY_RELAY_SDK='.relay.nodes[].name' - - -JQ_QUERY_PARA_NODES_V1='.paras[$pid].nodes[].name' -JQ_QUERY_PARA_NODES_SDK='.parachains[$pid][] .collators[].name' - - -if [[ ! -f "$ZOMBIE_JSON" ]]; then - echo "Zombie file $ZOMBIE_JSON not present" - exit 1 -fi - -# Extract namespace (ns in sdk / namespace in v1) -NS=$(jq -r '.ns // .namespace' "$ZOMBIE_JSON") -# test start time in milliseconds -FROM=$(jq -r '.start_time_ts' "$ZOMBIE_JSON") -# current time in milliseconds + 60 secs to allow loki to ingest logs -TO=$(($(date +%s%3N) + 60000)) - -make_url() { - local name="$1" - local to="$2" - local url="${LOKI_URL_FOR_NODE//\{\{namespace\}\}/$NS}" - url="${url//\{\{podName\}\}/$name}" - url="${url//\{\{from\}\}/$FROM}" - url="${url//\{\{to\}\}/$to}" - echo "$url" -} - -# Make sure target directory exists -TARGET_DIR="$BASE_DIR/logs" -mkdir -p "$TARGET_DIR" - -echo "Relay nodes:" - -JQ_QUERY_RELAY=$JQ_QUERY_RELAY_V1 -JQ_QUERY_PARA_NODES=$JQ_QUERY_PARA_NODES_V1 -if [[ $(echo "$NS" | grep -E "zombie-[A-Fa-f0-9]+-") ]]; then - JQ_QUERY_RELAY=$JQ_QUERY_RELAY_SDK - JQ_QUERY_PARA_NODES=$JQ_QUERY_PARA_NODES_SDK -fi; - -jq -r $JQ_QUERY_RELAY "$ZOMBIE_JSON" | while read -r name; do - local_to=$TO - if [[ "$ZOMBIE_PROVIDER" == "k8s" ]]; then - # Fetching logs from k8s - if ! kubectl logs "$name" -c "$name" -n "$NS" > "$TARGET_DIR/$name.log" ; then - echo "::warning ::Failed to fetch logs for $name" - fi - else - # zombienet v1 dump the logs to the `/logs` directory - if [ ! -f "$TARGET_DIR/$name.log" ]; then - # `sdk` use this pattern to store the logs in native provider - cp "$BASE_DIR/$name/$name.log" "$TARGET_DIR/$name.log" - fi - - # send logs to loki - if [ -d "$LOKI_DIR_FOR_NATIVE_LOGS" ]; then - awk -v NS="$NS" -v NAME="$name" '{print NS" "NAME" " $0}' $TARGET_DIR/$name.log >> $LOKI_DIR_FOR_NATIVE_LOGS/to-loki.log - local_to=$(($(date +%s%3N) + 60000)) - fi - fi - echo -e "\t$name: $(make_url "$name" "$local_to")" -done -echo "" - -# Handle parachains grouped by paraId -jq -r '.paras // .parachains | to_entries[] | "\(.key)"' "$ZOMBIE_JSON" | while read -r para_id; do - echo "ParaId: $para_id" - jq -r --arg pid "$para_id" "$JQ_QUERY_PARA_NODES" "$ZOMBIE_JSON" | while read -r name; do - local_to=$TO - if [[ "$ZOMBIE_PROVIDER" == "k8s" ]]; then - # Fetching logs from k8s - if ! kubectl logs "$name" -c "$name" -n "$NS" > "$TARGET_DIR/$name.log" ; then - echo "::warning ::Failed to fetch logs for $name" - fi - else - # zombienet v1 dump the logs to the `/logs` directory - if [ ! -f "$TARGET_DIR/$name.log" ]; then - # `sdk` use this pattern to store the logs in native provider - cp "$BASE_DIR/$name/$name.log" "$TARGET_DIR/$name.log" - fi - - # send logs to loki - if [ -d "$LOKI_DIR_FOR_NATIVE_LOGS" ]; then - awk -v NS="$NS" -v NAME="$name" '{print NS" "NAME" " $0}' $TARGET_DIR/$name.log >> $LOKI_DIR_FOR_NATIVE_LOGS/to-loki.log - local_to=$(($(date +%s%3N) + 60000)) - fi - fi - echo -e "\t$name: $(make_url "$name" "$local_to")" - done - echo "" -done - -# sleep for a minute to give alloy time to forward logs -sleep 60 diff --git a/.github/scripts/process-logs-zombienet.sh b/.github/scripts/process-logs-zombienet.sh new file mode 100755 index 0000000000000..77b4ac202cf92 --- /dev/null +++ b/.github/scripts/process-logs-zombienet.sh @@ -0,0 +1,213 @@ +#!/bin/bash +set -euo pipefail + +# This script processes logs produced by nodes spawned using the zombienet-sdk framework. +# The logs are prepared for upload as GitHub artifacts. +# If Loki logging is available, the corresponding log URLs are also printed. +# NOTE: P2838773B5F7DE937 is the loki.cicd until we switch to loki.zombienet +LOKI_URL_FOR_NODE='https://grafana.teleport.parity.io/explore?orgId=1&left=%7B%22datasource%22:%22P2838773B5F7DE937%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22P2838773B5F7DE937%22%7D,%22editorMode%22:%22code%22,%22expr%22:%22%7Bzombie_ns%3D%5C%22{{namespace}}%5C%22,zombie_node%3D%5C%22{{podName}}%5C%22%7D%22,%22queryType%22:%22range%22%7D%5D,%22range%22:%7B%22from%22:%22{{from}}%22,%22to%22:%22{{to}}%22%7D%7D' + +LOKI_DIR_FOR_NATIVE_LOGS="/tmp/zombienet" + +# JQ queries +JQ_QUERY_RELAY_V1='.relay[].name' +JQ_QUERY_RELAY_SDK='.relay.nodes[].name' + +JQ_QUERY_PARA_NODES_V1='.paras[$pid].nodes[].name' +JQ_QUERY_PARA_NODES_SDK='.parachains[$pid][] .collators[].name' + +# current time in milliseconds + 60 secs to allow loki to ingest logs +TO=$(($(date +%s%3N) + 60000)) + +make_url() { + local name="$1" + local to="$2" + local url="${LOKI_URL_FOR_NODE//\{\{namespace\}\}/$NS}" + url="${url//\{\{podName\}\}/$name}" + url="${url//\{\{from\}\}/$FROM}" + url="${url//\{\{to\}\}/$to}" + echo "$url" +} + +# Since we don't have the zombie.json file, we will make the best-effort to send the logs +process_logs_from_fallback() { + local BASE_DIR="$1" + local TARGET_DIR="$2" + + # Extract namespace from BASE_DIR (e.g., /tmp/zombie-abc123 -> zombie-abc123) + NS=$(basename "$BASE_DIR") + echo "Using fallback mode for namespace: $NS" + + # Use current time as FROM since we don't have zombie.json + FROM=$(($(date +%s%3N) - 600000)) # 10 minutes ago + + # Find all logs with glob patterns + local log_files=() + + # Search for SDK pattern: BASE_DIR//.log + if [[ -d "$BASE_DIR" ]]; then + for node_dir in "$BASE_DIR"/*; do + if [[ -d "$node_dir" && "$node_dir" != "$TARGET_DIR" ]]; then + local node_name=$(basename "$node_dir") + if [[ -f "$node_dir/$node_name.log" ]]; then + log_files+=("$node_dir/$node_name.log") + fi + fi + done + fi + + # Search for v1 pattern: BASE_DIR/logs/.log + if [[ -d "$TARGET_DIR" ]]; then + for log_file in "$TARGET_DIR"/*.log; do + if [[ -f "$log_file" ]]; then + log_files+=("$log_file") + fi + done + fi + + if [[ ${#log_files[@]} -eq 0 ]]; then + echo "::warning ::No log files found in $BASE_DIR using glob patterns" + return 1 + fi + + echo "Found ${#log_files[@]} log file(s) using glob patterns" + echo "Nodes:" + + for log_file in "${log_files[@]}"; do + # Extract node name from log file path + local name=$(basename "$log_file" .log) + local_to=$TO + + # Copy log to target directory if not already there + if [[ "$log_file" != "$TARGET_DIR/$name.log" ]]; then + if ! cp "$log_file" "$TARGET_DIR/$name.log" 2>/dev/null; then + echo "::warning ::Failed to copy log for $name" + continue + fi + fi + + # Send logs to loki + if [[ -d "$LOKI_DIR_FOR_NATIVE_LOGS" ]]; then + if [[ -f "$TARGET_DIR/$name.log" ]]; then + awk -v NS="$NS" -v NAME="$name" '{print NS" "NAME" " $0}' "$TARGET_DIR/$name.log" >> "$LOKI_DIR_FOR_NATIVE_LOGS/to-loki.log" + local_to=$(($(date +%s%3N) + 60000)) + fi + fi + echo -e "\t$name: $(make_url "$name" "$local_to")" + done + echo "" +} + +process_logs_from_zombie_file() { + local BASE_DIR="$1" + local TARGET_DIR="$2" + local ZOMBIE_JSON="$3" + + # Extract namespace (ns in sdk / namespace in v1) + NS=$(jq -r '.ns // .namespace' "$ZOMBIE_JSON") + # test start time in milliseconds + FROM=$(jq -r '.start_time_ts' "$ZOMBIE_JSON") + + echo "Relay nodes:" + + JQ_QUERY_RELAY=$JQ_QUERY_RELAY_V1 + JQ_QUERY_PARA_NODES=$JQ_QUERY_PARA_NODES_V1 + if [[ $(echo "$NS" | grep -E "zombie-[A-Fa-f0-9]+-") ]]; then + JQ_QUERY_RELAY=$JQ_QUERY_RELAY_SDK + JQ_QUERY_PARA_NODES=$JQ_QUERY_PARA_NODES_SDK + fi; + + jq -r $JQ_QUERY_RELAY "$ZOMBIE_JSON" | while read -r name; do + [[ -z "$name" ]] && continue + local_to=$TO + if [[ "${ZOMBIE_PROVIDER:-}" == "k8s" ]]; then + # Fetching logs from k8s + if ! kubectl logs "$name" -c "$name" -n "$NS" > "$TARGET_DIR/$name.log" 2>&1; then + echo "::warning ::Failed to fetch logs for $name" + fi + else + # zombienet v1 dump the logs to the `/logs` directory + if [[ ! -f "$TARGET_DIR/$name.log" ]]; then + # `sdk` use this pattern to store the logs in native provider + if [[ -f "$BASE_DIR/$name/$name.log" ]]; then + cp "$BASE_DIR/$name/$name.log" "$TARGET_DIR/$name.log" + else + echo "::warning ::Log file not found: $BASE_DIR/$name/$name.log" + continue + fi + fi + + # send logs to loki + if [[ -d "$LOKI_DIR_FOR_NATIVE_LOGS" && -f "$TARGET_DIR/$name.log" ]]; then + awk -v NS="$NS" -v NAME="$name" '{print NS" "NAME" " $0}' "$TARGET_DIR/$name.log" >> "$LOKI_DIR_FOR_NATIVE_LOGS/to-loki.log" + local_to=$(($(date +%s%3N) + 60000)) + fi + fi + echo -e "\t$name: $(make_url "$name" "$local_to")" + done + echo "" + + # Handle parachains grouped by paraId + jq -r '.paras // .parachains | to_entries[] | "\(.key)"' "$ZOMBIE_JSON" | while read -r para_id; do + echo "ParaId: $para_id" + jq -r --arg pid "$para_id" "$JQ_QUERY_PARA_NODES" "$ZOMBIE_JSON" | while read -r name; do + [[ -z "$name" ]] && continue + local_to=$TO + if [[ "${ZOMBIE_PROVIDER:-}" == "k8s" ]]; then + # Fetching logs from k8s + if ! kubectl logs "$name" -c "$name" -n "$NS" > "$TARGET_DIR/$name.log" 2>&1; then + echo "::warning ::Failed to fetch logs for $name" + fi + else + # zombienet v1 dump the logs to the `/logs` directory + if [[ ! -f "$TARGET_DIR/$name.log" ]]; then + # `sdk` use this pattern to store the logs in native provider + if [[ -f "$BASE_DIR/$name/$name.log" ]]; then + cp "$BASE_DIR/$name/$name.log" "$TARGET_DIR/$name.log" + else + echo "::warning ::Log file not found: $BASE_DIR/$name/$name.log" + continue + fi + fi + + # send logs to loki + if [[ -d "$LOKI_DIR_FOR_NATIVE_LOGS" && -f "$TARGET_DIR/$name.log" ]]; then + awk -v NS="$NS" -v NAME="$name" '{print NS" "NAME" " $0}' "$TARGET_DIR/$name.log" >> "$LOKI_DIR_FOR_NATIVE_LOGS/to-loki.log" + local_to=$(($(date +%s%3N) + 60000)) + fi + fi + echo -e "\t$name: $(make_url "$name" "$local_to")" + done + echo "" + done +} + +# Main execution - Process all zombie-* directories (supports rstest with multiple tests per job) +BASE_DIRS=$(ls -dt /tmp/zombie-* 2>/dev/null || true) + +if [[ -z "$BASE_DIRS" ]]; then + echo "No zombie directories found in /tmp/zombie-*" + exit 0 +fi + +for BASE_DIR in $BASE_DIRS; do + echo "Processing directory: $BASE_DIR" + + # Make sure target directory exists + TARGET_DIR="$BASE_DIR/logs" + mkdir -p "$TARGET_DIR" + ZOMBIE_JSON="$BASE_DIR/zombie.json" + + if [[ ! -f "$ZOMBIE_JSON" ]]; then + echo "Zombie file $ZOMBIE_JSON not present, calling fallback" + process_logs_from_fallback "$BASE_DIR" "$TARGET_DIR" + else + # we have a zombie.json file, let process it + echo "Processing logs from zombie.json" + process_logs_from_zombie_file "$BASE_DIR" "$TARGET_DIR" "$ZOMBIE_JSON" + fi + echo "" +done + +# sleep for a minute to give alloy time to forward logs +sleep 60 diff --git a/.github/workflows/zombienet-reusable-preflight.yml b/.github/workflows/zombienet-reusable-preflight.yml index 7fa6de32ca7fb..63b1eaf131aad 100644 --- a/.github/workflows/zombienet-reusable-preflight.yml +++ b/.github/workflows/zombienet-reusable-preflight.yml @@ -403,4 +403,3 @@ jobs: # if [[ ${{ github.event_name }} == "merge_group" ]]; then export SHA="${GITHUB_SHA::8}"; fi # POLKADOT_PR_ARTIFACTS_URL=$(curl "https://api.github.com/repos/paritytech/polkadot-sdk/actions/runs/${{steps.wait_build.outputs.BUILD_RUN_ID}}/artifacts?name=build-linux-stable-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" | jq -r ".artifacts[0].archive_download_url") # echo "POLKADOT_PR_ARTIFACTS_URL=${POLKADOT_PR_ARTIFACTS_URL}" >> $GITHUB_OUTPUT - diff --git a/.github/workflows/zombienet_cumulus.yml b/.github/workflows/zombienet_cumulus.yml index 9637da120d886..efd2616d707b7 100644 --- a/.github/workflows/zombienet_cumulus.yml +++ b/.github/workflows/zombienet_cumulus.yml @@ -46,7 +46,7 @@ jobs: zombienet-cumulus-tests: name: ${{ matrix.test.job-name }} runs-on: ${{ matrix.test.runner-type == 'large' && needs.preflight.outputs.ZOMBIENET_SDK_LARGE_RUNNER || needs.preflight.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER }} - timeout-minutes: 60 + timeout-minutes: 70 # 60 for test + 10 for send logs needs: [preflight] if: ${{ (needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot) }} container: @@ -86,6 +86,7 @@ jobs: rm -rf artifacts - name: zombienet_test + timeout-minutes: 60 uses: ./.github/actions/zombienet-sdk with: test-filter: ${{ matrix.test.test-filter }} @@ -94,3 +95,26 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }} ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} + + - name: process_logs + if: ${{ always() }} + shell: bash + run: | + echo "Processing log files" + echo "::group::Logs" + # do not fail the whole run if this step fails + if ! ./.github/scripts/process-logs-zombienet.sh ; then + echo "::endgroup::" + echo "::warning ::WARNING: Failed to process logs" + else + echo "::endgroup::" + fi + + + - name: upload_logs + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: ${{ always() }} + with: + name: zombienet-logs-${{ matrix.test.job-name }}-${{ github.sha }} + path: | + /tmp/zombie*/logs/* diff --git a/.github/workflows/zombienet_parachain-template.yml b/.github/workflows/zombienet_parachain-template.yml index e5f57fa342aa7..8c8217b6a349c 100644 --- a/.github/workflows/zombienet_parachain-template.yml +++ b/.github/workflows/zombienet_parachain-template.yml @@ -41,7 +41,7 @@ jobs: zombienet-parachain-template-tests: name: ${{ matrix.test.job-name }} runs-on: ${{ matrix.test.runner-type == 'large' && needs.preflight.outputs.ZOMBIENET_SDK_LARGE_RUNNER || needs.preflight.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER }} - timeout-minutes: 30 + timeout-minutes: 40 # 30 for test + 10 for send logs needs: [preflight] if: ${{ (needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot) }} container: @@ -63,6 +63,7 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: zombienet_test + timeout-minutes: 30 uses: ./.github/actions/zombienet-sdk with: test-filter: ${{ matrix.test.test-filter }} @@ -71,3 +72,26 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }} ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} + + - name: process_logs + if: ${{ always() }} + shell: bash + run: | + echo "Processing log files" + echo "::group::Logs" + # do not fail the whole run if this step fails + if ! ./.github/scripts/process-logs-zombienet.sh ; then + echo "::endgroup::" + echo "::warning ::WARNING: Failed to process logs" + else + echo "::endgroup::" + fi + + + - name: upload_logs + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: ${{ always() }} + with: + name: zombienet-logs-${{ matrix.test.job-name }}-${{ github.sha }} + path: | + /tmp/zombie*/logs/* diff --git a/.github/workflows/zombienet_polkadot.yml b/.github/workflows/zombienet_polkadot.yml index 05d49a3dfa9ff..27bb39f38f9a5 100644 --- a/.github/workflows/zombienet_polkadot.yml +++ b/.github/workflows/zombienet_polkadot.yml @@ -45,7 +45,7 @@ jobs: zombienet-polkadot-tests: name: ${{ matrix.test.job-name }} runs-on: ${{ matrix.test.runner-type == 'large' && (matrix.test.use-zombienet-sdk && needs.preflight.outputs.ZOMBIENET_SDK_LARGE_RUNNER || needs.preflight.outputs.ZOMBIENET_LARGE_RUNNER) || (matrix.test.use-zombienet-sdk && needs.preflight.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER || needs.preflight.outputs.ZOMBIENET_DEFAULT_RUNNER) }} - timeout-minutes: 60 + timeout-minutes: 70 # 60 for test + 10 for send logs needs: [preflight] if: ${{ (needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_polkadot) }} container: @@ -83,6 +83,7 @@ jobs: - name: zombienet_test (v1) if: ${{ !matrix.test.use-zombienet-sdk }} + timeout-minutes: 60 uses: ./.github/actions/zombienet with: test-definition: ${{ matrix.test.test-definition }} @@ -103,3 +104,26 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }} ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} + + - name: process_logs + if: ${{ always() }} + shell: bash + run: | + echo "Processing log files" + echo "::group::Logs" + # do not fail the whole run if this step fails + if ! ./.github/scripts/process-logs-zombienet.sh ; then + echo "::endgroup::" + echo "::warning ::WARNING: Failed to process logs" + else + echo "::endgroup::" + fi + + + - name: upload_logs + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: ${{ always() }} + with: + name: zombienet-logs-${{ matrix.test.job-name }}-${{ github.sha }} + path: | + /tmp/zombie*/logs/* diff --git a/.github/workflows/zombienet_substrate.yml b/.github/workflows/zombienet_substrate.yml index e28ca88881cdd..ff8c9353dc144 100644 --- a/.github/workflows/zombienet_substrate.yml +++ b/.github/workflows/zombienet_substrate.yml @@ -49,7 +49,7 @@ jobs: zombienet-substrate-tests: name: ${{ matrix.test.job-name }} runs-on: ${{ matrix.test.runner-type == 'large' && (matrix.test.use-zombienet-sdk && needs.preflight.outputs.ZOMBIENET_SDK_LARGE_RUNNER || needs.preflight.outputs.ZOMBIENET_LARGE_RUNNER) || (matrix.test.use-zombienet-sdk && needs.preflight.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER || needs.preflight.outputs.ZOMBIENET_DEFAULT_RUNNER) }} - timeout-minutes: 60 + timeout-minutes: 70 # 60 for test + 10 for send logs needs: [preflight] if: ${{ (needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_polkadot) }} container: @@ -75,6 +75,7 @@ jobs: run: ${{ matrix.test.additional-setup }} - name: zombienet_test (v1) + timeout-minutes: 60 uses: ./.github/actions/zombienet with: test-definition: ${{ matrix.test.test-definition }} @@ -84,3 +85,26 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }} ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} + + - name: process_logs + if: ${{ always() }} + shell: bash + run: | + echo "Processing log files" + echo "::group::Logs" + # do not fail the whole run if this step fails + if ! ./.github/scripts/process-logs-zombienet.sh ; then + echo "::endgroup::" + echo "::warning ::WARNING: Failed to process logs" + else + echo "::endgroup::" + fi + + + - name: upload_logs + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: ${{ always() }} + with: + name: zombienet-logs-${{ matrix.test.job-name }}-${{ github.sha }} + path: | + /tmp/zombie*/logs/*