Skip to content

Commit

Permalink
add action that sends test summary to step summary (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel authored Jan 17, 2024
1 parent bce4caa commit 952abab
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions chainlink-testing-framework/show-test-summary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: chainlink-testing-framework-show-test-summary
description: Sends test summary to Github Step Summary
inputs:
test_directory:
required: true
description: Directory in which the tests are located
default: ./integration-tests/smoke

runs:
using: composite
steps:
- name: Print failed test summary
shell: bash
if: always()
run: |
inputDir="${{ .inputs.test_directory}}"
cleanTestDir=${inputDir%/}
directory="$clean_test_dir/.test_summary"
files=("$directory"/*)
if [ -d "$directory" ]; then
echo "Test summary folder found"
if [ ${#files[@]} -gt 0 ]; then
first_file="${files[0]}"
echo "Name of the first test summary file: $(basename "$first_file")"
echo "### Failed Test Execution Logs Dashboard (over VPN):" >> $GITHUB_STEP_SUMMARY
cat "$first_file" | jq -r '.loki[] | "* [\(.test_name)](\(.value))"' >> $GITHUB_STEP_SUMMARY
if [ ${#files[@]} -gt 1 ]; then
echo "Found more than one test summary file. This is incorrect, there should be only one file"
fi
else
echo "Test summary directory is empty. This should not happen"
fi
else
echo "No test summary folder found. If no test failed or log collection wasn't explicitly requested this is correct. Exiting"
fi

0 comments on commit 952abab

Please sign in to comment.