This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
forked from smartcontractkit/chainlink-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add action that sends test summary to step summary (smartcontractkit#146
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |