Skip to content

Fix a Knapsack issue that would load support/capybara.rb before support/env.rb

Rémy Coutable requested to merge rc/fix-spinach-plus-knapsack-properly into master

What does this MR do?

This fixes the issue originally patched by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10395, which is actually described in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10395#note_26752554 and reported upstream in Knapsack at https://github.com/ArturT/knapsack/issues/57.

Are there points in the code the reviewer needs to double check?

Spinach tries to load features/support/env.rb first but since Knapsack pass --features_path features/ instead of --features_path features, features/support/env.rb is not detected and features/support/capybara.rb was loaded before it.

Setting KNAPSACK_TEST_DIR=features in .gitlab-ci.yml fixes the issue since features/support/env.rb is now correctly loaded first, leading to environments and gems being loaded, including the spinach-rails gem which takes care of requiring spinach/capybara and capybara/rails in a before_run hook.

Why was this MR needed?

Because the mystery was unsolved!

Merge request reports