summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-19 21:13:57 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-19 21:13:57 +0100
commitfa04b50b3c84e69765df7a0c9a182d9709ade398 (patch)
tree50af2b45cca9271715077c24222b4c671d0cb086 /spec/javascripts
parent9d29eb7e292067fb980b4ca97fc6c3edac1dccec (diff)
downloadgitlab-ce-fa04b50b3c84e69765df7a0c9a182d9709ade398.tar.gz
Read HEAD commit and use as releases value
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/raven/index_spec.js19
-rw-r--r--spec/javascripts/raven/raven_config_spec.js16
2 files changed, 17 insertions, 18 deletions
diff --git a/spec/javascripts/raven/index_spec.js b/spec/javascripts/raven/index_spec.js
index b5662cd0331..e8fe6b32c43 100644
--- a/spec/javascripts/raven/index_spec.js
+++ b/spec/javascripts/raven/index_spec.js
@@ -2,18 +2,14 @@ import RavenConfig from '~/raven/raven_config';
import index from '~/raven/index';
describe('RavenConfig options', () => {
- let sentryDsn;
- let currentUserId;
- let gitlabUrl;
- let isProduction;
+ const sentryDsn = 'sentryDsn';
+ const currentUserId = 'currentUserId';
+ const gitlabUrl = 'gitlabUrl';
+ const isProduction = 'isProduction';
+ const headCommitSHA = 'headCommitSHA';
let indexReturnValue;
beforeEach(() => {
- sentryDsn = 'sentryDsn';
- currentUserId = 'currentUserId';
- gitlabUrl = 'gitlabUrl';
- isProduction = 'isProduction';
-
window.gon = {
sentry_dsn: sentryDsn,
current_user_id: currentUserId,
@@ -21,6 +17,7 @@ describe('RavenConfig options', () => {
};
process.env.NODE_ENV = isProduction;
+ process.env.HEAD_COMMIT_SHA = headCommitSHA;
spyOn(RavenConfig, 'init');
@@ -33,6 +30,10 @@ describe('RavenConfig options', () => {
currentUserId,
whitelistUrls: [gitlabUrl],
isProduction,
+ release: headCommitSHA,
+ tags: {
+ HEAD_COMMIT_SHA: headCommitSHA,
+ },
});
});
diff --git a/spec/javascripts/raven/raven_config_spec.js b/spec/javascripts/raven/raven_config_spec.js
index a2d720760fc..d2f4f9ac6fb 100644
--- a/spec/javascripts/raven/raven_config_spec.js
+++ b/spec/javascripts/raven/raven_config_spec.js
@@ -25,17 +25,9 @@ describe('RavenConfig', () => {
});
describe('init', () => {
- let options;
+ const options = {};
beforeEach(() => {
- options = {
- sentryDsn: '//sentryDsn',
- ravenAssetUrl: '//ravenAssetUrl',
- currentUserId: 1,
- whitelistUrls: ['//gitlabUrl'],
- isProduction: true,
- };
-
spyOn(RavenConfig, 'configure');
spyOn(RavenConfig, 'bindRavenErrors');
spyOn(RavenConfig, 'setUser');
@@ -84,6 +76,10 @@ describe('RavenConfig', () => {
sentryDsn: '//sentryDsn',
whitelistUrls: ['//gitlabUrl'],
isProduction: true,
+ release: 'release',
+ tags: {
+ HEAD_COMMIT_SHA: 'headCommitSha',
+ },
};
ravenConfig = jasmine.createSpyObj('ravenConfig', ['shouldSendSample']);
@@ -100,6 +96,8 @@ describe('RavenConfig', () => {
it('should call Raven.config', () => {
expect(Raven.config).toHaveBeenCalledWith(options.sentryDsn, {
+ release: options.release,
+ tags: options.tags,
whitelistUrls: options.whitelistUrls,
environment: 'production',
ignoreErrors: ravenConfig.IGNORE_ERRORS,