Avoid using fiber local for determining example group.#116
Avoid using fiber local for determining example group.#116ioquatix wants to merge 1 commit intoKnapsackPro:masterfrom
Conversation
|
Else branch was to support older RSpec version as far as I remember. |
|
Are you able to merge this? |
|
This PR is on my TODO list. I will get back to it when I'm done with higher priority tasks. Regarding this PR:
|
|
Here is the old PR that added support for RSpec 2. #1 |
|
@ArturT can you please approve the workflow so it can run CI? |
|
Approved. |
|
Hi @ioquatix I'm working on PR #117 that will introduce changes you proposed and fix specs and drop support for RSpec 2.x. I have a separate repository with an example rails app. I'd like to add to it async-rspec gem and an example spec file to verify that the changes in knapsack gem will work. But I can't make the spec PR with async-rspec gem: https://github.com/KnapsackPro/rails-app-with-knapsack/pull/13/files I run the test this way: I tried using higher Do you have any example test with the async-rspec gem that I could use to verify that changes in knapsack gem will work with async-rspec? |
|
Hi @ioquatix by any chance you have an example spec for async-rspec gem that I could reuse in my test project? Despite the fact my spec is failing I verified that changes introduced in #117 fix your problem but I'd like to have at least 1 test for async-rspec passing green just in case so we won't introduce regression bug in the future. Thanks. |
|
I managed to make async-rspec test passing by just commenting out its content https://github.com/KnapsackPro/rails-app-with-knapsack/pull/13/files#diff-d0b3815a1363f7e8dce8f34eb23ad8151304b5c4688b47b93ca1956e9217b619R12 |
|
I'll take a look. |
|
I think the reason why this fails is because of bugs in 3.0.2 can you please try Ruby 2.7.x? Make sure you use the latest release of async etc. |
|
I've used the latest async, async-io, async-rspec gems. I tried Ruby versions:
My test I'm going to ignore this for now and leave it with a commented-out code in the |
|
Hmm odd. Can you give me full instructions to reproduce the issue, including what repos to check out and any local gems if needed? Thanks. |
|
You can clone this repo with rails project: Please checkout to branch You can clone knapsack repo as well for this pull request #117 and use this branch Local directory structure: ~/Documents/projects <- this is root directory. Put all repos inside of it. Inside of the rails-app-with-knapsack repository you can update path for knapsack gem in the Gemfile or set your path as env var When you go to rails-app-with-knapsack repository you can run tests:
Thanks for the help. |
|
I will take a look this weekend. |
|
I've released knapsack 4.0.0 with the improvent. You can clone directly |
|
I've released also knapsack_pro 3.0.0 with the same improvement to support async-rspec gem. |
We ran into a problem using
KnapsackwithAsync::RSpecwhich runs the spec in a nested asynchronous fiber. BecauseRSpec.current_exampleis fiber-local, it becomesniland Knapsack fails.In addition, it seems like the
elseside of the branch is incorrect.