diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61a748a0..687b6de2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: run: npm i - name: Run tests run: npm test -- --reporter=json --reporter-option output=test-report.json - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: success() || failure() with: name: test-results diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml index 925aaf43..2a50a6d6 100644 --- a/.github/workflows/test-report.yml +++ b/.github/workflows/test-report.yml @@ -17,13 +17,22 @@ jobs: name: Web Page Report runs-on: ubuntu-22.04 steps: - - uses: dorny/test-reporter@v1 + - name: Download test results + uses: actions/download-artifact@v4 + with: + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + name: test-results + path: test-results + - uses: dorny/test-reporter@v1.8.0 id: test-results with: - artifact: test-results name: Mocha Tests - path: test-report.json + path: test-results/test-report.json reporter: mocha-json + # Workaround for error 'fatal: not a git repository' caused by a call to 'git ls-files' + # See: https://github.com/dorny/test-reporter/issues/169#issuecomment-1583560458 + max-annotations: 0 - name: Test Report Summary run: | echo "### Test Report page is ready! :rocket:" >> $GITHUB_STEP_SUMMARY diff --git a/package.json b/package.json index 8aae21ec..8c5c64ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bfx-report", - "version": "4.9.0", + "version": "4.10.0", "description": "Reporting tool", "main": "worker.js", "license": "Apache-2.0", diff --git a/workers/api.service.report.wrk.js b/workers/api.service.report.wrk.js index 1003859d..57d2a906 100644 --- a/workers/api.service.report.wrk.js +++ b/workers/api.service.report.wrk.js @@ -46,6 +46,9 @@ const TYPES = require('./loc.api/di/types') const { setLoggerDeps } = require('./loc.api/logger/logger-deps') +const { + PDFBufferUnderElectronCreationError +} = require('./loc.api/errors') class WrkReportServiceApi extends WrkApi { constructor (conf, ctx) { @@ -209,6 +212,11 @@ class WrkReportServiceApi extends WrkApi { aggregatorQueue.on('job', aggregator) processorQueue.on('error:base', (err) => { + // This error is intercepted and processed in the framework mode + if (err instanceof PDFBufferUnderElectronCreationError) { + return + } + this.logger.error(`PROCESSOR:QUEUE: ${err.stack || err}`) }) aggregatorQueue.on('error:base', (err) => { diff --git a/workers/loc.api/errors/index.js b/workers/loc.api/errors/index.js index d12fed4e..1ffc94af 100644 --- a/workers/loc.api/errors/index.js +++ b/workers/loc.api/errors/index.js @@ -178,6 +178,17 @@ class WeightedAveragesTimeframeError extends UnprocessableEntityError { } } +class PDFBufferUnderElectronCreationError extends BaseError { + constructor (electronErrStr) { + const _args = getErrorArgs( + { data: { electronErrStr } }, + 'ERR_PDF_BUFFER_UNDER_ELECTRON_HAS_NOT_BEEN_CREATED' + ) + + super(_args) + } +} + module.exports = { BaseError, BadRequestError, @@ -201,5 +212,6 @@ module.exports = { GrcSlackAvailabilityError, GrcPDFAvailabilityError, ImplementationError, - WeightedAveragesTimeframeError + WeightedAveragesTimeframeError, + PDFBufferUnderElectronCreationError } diff --git a/workers/loc.api/generate-report-file/pdf-writer/translations.yml b/workers/loc.api/generate-report-file/pdf-writer/translations.yml index 8ba0d5b4..6969e504 100644 --- a/workers/loc.api/generate-report-file/pdf-writer/translations.yml +++ b/workers/loc.api/generate-report-file/pdf-writer/translations.yml @@ -27,3 +27,78 @@ ru: copyright: Авторское право © 2013-2024 iFinex Inc. Все права защищены. page: Стр. from: из + +zh-CN: + template: + title: 报告 + statementDetails: 结算明细 + statementDate: 结算日期 + snapshotAt: 快照时间 + period: 期间 + username: 用户名 + email: 电子邮箱 + errorMessage: 无法建立档案,请重试 + reportGenAt: 报告创建时间 + copyright: Copyright © 2013-2024 iFinex Inc. All rights reserved. + page: 页数 + from: 从 + +zh-TW: + template: + title: 報告 + statementDetails: 結算明細 + statementDate: 結算日期 + snapshotAt: 快照時間: + period: 期間 + username: 用戶名 + email: 電子郵箱 + errorMessage: 無法建立檔案,請重試 + reportGenAt: 報告建立時間: + copyright: Copyright © 2013-2024 iFinex Inc. All rights reserved. + page: 頁數 + from: 從 + +es-EM: + template: + title: Reporte + statementDetails: Detalles del Estado + statementDate: Fecha del Estado + snapshotAt: Captura al + period: Periodo + username: Nombre de Usuario + email: Correo + errorMessage: Tu archivo no pudo ser completado, por favor inténtalo de nuevo + reportGenAt: Reporte generado al + copyright: Copyright © 2013-2024 iFinex Inc. Todos los derechos reservados. + page: Página + from: de + +tr: + template: + title: Rapor + statementDetails: Beyanname Detayları + statementDate: Beyanname Tarihi + snapshotAt: 'Anlık Görüntü:' + period: Dönem + username: Kullanıcı Adı + email: Email + errorMessage: Dosyanız tamamlanamadı, lütfen tekrar deneyin + reportGenAt: 'Rapor şu tarihte oluşturuldu:' + copyright: Telif Hakkı © 2013-2024 iFinex Inc. Tüm hakları saklıdır. + page: Sayfa + from: İtibaren + +pt-BR: + template: + title: Informes + statementDetails: Detalhes da declaração + statementDate: Data da declaração + snapshotAt: Captura de + period: Período + username: Nome de Usuário + email: e-mail + errorMessage: Seu arquivo não pode ser completado, por favor tente novamente + reportGenAt: 'Informe gerado em ' + copyright: Copyright © 2013-2024 iFinex Inc. Todos os direitos reservados. + page: Página + from: de