Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish test result upload #4156

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/actions/on_device_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,33 @@ runs:
sleep 10

# The log files are named by the device lab test driver.
COBALT_ERROR_LOG="webDriverTestLog.ERROR"
COBALT_INFO_LOG="webDriverTestLog.INFO"
COBALT_ERROR_LOG_FILENAME="webDriverTestLog.ERROR"
COBALT_INFO_LOG_FILENAME="webDriverTestLog.INFO"

# This command will fail until the results have been uploaded.
gsutil cp "${GCS_RESULTS_PATH}/${COBALT_ERROR_LOG}" .
gsutil cp "${GCS_RESULTS_PATH}/${COBALT_INFO_LOG}" .
gsutil cp "${GCS_RESULTS_PATH}/${COBALT_ERROR_LOG_FILENAME}" .
gsutil cp "${GCS_RESULTS_PATH}/${COBALT_INFO_LOG_FILENAME}" .
gsutil cp "${GCS_RESULTS_PATH}/${COBALT_XMLS_FILENAME}" .

# Break if all files were downloaded.
if [[ -f "${COBALT_XMLS_FILENAME}" && -f "${COBALT_ERROR_LOG}" && -f "${COBALT_INFO_LOG}" ]]; then
if [[ -f "${COBALT_XMLS_FILENAME}" && -f "${COBALT_ERROR_LOG_FILENAME}" && -f "${COBALT_INFO_LOG_FILENAME}" ]]; then
break
fi

i=$(( ${i} + 1 ))
done

# Print device logs. Might fail if the log file failed to download.
cat ${COBALT_ERROR_LOG}

# Rename log files for archiving to not expose legacy weirdness.
mkdir -p "${COBALT_LOGS_DIR}/${{ matrix.platform }}/"
mv "${COBALT_ERROR_LOG}" "${COBALT_LOGS_DIR}/${{ matrix.platform }}/stderr_${{ matrix.shard }}.log"
mv "${COBALT_INFO_LOG}" "${COBALT_LOGS_DIR}/${{ matrix.platform }}/stdout_${{ matrix.shard }}.log"
cp "${COBALT_ERROR_LOG_FILENAME}" "${COBALT_LOGS_DIR}/${{ matrix.platform }}/stderr_${{ matrix.shard }}.log"
cp "${COBALT_INFO_LOG_FILENAME}" "${COBALT_LOGS_DIR}/${{ matrix.platform }}/stdout_${{ matrix.shard }}.log"

# Prepare unit test results for DataDog upload.
RESULT_PATH=${UNIT_TEST_RESULT_PATH}/${{ matrix.platform }}/${{ matrix.shard }}/
mkdir -p ${RESULT_PATH}

# Set tags for test differentiation.
tags="platform:${{ matrix.platform }}"
tags="os.platform:${{ matrix.platform }}"
echo $tags > ${UNIT_TEST_RESULT_PATH}/${{ matrix.platform }}/TAGS

unzip ${COBALT_XMLS_FILENAME} -d ${RESULT_PATH}
Expand All @@ -162,3 +159,12 @@ runs:
with:
name: unit-test-results
path: ${{ env.UNIT_TEST_RESULT_PATH }}/
- name: Print device logs
if: always()
run: |
if ls ${COBALT_LOGS_DIR}/**/*.log 1> /dev/null 2>&1; then
cat ${COBALT_LOGS_DIR}/**/*.log
else
echo "No device logs found"
fi
shell: bash
4 changes: 2 additions & 2 deletions .github/actions/on_host_test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ runs:
shell: bash
run: |
# Set tags for test differentiation.
tags="platform:${{ matrix.platform }}"
tags="${tags},os:${{ inputs.os }}"
tags="os.platform:${{ matrix.platform }}"
tags="${tags},os.family:${{ inputs.os }}"
echo $tags > ${TEST_RESULTS_DIR}/${{ matrix.platform }}/TAGS
- name: Archive unit test results
uses: actions/upload-artifact@v3
Expand Down
Loading