serenity-bdd / serenity-cucumber4

Other
13 stars 10 forks source link

Question: is the --threads option of cucumber4 actually supported? #4

Closed kutzi closed 4 years ago

kutzi commented 5 years ago

We've now migrated our serenity/cucumber-jvm tests the cucumber4 and running them with --threads. While this works generally great, I just seen a strange issue: For a failing test the BDD report reported a step to be failing for a scenario which the test was not actually part of!

serenity-core 2.0.48, serenity-cucumber4:1.0.12, cucumber-jvm 4.2.0

wakaleo commented 5 years ago

No, if I recall correctly the events that Cucumber sends don’t work for reporting purposes (yet?)

kutzi commented 5 years ago

hmm, okay

kutzi commented 5 years ago

Is that fixable? If I remember correctly there are some options you have in cucumber4 to receive the events in the correct order, right?

wakaleo commented 5 years ago

I haven’t had time to look yet

kutzi commented 5 years ago

I'd say somehow cucumber.runtime.formatter.SerenityReporter needs to be modified that most/all of the internal stuff is handled thread-local: stepQueues, tags, currentScenarioId

wakaleo commented 5 years ago

All the reporting logic is already thread-local - feel free to have a look though.

kutzi commented 5 years ago

SerenityReporter has e.g. a single stepQueue which is e.g. used to determine the current step. I guess that needs to be a thread-local queue.

I can have a look and convert everything - which appears to need it - to thread-local, but in the end I'm not really known with that code.

wakaleo commented 5 years ago

See what you can do and I will take a look - handing th current step should indeed be threadlocal.

kutzi commented 5 years ago

See https://github.com/serenity-bdd/serenity-cucumber4/pull/5

wakaleo commented 4 years ago

Fixed in 1.0.28