Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Tests skipped unless I compile with opt-level = 0 #347

Open
Maximetinu opened this issue Oct 15, 2024 · 0 comments
Open

Tests skipped unless I compile with opt-level = 0 #347

Maximetinu opened this issue Oct 15, 2024 · 0 comments

Comments

@Maximetinu
Copy link

Maximetinu commented Oct 15, 2024

Hello

I found a situation where some gherkin given/when/then steps that should be visible are instead skipped

If I compile the tests without optimization -O0, then they are visible.

It's like the optimizations are stripping them away?

I reproduced it in a minimal example here:

https://github.com/Maximetinu/cucumber-multicrate-setup/tree/reproducing-cucumber-bug-see-latest-commit

This must be a bug on cucumber, because I can reach those functions from my code, but cucumber cannot. I would expect the same visibility for both.

Update: I made another branch on that repo where I tried to find the smallest possible commit introducing the bug. It is this: Maximetinu/cucumber-multicrate-setup@139ecc2

I don't know what conclusions to extract from it. It seems that the steps and the world context must be in the same mod in order for cucumber to find them?

Update 2: I noticed that what I'm trying to do is the same that is discussed in this thread: #236

@ilslv shared a repository showcasing how to set that up. I've also been able to reproduce it in that repository: Maximetinu/cucumber-steps-as-library@3a06dda

So, this bug is apparently caused by a combination of:

  • using any opt-level > 0
  • defining the cucumber world in a different file, separated from the steps
@Maximetinu Maximetinu changed the title Tests skipped unless I compile with -O0 Tests skipped unless I compile with opt-level = 0 Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant