Skip to content

Parallel Execution - SupportCodeLibraryBuilder Not Loaded with Externalised Hook InformationΒ #2327

Open
@tamil777selvan

Description

@tamil777selvan

πŸ‘“ What did you see?

Hooks that are loaded via supportCodeLibraryBuilder encounter an error when using the parallel option in the runCucumber API.

βœ… What did you expect to see?

Hooks loaded through supportCodeLibraryBuilder should be properly initialised and accessible, even when parallel mode is enabled.

πŸ“¦ Which tool/library version are you using?

Cucumber JS - 9.5.1

πŸ”¬ How could we reproduce it?

  1. Reset supportCodeLibraryBuilder.
  2. Import or require the files you want to use.
  3. Implement BeforeAll using supportCodeLibraryBuilder.methods.BeforeAll.
  4. Finalise supportCodeLibraryBuilder.

Once you've completed the above setup, you can invoke runCucumber with parallel: 0, and it should work as expected because it uses runTime.

However, if you set parallel: 1, you will encounter the following error because it uses the parallel coordinator.

TypeError: Cannot read properties of undefined (reading 'getInvocationParameters')
    at Object.run (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/step_runner.ts:34:43)
    at TestCaseRunner.invokeStep (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:137:29)
    at TestCaseRunner.runHook (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:273:23)
    at /Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:231:29
    at TestCaseRunner.aroundTestStep (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:170:34)
    at TestCaseRunner.runAttempt (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:218:18)
    at TestCaseRunner.run (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:188:40)
    at Worker.runTestCase (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js:115:30)
    at Worker.receiveMessage (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js:97:24)
    at process.<anonymous> (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/parallel/run_worker.ts:20:8)

πŸ“š Any additional context?

Code Snippet Used:

image


This text was originally generated from a template, then edited by hand. You can modify the template here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugins-usecaseA use case that could potentially by served by our nascent plugins concept

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions