From a5615bd8ea202b24d91d506cae230de5e25bdeb9 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Mon, 15 May 2023 13:04:03 +0100 Subject: [PATCH] Fix Allure reports for different benchmark jobs (#4229) - Fix Allure report generation failure for Nightly Benchmarks - Fix GitHub Autocomment for `run-benchmarks` label (`build_and_test.yml::benchmarks` job) --- .github/actions/run-python-test-set/action.yml | 2 +- scripts/pr-comment-test-report.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/actions/run-python-test-set/action.yml b/.github/actions/run-python-test-set/action.yml index 1dd294d17a..d6c960bfda 100644 --- a/.github/actions/run-python-test-set/action.yml +++ b/.github/actions/run-python-test-set/action.yml @@ -206,4 +206,4 @@ runs: uses: ./.github/actions/allure-report-store with: report-dir: /tmp/test_output/allure/results - unique-key: ${{ inputs.test_selection }}-${{ inputs.build_type }} + unique-key: ${{ inputs.build_type }} diff --git a/scripts/pr-comment-test-report.js b/scripts/pr-comment-test-report.js index 7cb2a5494f..287a1ea8e5 100644 --- a/scripts/pr-comment-test-report.js +++ b/scripts/pr-comment-test-report.js @@ -79,7 +79,17 @@ module.exports = async ({ github, context, fetch, report }) => { for (const parentSuite of suites.children) { for (const suite of parentSuite.children) { for (const test of suite.children) { - const {groups: {buildType, pgVersion}} = test.name.match(/[\[-](?debug|release)-pg(?\d+)[-\]]/) + let buildType, pgVersion + const match = test.name.match(/[\[-](?debug|release)-pg(?\d+)[-\]]/)?.groups + if (match) { + ({buildType, pgVersion} = match) + } else { + // It's ok, we embed BUILD_TYPE and Postgres Version into the test name only for regress suite and do not for other suites (like performance). + console.info(`Cannot get BUILD_TYPE and Postgres Version from test name: "${test.name}", defaulting to "release" and "14"`) + + buildType = "release" + pgVersion = "14" + } pgVersions.add(pgVersion) buildTypes.add(buildType)