allure-framework / allure-js

Allure integrations for JavaScript test frameworks
https://allurereport.org/
Apache License 2.0
226 stars 122 forks source link

Testplan.json parse error on gitlab ci when using allurectl #1183

Closed aletzal closed 9 hours ago

aletzal commented 4 days ago

Describe the bug

Problem occures on Gitlab CI when using allurectl_linux_386 (2.15.1)

(it can be reproduced locally, just add to env GITLAB_CI=true)

Typescript + Playwright

To Reproduce Steps to reproduce the behavior:

  1. use dependency "allure-playwright": "3.0.5"
  2. integration with Allure TestOps is needed
  3. must be executed on Gitlab CI
  4. run allurectl watch -- npx playwright test

Expected behavior NO exceptions related to testplan.json in logs

Actual behavior

Session [32146] started
Report link: https://allure.myserver.com/jobrun/19572
could not parse test plan /usr/src/app/.allure/testplan.json Error: ENOENT: no such file or directory, open '/usr/src/app/.allure/testplan.json'
    at readFileSync (node:fs:448:20)
    at parseTestPlan (/usr/src/app/node_modules/allure-js-commons/src/sdk/reporter/testplan.ts:14:30)
    at AllureReporter.onConfigure (/usr/src/app/node_modules/allure-playwright/src/index.ts:93:35)
    at /usr/src/app/node_modules/playwright/lib/reporters/multiplexer.js:32:65
    at wrap (/usr/src/app/node_modules/playwright/lib/reporters/multiplexer.js:86:5)
    at Multiplexer.onConfigure (/usr/src/app/node_modules/playwright/lib/reporters/multiplexer.js:32:45)
    at InternalReporter.onConfigure (/usr/src/app/node_modules/playwright/lib/reporters/internalReporter.js:45:20)
    at Runner.runAllTests (/usr/src/app/node_modules/playwright/lib/runner/runner.js:74:14)
    at runTests (/usr/src/app/node_modules/playwright/lib/program.js:207:85)
    at t.<anonymous> (/usr/src/app/node_modules/playwright/lib/program.js:54:7) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/usr/src/app/.allure/testplan.json'

Additional context

v3.0.5 - ERROR ... v3.0.0-beta.8 - ERROR v3.0.0-beta.7 - OK

cheshi-mantu commented 4 days ago

hi there on your machine, do you have path: '/usr/src/app/.allure'? if not, then you have correct behaviour (and the error message says so: could not parse test plan /usr/src/app/.allure/testplan.json Error: ENOENT: no such file or directory, open '/usr/src/app/.allure/testplan.json').

for local executions you need to do as follows:

 export ALLURE_TESTPLAN_PATH=./testplan.json

then execute your command for running the tests.

See here: https://allurereport.org/docs/playwright/#select-tests-via-a-test-plan-file

When running in GL, we recommend using x64 version not 386 as all images and linux VMs are 64 bits not 32 bits

aletzal commented 3 days ago

Hi! Thanks for the answer

Found changes, this error has been all time, but it was added console log from v3.0.0-beta.8

So, it's just like permanent warning, we can close this issue, thanks!