Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Include SPEC_OPTS in bisect reproduction command #2274

Conversation

urbanautomaton
Copy link
Contributor

@urbanautomaton urbanautomaton commented Jun 17, 2016

Previously the following command:

SPEC_OPTS="--bisect --seed 123" rspec blah_spec.rb

would return a repro command something like:

rspec blah_spec.rb[1:2,1:5]

To reliably run in the correct order, we need to include the seed from SPEC_OPTS - this patch adds this to the repro command, to now return:

SPEC_OPTS="--seed 123" rspec blah_spec.rb[1:2,1:5]

To keep the cukes passing I've had to exclude the bisect feature from the should/should_not prevention; this uses SPEC_OPTS to load a support file, which then shows up in the repro command produced by the cukes.

Rather than add the @allow-should-syntax tag to these cukes I've introduced a new @with-clean-spec-opts tag to try to communicate the intention better, even though it just controls the same hook as the existing tag. Does that seem reasonable?

Previously the following command:

    SPEC_OPTS="--bisect --seed 125" rspec blah_spec.rb

would return a repro command something like

    rspec blah_spec.rb[1:2,1:4]

However, this won't run in the correct order without the seed. This patch
includes SPEC_OPTS in the bisect reproduction command, minus the `--bisect`
flag.

By default, cukes using aruba to run commands are given an environment with
SPEC_OPTS="-r/path/to/features/support/require_expect_syntax_in_aruba_specs.rb",
which ensures that `should` and `should_not` are not used in the examples.

Now that SPEC_OPTS is included in the bisect reproduction command, however,
this setting shows up in the final output, breaking the existing assertions.

To prevent this I've added a new tag, `@with-clean-spec-opts`, and added this
tag to the logic controlling whether the above file is loaded.
@myronmarston
Copy link
Member

This LGTM!

@myronmarston myronmarston merged commit 407328c into rspec:master Jun 17, 2016
myronmarston added a commit that referenced this pull request Jun 17, 2016
@urbanautomaton urbanautomaton deleted the include-spec-opts-in-bisect-repro-command branch June 22, 2016 16:17
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
…n-bisect-repro-command

Include SPEC_OPTS in bisect reproduction command
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants
close