diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f9ed161..8fa1209 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,6 +5,10 @@ on: env: IMG_TOOL: docker +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: Test: runs-on: ubuntu-22.04 diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index 33f5b95..aed96ed 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -5,11 +5,11 @@ on: push: branches: - master - - feat/mock-timer jobs: qodana: runs-on: ubuntu-latest + if: github.actor == 'linuxsuren' steps: - uses: actions/checkout@v3 with: diff --git a/console/atest-ui/src/views/TestCase.vue b/console/atest-ui/src/views/TestCase.vue index 034ccbd..e78bed1 100644 --- a/console/atest-ui/src/views/TestCase.vue +++ b/console/atest-ui/src/views/TestCase.vue @@ -57,10 +57,7 @@ const sendRequest = async () => { type: 'success' }) } - if (e.body !== '') { - testResult.value.bodyObject = JSON.parse(e.body) - testResult.value.originBodyObject = JSON.parse(e.body) - } + parseResponseBody(e.body) Cache.SetTestCaseResponseCache(suite + '-' + name, { body: testResult.value.bodyObject, @@ -74,11 +71,24 @@ const sendRequest = async () => { requestLoading.value = false UIAPI.ErrorTip(e) - testResult.value.bodyObject = JSON.parse(e.body) - testResult.value.originBodyObject = JSON.parse(e.body) + + parseResponseBody(e.body) }) } +const parseResponseBody = (body) => { + if (body === '') { + return + } + + try { + testResult.value.bodyObject = JSON.parse(body) + testResult.value.originBodyObject = JSON.parse(body) + } catch { + testResult.value.bodyText = body + } +} + const responseBodyFilterText = ref('') function responseBodyFilter() { if (responseBodyFilterText.value === '') { @@ -803,9 +813,14 @@ const queryHeaderValues = (queryString: string, cb: (arg: any) => void) => { - - +
+ + +
+
+ +