sandro/specjour

Run with cucumber issue

pierreozoux opened this issue · 1 comments

Hi,

it's not working with cucumber. I'm sorry :)

So I tried 3 approaches :

On my code, it is failing because each worker is sending the result of his first step (in 0.001sec).

On Specjour code, when I try with just one worker (with the option -w1), it is passing just the first feature and not the other one.

I made a little script to mock the behavior of specjour : here

require 'cucumber'


configuration = ::Cucumber::Cli::Configuration.new
configuration.parse! []
runtime = ::Cucumber::Runtime.new(configuration)
runtime.send :load_step_definitions

def run feature, runtime    
    cli = ::Cucumber::Cli::Main.new([feature])

    runtime.instance_variable_set(:@configuration, cli.configuration)
  runtime.instance_eval do
      tree_walker = @configuration.build_tree_walker(self)
      self.visitor = tree_walker
      tree_walker.visit_features(features)
  end

end

feature1 = "features/fail.feature"
feature2 = "features/pass.feature"

p feature1
run feature1, runtime
p feature2
run feature2, runtime

And if you run it, you can see that it is just running the first feature and not the second one.

After investigating a bit more, I get to the conclusion that there is some Global variable that are reinitialized, and never loaded again after the first run. The result is that my step_definition are not loaded. I'm still investigating.

In the mean time, I tried to look at parallel_test, hydra and testjour.
Hydra and Testjour have the same approach, but as it is a bit old, I think, there is the same problem.

Parallel_test is running cucumber though a system call.

I will continue investigating. Maybe by trying to call to lower level API as suggested by a friend.. I'll see. If you have any idea?

Hi,

I finally manage to find something . here it is : pierreozoux/specjour@a0f9dfd...issue_46

The idea was that maybe it was loading a bit more than just the configuration file. So I went though all the process. I tried to mock cucumber at the highest level without much success... So I digged, and here it is :)

It was running once for me. I still get random errors from time to time, but I think it comes from my config... I close this issue, and reopen a new one if needed.