Skip to content

Instantly share code, notes, and snippets.

@rodneyrehm
Created June 19, 2017 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodneyrehm/48b87ec596a095a0ab84d624f6d90d6a to your computer and use it in GitHub Desktop.
Save rodneyrehm/48b87ec596a095a0ab84d624f6d90d6a to your computer and use it in GitHub Desktop.
Sentry Raven injected test metadata
function addSeleniumTags () {
if (!window._SELENIUM_TEST_BUILD) {
return
}
Raven.setTagsContext({
'test.url': window._SELENIUM_BUILD_URL,
'test.job': window._SELENIUM_TEST_JOB,
'test.build': window._SELENIUM_TEST_BUILD,
'test.name': window._SELENIUM_TEST_NAME,
})
}
const _send = Raven._send
Raven._send = function () {
addSeleniumTags()
return _send.apply(this, arguments)
}
@rodneyrehm
Copy link
Author

never mind… we exposed Raven globally and will just call Raven.setTagsContext() from the Selenium test.

@benvinegar
Copy link

Yea, I'd probably do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment