Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Not able to generate allure report with GitHub CI #25

Closed
MetodievIvaylo opened this issue Jan 25, 2024 · 8 comments
Closed

Not able to generate allure report with GitHub CI #25

MetodievIvaylo opened this issue Jan 25, 2024 · 8 comments

Comments

@MetodievIvaylo
Copy link

We want to use jest-allure2-report to generate a report after GitHub CI run. After the test execution allure-results folder is generated but it is just two files in it (executor.json and categories.json). In the logs we found this error listed below.

The same script locally works just fine and generates allure-results dir with all we need in it to build a report.

If you need any more information just let me know.

15:33:51.430 detox[77195] i TypeError: testInvocation.afterAll.at is not a function
    at Object.getStop [as stop] (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.3_jest@29.7.0/node_modules/jest-allure2-reporter/src/metadata/utils/getStop.ts:12:30)
    at MetadataSquasher.testInvocation (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.3_jest@29.7.0/node_modules/jest-allure2-reporter/src/metadata/MetadataSquasher.ts:107:32)
    at JestAllure2Reporter.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.3_jest@29.7.0/node_modules/jest-allure2-reporter/src/reporter/JestAllure2Reporter.ts:207:45)
    at ReporterDispatcher.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)
    at TestScheduler.scheduleTests (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/TestScheduler.js:306:5)
    at runJest (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/runJest.js:367:19)
    at _run10000 (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:343:7)
    at runCLI (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:198:3)
    at Object.run (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-cli@29.7.0/node_modules/jest-cli/build/run.js:130:37)
@noomorph
Copy link
Collaborator

noomorph commented Feb 10, 2024

Hi, @MetodievIvaylo ! Could you please retry with the updated version, 2.0.0-beta.5 ?

P.S. Is it flaky, or it reproduces always on your CI?

@MetodievIvaylo
Copy link
Author

I have updated the version but still have the same error. It happens every time. There are longer logs if there si something helpful.

Test Suites: 1 failed, 2 passed, 3 total
Tests:       2 failed, 12 passed, 14 total
Snapshots:   0 total
Time:        242.305 s
Ran all test suites matching /apps\/mobile-e2e\/src\/scenarios\/#.test.ts|apps\/mobile-e2e\/src\/scenarios\/videos.test.ts|apps\/mobile-e2e\/src\/scenarios\/demo.test.ts/i.
12:00:36.883 detox[26348] i Failed to fetch job ID due to error: Error: Not Found
    at Object.globalContext (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.5_jest@29.7.0/node_modules/jest-allure2-reporter/dist/builtin-plugins/github.js:26:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 2)
    at async JestAllure2Reporter._callPlugins (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.5_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:294:9)
    at async JestAllure2Reporter.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.5_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:80:9)
    at async ReporterDispatcher.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)
    at async TestScheduler.scheduleTests (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/TestScheduler.js:306:5)
    at async runJest (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/runJest.js:367:19)
    at async _run10000 (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:343:7)
    at async runCLI (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:198:3)
12:00:36.890 detox[26348] i TypeError: testInvocation.afterAll.at is not a function
    at getStop (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.5_jest@29.7.0/node_modules/jest-allure2-reporter/dist/metadata/utils/getStop.js:6:47)
    at MetadataSquasher.testInvocation (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.5_jest@29.7.0/node_modules/jest-allure2-reporter/dist/metadata/MetadataSquasher.js:28:39)
    at JestAllure2Reporter.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.5_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:135:55)
    at async ReporterDispatcher.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)
    at async TestScheduler.scheduleTests (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/TestScheduler.js:306:5)
    at async runJest (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/runJest.js:367:19)
    at async _run10000 (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:343:7)
    at async runCLI (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:198:3)
    at async Object.run (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-cli@29.7.0/node_modules/jest-cli/build/run.js:130:37)
12:00:36.897 detox[26342] E Command failed with exit code = 1:
jest --config ./jest.config.js --maxWorkers 3 apps/mobile-e2e/src/scenarios/#.test.ts apps/mobile-e2e/src/scenarios/videos.test.ts apps/mobile-e2e/src/scenarios/demo.test.ts
error: "detox" exited with code 1 (SIGHUP)
 >  NX   ERROR: Something went wrong in run-commands - Command failed: bun detox test --configuration ios.sim.release --maxWorkers 3 apps/mobile-e2e/src/scenarios/#.test.ts apps/mobile-e2e/src/scenarios/videos.test.ts apps/mobile-e2e/src/scenarios/demo.test.ts

noomorph added a commit that referenced this issue Feb 13, 2024
@noomorph
Copy link
Collaborator

noomorph commented Feb 13, 2024

Hi @MetodievIvaylo, could you please let me know the results of testing 2.0.0-beta.6?

Specifically, I need to know:

  1. Did it resolve the issue with testInvocation.afterAll.at is not a function? If not, please reopen this issue.
  2. What error message are you seeing now instead of Failed to fetch job ID due to error: Error: Not Found?
  3. Could you also confirm the Node.js version on your Github agent? I'm suspecting it's Node 14, but please let me know."

Copy link
Contributor

🎉 This issue has been resolved in version 2.0.0-beta.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MetodievIvaylo
Copy link
Author

Hi, @noomorph. I am sorry for the late response. I have run the CI with the 2.0.0-beta.6 and I got slightly different errors.

Node version - v16.3.0

Test Suites: 7 failed, 2 skipped, 23 passed, 30 of 32 total
Tests:       16 failed, 8 skipped, 169 passed, 193 total
Snapshots:   0 total
Time:        3099.813 s
Ran all test suites.
11:07:49.749 detox[17329] i Failed to fetch job ID from: https://api.github.com/repos/company_name/monorepo/actions/runs/8184758788/attempts/1/jobs
Reason: Error: HTTP 404 Not Found
    at Object.globalContext (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.6_jest@29.7.0/node_modules/jest-allure2-reporter/dist/builtin-plugins/github.js:26:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 2)
    at async JestAllure2Reporter._callPlugins (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.6_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:294:9)
    at async JestAllure2Reporter.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.6_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:80:9)
    at async ReporterDispatcher.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)
    at async TestScheduler.scheduleTests (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/TestScheduler.js:306:5)
    at async runJest (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/runJest.js:367:19)
    at async _run10000 (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:343:7)
    at async runCLI (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:198:3)
11:07:50.011 detox[17329] i TypeError: testStepMetadata.description?.at is not a function
    at Object.name (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.6_jest@29.7.0/node_modules/jest-allure2-reporter/dist/options/default-options/testStep.js:7:67)
    at /Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.6_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:161:51
    at async Promise.all (index 2)
    at async JestAllure2Reporter.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-allure2-reporter@2.0.0-beta.6_jest@29.7.0/node_modules/jest-allure2-reporter/dist/reporter/JestAllure2Reporter.js:157:39)
    at async ReporterDispatcher.onRunComplete (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)
    at async TestScheduler.scheduleTests (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/TestScheduler.js:306:5)
    at async runJest (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/runJest.js:367:19)
    at async _run10000 (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:343:7)
    at async runCLI (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/@jest+core@29.7.0/node_modules/@jest/core/build/cli/index.js:198:3)
    at async Object.run (/Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/node_modules/.pnpm/jest-cli@29.7.0/node_modules/jest-cli/build/run.js:130:37)
11:07:50.017 detox[17323] E Command failed with exit code = 1:
jest --config ./jest.config.js --maxWorkers 3
error: "detox" exited with code 1 (SIGHUP)
 >  NX   ERROR: Something went wrong in run-commands - Command failed: bun detox test --configuration ios.sim.release --maxWorkers 3
   Pass --verbose to see the stacktrace.
 
 >  NX   Running target "mobile-e2e:test-ios-release" failed
   Failed tasks:
   
   - mobile-e2e:test-ios-release
   
   Hint: run the command with --verbose for more details.
error: "nx" exited with code 1 (SIGHUP)
11 |   const commandResult = await execCommand(
12 |     `bun nx run mobile-e2e:test-${platform}-release -- --maxWorkers ${maxWorkers} ${tests}`
13 |   )
14 | 
15 |   if (!commandResult.ok) {
16 |     throw new Error(
              ^
error: Some tests from the scenarious failed. See the attached artifacts for more information
      at /Users/mobilebuilder/github-actions-runner/_work/monorepo/monorepo/apps/mobile-e2e/scripts/ci/start-e2e-tests.ts:16:10
 >  NX   ERROR: Something went wrong in run-commands - Command failed: bun ./scripts/ci/start-e2e-tests.ts
   Pass --verbose to see the stacktrace.

 

 >  NX   Running target "mobile-e2e:start-e2e-tests" failed

   Failed tasks:
   
   - mobile-e2e:start-e2e-tests
   
   Hint: run the command with --verbose for more details.

   View structured, searchable error logs at https://cloud.nx.app/runs/J1PbRPlv4t

error: "nx" exited with code 1 (SIGHUP)
Error: Process completed with exit code 1.

@noomorph
Copy link
Collaborator

noomorph commented Mar 8, 2024

@MetodievIvaylo can you please upgrade Node to 16.20.2, at least?

@MetodievIvaylo
Copy link
Author

Updating the Node to 16.20.2 fixed the problem. Thank you! 🙏

Copy link
Contributor

github-actions bot commented Nov 6, 2024

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants