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

Allow coverage to be displayed for focused specs #367

Merged
merged 2 commits into from
Aug 29, 2017
Merged

Allow coverage to be displayed for focused specs #367

merged 2 commits into from
Aug 29, 2017

Conversation

joefitzgerald
Copy link
Contributor

In #205, there was lamentation! Show coverage for focused specs, we could not 😢. With this PR, it is possible to opt-in to allow coverage to be shown for focused specs.

The default behavior (failing the suite if any focusing is present, to prevent it from getting through CI) is preserved. A savvy editor integrator can transparently set the GINKGO_EDITOR_INTEGRATION environment variable to some non-empty value (e.g. true) to suppress the 197 exit code, and allow a coverage file to be generated (and thus allow coverage to be displayed in the editor).

"time"

"io/ioutil"
Copy link
Contributor Author

@joefitzgerald joefitzgerald Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goimports doing its thing. I'm happy to revert these lines if you'd prefer...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem :)

@jasonkeene
Copy link

I'd ask for the environment variable to be slightly more generic. Perhaps just EDITOR_INTEGRATION=true This will make it easier to get into vim-go as I don't think they want to special case ginkgo.

@joefitzgerald
Copy link
Contributor Author

joefitzgerald commented Aug 10, 2017

This is a very ginkgo specific thing.

I would imagine a non-specific variable like EDITOR_INTEGRATION would be harder and not easier to gain acceptance, because it is more likely to be “accidentally” in use?

I actually thought I might need to be even more specific (e.g. GINKGO_FOCUSED_COVERAGE), depending on feedback.

@onsi
Copy link
Owner

onsi commented Aug 10, 2017

i don't feel too strongly about what to call the env variable - perhaps get input from the vim-go maintainers?

@joefitzgerald can you add an integration test under /integration that asserts the exit code is zero for a suite with a focused test when the env variable is passed through? thanks!

@joefitzgerald
Copy link
Contributor Author

@onsi Integration test added.

@onsi onsi merged commit 11459a8 into onsi:master Aug 29, 2017
@onsi
Copy link
Owner

onsi commented Aug 29, 2017

Sweet thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants