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

Fix Ginkgo stack trace on failure for Specify #415

Merged
merged 1 commit into from
Dec 21, 2017

Conversation

williammartin
Copy link
Sponsor Collaborator

This changes the stack trace printed on failure to point at the failing test like It does, instead of into ginkgo_dsl.

Before:

/Users/pivotal/go/src/github.com/williammartin/ginkgoleaktest/ginkgoleaktest_test.go:8
  doesn't print the right stack trace [It]
  /Users/pivotal/go/src/github.com/onsi/ginkgo/ginkgo_dsl.go:365

  fail the test

  /Users/pivotal/go/src/github.com/williammartin/ginkgoleaktest/ginkgoleaktest_test.go:11

After:

Ginkgoleaktest
/Users/pivotal/go/src/github.com/williammartin/ginkgoleaktest/ginkgoleaktest_test.go:8
  doesn't print the right stack trace [It]
  /Users/pivotal/go/src/github.com/williammartin/ginkgoleaktest/ginkgoleaktest_test.go:10

  fail the test

  /Users/pivotal/go/src/github.com/williammartin/ginkgoleaktest/ginkgoleaktest_test.go:11

The diff is in the line after [It]. There might be a slightly more DRY way to do this by providing a utility method that pushes a node with an injectable codelocation, but I don't think it really makes things simpler.

[fixes #414]

@iandelahorne
Copy link
Collaborator

LGTM 👍

Copy link
Collaborator

@jvshahid jvshahid left a comment

Choose a reason for hiding this comment

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

Looks like something that we can test in the integration test, e.g. https://github.com/onsi/ginkgo/blob/master/integration/fail_test.go

I'm happy to write the test if you can't get it to it faster

@williammartin
Copy link
Sponsor Collaborator Author

Like it @jvshahid Maybe can get to it tomorrow. Won't be today.

@jvshahid jvshahid merged commit b977ede into onsi:master Dec 21, 2017
jvshahid added a commit that referenced this pull request Dec 21, 2017
Copy link
Collaborator

@jvshahid jvshahid left a comment

Choose a reason for hiding this comment

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

test was added in 65ca40e

jvshahid added a commit that referenced this pull request Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify prints an unpleasant stack trace on failure
3 participants