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

Trailing slash should be removed from allocator.test_dir in Knapsack::Runners::SpinachRunner #57

Closed
rymai opened this issue Apr 3, 2017 · 5 comments

Comments

@rymai
Copy link

rymai commented Apr 3, 2017

We, at GitLab, have an issue where the --features_path option passed to Spinach is set to features/: https://github.com/ArturT/knapsack/blob/e2e71d3974653bd3333fbf707fa20a8f0d95e209/lib/knapsack/runners/spinach_runner.rb#L15

The problem is that Spinach is not expecting a trailing slash for this option: https://github.com/codegram/spinach/blob/f561ec621dc309c87a60dd2c6ccca48a818ab298/lib/spinach/config.rb#L88

This ends in Spinach failing to require features/support/env.rb first: https://github.com/codegram/spinach/blob/f561ec621dc309c87a60dd2c6ccca48a818ab298/lib/spinach/runner.rb#L136-L139

I believe we should just call .chomp('/') on allocator.test_dir in Knapsack::Runners::SpinachRunner and move on with it. :)

For more detail about the issue we had, see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10395#note_26752554.

@ArturT
Copy link
Member

ArturT commented Apr 3, 2017

I will check that. Did you notice this after update of spinach gem?

For now you can manually set test_dir with KNAPSACK_TEST_DIR=features env var.

@rymai
Copy link
Author

rymai commented Apr 3, 2017

I will check that.

Thanks! ❤️

Did you notice this after update of spinach gem?

No, we're on Spinach 0.8.10 since more than 1.5 years! :)

For now you can manually set test_dir with KNAPSACK_TEST_DIR=features env var.

Yep, I figured this out, thanks!

@rymai
Copy link
Author

rymai commented Apr 3, 2017

Maybe a better fix would be @report_distributor.test_file_pattern.split('/').first as we do in Knapsack:: AllocatorBuilder#test_dir? I don't know the gem enough to know what's best, but I think both fix would solve the issue we have.

@rymai rymai changed the title Trailing slash should chomped from allocator.test_dir in Knapsack::Runners::SpinachRunner Trailing slash should be removed from allocator.test_dir in Knapsack::Runners::SpinachRunner Apr 3, 2017
@ArturT ArturT closed this as completed in ab31ada Apr 3, 2017
@ArturT
Copy link
Member

ArturT commented Apr 3, 2017

I've released knapsack 1.13.3. Thanks for help!

BTW maybe you will find useful Queue Mode in knapsack_pro for auto-balancing CI nodes.
I wrote the article recently: http://docs.knapsackpro.com/2017/auto-balancing-7-hours-tests-between-100-parallel-jobs-on-ci-buildkite-example

@rymai
Copy link
Author

rymai commented Apr 4, 2017

Thanks @ArturT!

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

2 participants