Skip to content

Commit 346f7e3

Browse files
committed
Updated peer connection test.
1 parent 8f7c59f commit 346f7e3

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

.github/workflows/peerconnection-test.yml

+33-15
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ jobs:
9595
credentials:
9696
username: ${{ github.actor }}
9797
password: ${{ secrets.CR_PAT }}
98-
#ports:
99-
# - 8080:8080
10098
options: "--name echo-server"
10199

102100
steps:
@@ -121,30 +119,50 @@ jobs:
121119
needs: [interoptests]
122120
steps:
123121
- uses: actions/checkout@v2
122+
- uses: actions/setup-python@v2
123+
with:
124+
python-version: "3.x"
124125
- name: Create results file from interop test outputs
125126
run: |
126127
echo "Collating...."
128+
echo "raw results=${{ toJSON(needs.interoptests.outputs) }}"
127129
128-
echo "raw=${{ toJSON(needs.interoptests.outputs) }}"
129-
results='${{ toJSON(needs.interoptests.outputs) }}'
130-
echo "results=${results}"
130+
python --version
131+
132+
echo '${{ toJSON(needs.interoptests.outputs) }}' | python3 test/collate-results.py > PeerConnection_test_results.md
133+
134+
# Display the results file
135+
cat DataChannel_Echo_test_results.md
131136
132-
echo "| Server | Client | Test Result |" > PeerConnection_test_results.md
133-
echo "|--------|--------|-------------|" >> PeerConnection_test_results.md
137+
- name: Replace Peer Connection Test Results in README
138+
run: |
139+
# Read the new content from DPeerConnection_test_results.md
140+
new_content="$(<PeerConnection_test_results.md)"
134141
135-
echo "${results}" | jq -r 'to_entries | .[] |
136-
"\(.key): \(.value)" |
137-
capture("result_(?<server>.+)_(?<client>.+): (?<value>.+)") |
138-
"| \(.server) | \(.client) | \(.value) |"' >> PeerConnection_test_results.md
139-
140-
cat PeerConnection_test_results.md
142+
# Use awk to replace content between the markers
143+
awk -v new_content="$new_content" '
144+
BEGIN { in_section = 0 }
145+
/## Peer Connection Test Results/ {
146+
in_section = 1;
147+
print;
148+
print new_content;
149+
next
150+
}
151+
/## Data Connection Echo Test Results/ {
152+
in_section = 0;
153+
print;
154+
next
155+
}
156+
!in_section { print }
157+
' README.md > README.tmp && mv -f README.tmp README.md
141158
159+
cat README.md
160+
142161
- name: Commit the results to the git repository
143162
if: github.event_name != 'pull_request'
144163
run: |
145164
git config user.name github-actions
146165
git config user.email [email protected]
147166
git pull
148-
git add PeerConnection_test_results.md
149-
git commit PeerConnection_test_results.md -m "Automated peer connection test results."
167+
git commit PeerConnection_test_results.md README.md -m "Automated peer connection test results."
150168
git push

0 commit comments

Comments
 (0)