Skip to content

refactor(provider): add retry for connection reset by peer error #5868

refactor(provider): add retry for connection reset by peer error

refactor(provider): add retry for connection reset by peer error #5868

Workflow file for this run

name: acc-test
on:
pull_request_target:
types: [labeled]
jobs:
pr-acc-test:
if: ${{ contains(github.event.pull_request.labels.*.name, 'safe to test') }}
runs-on: ubuntu-latest
env:
HW_ACCESS_KEY: ${{ secrets.HW_ACCESS_KEY }}
HW_SECRET_KEY: ${{ secrets.HW_SECRET_KEY }}
HW_DOMAIN_NAME: ${{ secrets.HW_DOMAIN_NAME }}
HW_REGION_NAME: "cn-north-4"
HW_ADMIN: "true"
HW_ENTERPRISE_PROJECT_ID: "0"
HW_ENTERPRISE_PROJECT_ID_TEST: "0"
steps:
- run: echo "${{github.event.pull_request.head.repo.full_name}}"
- uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
fetch-depth: 0
- run: /usr/bin/git diff "origin/${{github.base_ref}}" --name-only
- uses: actions/setup-go@v3
with:
go-version: ">=1.18"
## have checkout merge commit,so just diff base_ref with HEAD
- run: scripts/acc-test.sh "origin/${{github.base_ref}}" > pr-acc-test.log
- id: get-comment-body
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
cat pr-acc-test.log >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
failed="$(grep -P -o '###\s\[summary\]\s\d*' pr-acc-test.log| grep -P -o '\d*')"
reactions="laugh,rocket"
if [ $failed -gt 0 ]; then
reactions="confused,eyes"
fi
echo "reactions=$reactions" >> $GITHUB_OUTPUT
echo "lines=$(wc -l pr-acc-test.log | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
if: ${{ steps.get-comment-body.outputs.lines > 2 }}
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.get-comment-body.outputs.body }}
reactions: ${{ steps.get-comment-body.outputs.reactions }}
- uses: actions/upload-artifact@v3
if: ${{ steps.get-comment-body.outputs.lines > 2 }}
with:
name: acceptance-test
path: |
pr-acc-test.log
coverage_*.html
if-no-files-found: ignore