Skip to content

Commit d713ab0

Browse files
committed
Grid for resutls instead of list.
1 parent 49a3eb6 commit d713ab0

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

.github/workflows/datachannel_echo-test.yml

+33-10
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,41 @@ jobs:
7171
run: |
7272
echo "Collating...."
7373
74-
echo "raw=${{ toJSON(needs.interoptests.outputs) }}"
74+
# Capture the outputs as a JSON string
7575
results='${{ toJSON(needs.interoptests.outputs) }}'
76-
echo "results=${results}"
77-
78-
echo "| Server | Client | Test Result |" > DataChannel_Echo_test_results.md
79-
echo "|--------|--------|-------------|" >> DataChannel_Echo_test_results.md
80-
81-
echo "${results}" | jq -r 'to_entries | .[] |
82-
"\(.key): \(.value)" |
83-
capture("result_(?<server>.+)_(?<client>.+): (?<value>.+)") |
84-
"| \(.server) | \(.client) | \(.value) |"' >> DataChannel_Echo_test_results.md
76+
77+
# Print the raw JSON for debugging
78+
echo "The output from interop-test is: $results"
79+
80+
# Define the list of clients
81+
clients=("libdatachannel", "sipsorcery", "werift") # Adjust based on actual client list
82+
83+
# Write the header of the Markdown file
84+
echo "| Server | ${clients[@]} |" > DataChannel_Echo_test_results.md
85+
echo "|--------|${clients[*]// /|}|" >> DataChannel_Echo_test_results.md
86+
87+
# Loop through servers to fill in the matrix
88+
for server in $(echo "$results" | jq -r 'keys[] | capture("result_(?<server>.+)_(?<client>.+)") | .server' | sort -u); do
89+
# Start the row with the server name
90+
row="$server"
91+
92+
# Loop through each client to get the results
93+
for client in "${clients[@]}"; do
94+
# Get the result for this server-client combination
95+
value=$(echo "$results" | jq -r --arg server "$server" --arg client "$client" '.["result_\($server)_\($client)"] // "N/A"') # Default to N/A if no value
96+
97+
# Append the value to the row
98+
row+=" | $value"
99+
done
100+
101+
# Write the row to the Markdown file
102+
echo "| $row |" >> DataChannel_Echo_test_results.md
103+
done
104+
105+
echo "" >> DataChannel_Echo_test_results.md
106+
echo "Timestamp: $(date)" >> DataChannel_Echo_test_results.md
85107
108+
# Display the results file
86109
cat DataChannel_Echo_test_results.md
87110
88111
- name: Commit the results to the git repository

0 commit comments

Comments
 (0)