Skip to content

Commit

Permalink
Upload application logs to artifacts from test_suites (#11512)
Browse files Browse the repository at this point in the history
* Upload application logs to artifacts from test_suites

* annotate log file with test name and iteration

* annotate artifact name

* upload logs on failure
  • Loading branch information
pan-apple authored and pull[bot] committed Jun 16, 2022
1 parent 1d4d532 commit 2709001
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ jobs:
timeout-minutes: 35
run: |
scripts/tests/test_suites.sh
- name: Uploading application logs
uses: actions/upload-artifact@v2
if: ${{ failure() }} && ${{ !env.ACT }}
with:
name: test-suite-app-logs-${{ matrix.type }}-${{ matrix.eventloop }}
path: /tmp/test_suites_app_logs/
retention-days: 5
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }} && ${{ !env.ACT }}
Expand Down
21 changes: 13 additions & 8 deletions scripts/tests/test_suites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ echo ""

ulimit -c unlimited || true

rm -rf /tmp/test_suites_app_logs
mkdir -p /tmp/test_suites_app_logs

declare -a iter_array="($(seq "$iterations"))"
for j in "${iter_array[@]}"; do
echo " ===== Iteration $j starting"
Expand All @@ -107,16 +110,18 @@ for j in "${iter_array[@]}"; do
# tee expeditiously; otherwise it will buffer things up and we
# will never see the string we want.

# Clear out our temp files so we don't accidentally do a stale
# read from them before we write to them.
rm -rf /tmp/"$application"-log
touch /tmp/"$application"-log
application_log_file=/tmp/test_suites_app_logs/"$application-$i-$j"-log
pairing_log_file=/tmp/test_suites_app_logs/pairing-"$application-$i-$j"-log
chip_tool_log_file=/tmp/test_suites_app_logs/chip-tool-"$application-$i-$j"-log
touch "$application_log_file"
touch "$pairing_log_file"
touch "$chip_tool_log_file"
rm -rf /tmp/pid
(
stdbuf -o0 "${test_case_wrapper[@]}" out/debug/standalone/chip-"$application"-app &
echo $! >&3
) 3>/tmp/pid | tee /tmp/"$application"-log &
while ! grep -q "Server Listening" /tmp/"$application"-log; do
) 3>/tmp/pid | tee "$application_log_file" &
while ! grep -q "Server Listening" "$application_log_file"; do
:
done
# Now read $background_pid from /tmp/pid; presumably it's
Expand All @@ -125,9 +130,9 @@ for j in "${iter_array[@]}"; do
# the data is there yet.
background_pid="$(</tmp/pid)"
echo " * Pairing to device"
"${test_case_wrapper[@]}" out/debug/standalone/chip-tool pairing qrcode "$node_id" MT:D8XA0CQM00KA0648G00
"${test_case_wrapper[@]}" out/debug/standalone/chip-tool pairing qrcode "$node_id" MT:D8XA0CQM00KA0648G00 | tee "$pairing_log_file"
echo " * Starting test run: $i"
"${test_case_wrapper[@]}" out/debug/standalone/chip-tool tests "$i" "$node_id" "$delay"
"${test_case_wrapper[@]}" out/debug/standalone/chip-tool tests "$i" "$node_id" "$delay" | tee "$chip_tool_log_file"
# Prevent cleanup trying to kill a process we already killed.
temp_background_pid=$background_pid
background_pid=0
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Darwin/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
#endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS

// TODO - Fine tune MRP default parameters for Darwin platform
#define CHIP_CONFIG_MRP_DEFAULT_INITIAL_RETRY_INTERVAL (60000)
#define CHIP_CONFIG_MRP_DEFAULT_INITIAL_RETRY_INTERVAL (15000)
#define CHIP_CONFIG_MRP_DEFAULT_ACTIVE_RETRY_INTERVAL (2000)

// ==================== Security Configuration Overrides ====================
Expand Down

0 comments on commit 2709001

Please sign in to comment.