Commit 3a307671 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'master' into 27932-merge-request-pipelines-displays-json

* master:
  Revert "Merge branch 'add-additional-checks-to-ca-data' into 'master'"
  Fix broken test to use trigger in order to not take tooltip overlaping in consideration
  Fix job to pipeline renaming
  Replace teaspoon references with Karma
  Add changelog
  Only show MR widget graph if there are stages
  Fix tooltip scss for anchors. Adds css for button's tooltips to have similar behavior. Removes padding from mini graph table cell to guarantee stages don't break line on hover
  moved hyperlink reference section at the end of the content
  adds changelog
  fixes frontend doc broken link
parents 86558d53 58131ac9
...@@ -97,7 +97,7 @@ $(() => { ...@@ -97,7 +97,7 @@ $(() => {
} }
this.isLoadingStage = true; this.isLoadingStage = true;
cycleAnalyticsStore.setStageEvents([], stage); cycleAnalyticsStore.setStageEvents([]);
cycleAnalyticsStore.setActiveStage(stage); cycleAnalyticsStore.setActiveStage(stage);
cycleAnalyticsService cycleAnalyticsService
...@@ -107,7 +107,7 @@ $(() => { ...@@ -107,7 +107,7 @@ $(() => {
}) })
.done((response) => { .done((response) => {
this.isEmptyStage = !response.events.length; this.isEmptyStage = !response.events.length;
cycleAnalyticsStore.setStageEvents(response.events, stage); cycleAnalyticsStore.setStageEvents(response.events);
}) })
.error(() => { .error(() => {
this.isEmptyStage = true; this.isEmptyStage = true;
......
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
require('../lib/utils/text_utility');
const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
...@@ -38,12 +34,11 @@ const DEFAULT_EVENT_OBJECTS = require('./default_event_objects'); ...@@ -38,12 +34,11 @@ const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
}); });
newData.stages.forEach((item) => { newData.stages.forEach((item) => {
const stageSlug = gl.text.dasherize(item.title.toLowerCase()); const stageName = item.title.toLowerCase();
item.active = false; item.active = false;
item.isUserAllowed = data.permissions[stageSlug]; item.isUserAllowed = data.permissions[stageName];
item.emptyStageText = EMPTY_STAGE_TEXTS[stageSlug]; item.emptyStageText = EMPTY_STAGE_TEXTS[stageName];
item.component = `stage-${stageSlug}-component`; item.component = `stage-${stageName}-component`;
item.slug = stageSlug;
}); });
newData.analytics = data; newData.analytics = data;
return newData; return newData;
...@@ -63,33 +58,31 @@ const DEFAULT_EVENT_OBJECTS = require('./default_event_objects'); ...@@ -63,33 +58,31 @@ const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
this.deactivateAllStages(); this.deactivateAllStages();
stage.active = true; stage.active = true;
}, },
setStageEvents(events, stage) { setStageEvents(events) {
this.state.events = this.decorateEvents(events, stage); this.state.events = this.decorateEvents(events);
}, },
decorateEvents(events, stage) { decorateEvents(events) {
const newEvents = []; const newEvents = [];
events.forEach((item) => { events.forEach((item) => {
if (!item) return; if (!item) return;
const eventItem = Object.assign({}, DEFAULT_EVENT_OBJECTS[stage.slug], item); item.totalTime = item.total_time;
item.author.webUrl = item.author.web_url;
eventItem.totalTime = eventItem.total_time; item.author.avatarUrl = item.author.avatar_url;
eventItem.author.webUrl = eventItem.author.web_url;
eventItem.author.avatarUrl = eventItem.author.avatar_url;
if (eventItem.created_at) eventItem.createdAt = eventItem.created_at; if (item.created_at) item.createdAt = item.created_at;
if (eventItem.short_sha) eventItem.shortSha = eventItem.short_sha; if (item.short_sha) item.shortSha = item.short_sha;
if (eventItem.commit_url) eventItem.commitUrl = eventItem.commit_url; if (item.commit_url) item.commitUrl = item.commit_url;
delete eventItem.author.web_url; delete item.author.web_url;
delete eventItem.author.avatar_url; delete item.author.avatar_url;
delete eventItem.total_time; delete item.total_time;
delete eventItem.created_at; delete item.created_at;
delete eventItem.short_sha; delete item.short_sha;
delete eventItem.commit_url; delete item.commit_url;
newEvents.push(eventItem); newEvents.push(item);
}); });
return newEvents; return newEvents;
......
module.exports = {
issue: {
created_at: '',
url: '',
iid: '',
title: '',
total_time: {},
author: {
avatar_url: '',
id: '',
name: '',
web_url: '',
},
},
plan: {
title: '',
commit_url: '',
short_sha: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
code: {
title: '',
iid: '',
created_at: '',
url: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
test: {
name: '',
id: '',
date: '',
url: '',
short_sha: '',
commit_url: '',
total_time: {},
branch: {
name: '',
url: '',
},
},
review: {
title: '',
iid: '',
created_at: '',
url: '',
state: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
staging: {
id: '',
short_sha: '',
date: '',
url: '',
commit_url: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
branch: {
name: '',
url: '',
},
},
production: {
title: '',
created_at: '',
url: '',
iid: '',
total_time: {},
author: {
name: '',
id: '',
avatar_url: '',
web_url: '',
},
},
};
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len */
require('vendor/latinise');
(function() { (function() {
(function(w) { (function(w) {
var base; var base;
...@@ -166,14 +164,8 @@ require('vendor/latinise'); ...@@ -166,14 +164,8 @@ require('vendor/latinise');
gl.text.pluralize = function(str, count) { gl.text.pluralize = function(str, count) {
return str + (count > 1 || count === 0 ? 's' : ''); return str + (count > 1 || count === 0 ? 's' : '');
}; };
gl.text.truncate = function(string, maxLength) { return gl.text.truncate = function(string, maxLength) {
return string.substr(0, (maxLength - 3)) + '...'; return string.substr(0, (maxLength - 3)) + '...';
}; };
gl.text.dasherize = function(str) {
return str.replace(/[_\s]+/g, '-');
};
gl.text.slugify = function(str) {
return str.trim().toLowerCase().latinise();
};
})(window); })(window);
}).call(this); }).call(this);
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
/* global Breakpoints */ /* global Breakpoints */
require('vendor/latinise');
require('./breakpoints'); require('./breakpoints');
require('vendor/jquery.nicescroll'); require('vendor/jquery.nicescroll');
((global) => { ((global) => {
const dasherize = str => str.replace(/[_\s]+/g, '-');
const slugify = str => dasherize(str.trim().toLowerCase().latinise());
class Wikis { class Wikis {
constructor() { constructor() {
this.bp = Breakpoints.get(); this.bp = Breakpoints.get();
...@@ -30,7 +34,7 @@ require('vendor/jquery.nicescroll'); ...@@ -30,7 +34,7 @@ require('vendor/jquery.nicescroll');
if (!this.newWikiForm) return; if (!this.newWikiForm) return;
const slugInput = this.newWikiForm.querySelector('#new_wiki_path'); const slugInput = this.newWikiForm.querySelector('#new_wiki_path');
const slug = gl.text.slugify(slugInput.value); const slug = slugify(slugInput.value);
if (slug.length > 0) { if (slug.length > 0) {
const wikisPath = slugInput.getAttribute('data-wikis-path'); const wikisPath = slugInput.getAttribute('data-wikis-path');
......
...@@ -94,6 +94,10 @@ ...@@ -94,6 +94,10 @@
padding: 10px 8px; padding: 10px 8px;
} }
td.stage-cell {
padding: 10px 0;
}
.commit-link { .commit-link {
padding: 9px 8px 10px; padding: 9px 8px 10px;
} }
...@@ -291,12 +295,14 @@ ...@@ -291,12 +295,14 @@
height: 22px; height: 22px;
margin: 3px 6px 3px 0; margin: 3px 6px 3px 0;
.tooltip { // Hack to show a button tooltip inline
white-space: nowrap; button.has-tooltip + .tooltip {
min-width: 105px;
} }
.tooltip-inner { // Bootstrap way of showing the content inline for anchors.
padding: 3px 4px; a.has-tooltip {
white-space: nowrap;
} }
&:not(:last-child) { &:not(:last-child) {
......
...@@ -2,7 +2,6 @@ class AnalyticsStageEntity < Grape::Entity ...@@ -2,7 +2,6 @@ class AnalyticsStageEntity < Grape::Entity
include EntityDateHelper include EntityDateHelper
expose :title expose :title
expose :legend
expose :description expose :description
expose :median, as: :value do |stage| expose :median, as: :value do |stage|
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
- else - else
%span.api.monospace API %span.api.monospace API
- if pipeline.latest? - if pipeline.latest?
%span.label.label-success.has-tooltip{ title: 'Latest job for this branch' } latest %span.label.label-success.has-tooltip{ title: 'Latest pipeline for this branch' } latest
- if pipeline.triggered? - if pipeline.triggered?
%span.label.label-primary triggered %span.label.label-primary triggered
- if pipeline.yaml_errors.present? - if pipeline.yaml_errors.present?
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
.btn-group.inline .btn-group.inline
- if actions.any? - if actions.any?
.btn-group .btn-group
%button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual job', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual job' } %button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual pipeline', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual pipeline' }
= custom_icon('icon_play') = custom_icon('icon_play')
= icon('caret-down', 'aria-hidden' => 'true') = icon('caret-down', 'aria-hidden' => 'true')
%ul.dropdown-menu.dropdown-menu-align-right %ul.dropdown-menu.dropdown-menu-align-right
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
Pipeline Pipeline
= link_to "##{@pipeline.id}", namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'pipeline' = link_to "##{@pipeline.id}", namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'pipeline'
= ci_label_for_status(status) = ci_label_for_status(status)
- if @pipeline.stages.any?
.mr-widget-pipeline-graph .mr-widget-pipeline-graph
= render 'shared/mini_pipeline_graph', pipeline: @pipeline, klass: 'js-pipeline-inline-mr-widget-graph' = render 'shared/mini_pipeline_graph', pipeline: @pipeline, klass: 'js-pipeline-inline-mr-widget-graph'
%span %span
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
ci_status: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.status : ''}", ci_status: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.status : ''}",
ci_message: { ci_message: {
normal: "Pipeline {{status}} for \"{{title}}\"", normal: "Pipeline {{status}} for \"{{title}}\"",
preparing: "{{status}} job for \"{{title}}\"" preparing: "{{status}} pipeline for \"{{title}}\""
}, },
ci_enable: #{@project.ci_service ? "true" : "false"}, ci_enable: #{@project.ci_service ? "true" : "false"},
ci_title: { ci_title: {
preparing: "{{status}} job", preparing: "{{status}} pipeline",
normal: "Pipeline {{status}}" normal: "Pipeline {{status}}"
}, },
ci_sha: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.short_sha : ''}", ci_sha: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.short_sha : ''}",
......
%h4 %h4
= icon('exclamation-triangle') = icon('exclamation-triangle')
The job for this merge request failed The pipeline for this merge request failed
%p %p
Please retry the job or push a new commit to fix the failure. Please retry the job or push a new commit to fix the failure.
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
In the In the
%code .gitlab-ci.yml %code .gitlab-ci.yml
of another project, include the following snippet. of another project, include the following snippet.
The project will be rebuilt at the end of the job. The project will be rebuilt at the end of the pipeline.
%pre %pre
:plain :plain
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
%p.light %p.light
Add Add
%code variables[VARIABLE]=VALUE %code variables[VARIABLE]=VALUE
to an API request. Variable values can be used to distinguish between triggered jobs and normal jobs. to an API request. Variable values can be used to distinguish between triggered pipelines and normal pipelines.
With cURL: With cURL:
......
---
title: Fixes FE Doc broken link
merge_request: 9120
author:
---
title: Fix tooltips in mini pipeline graph
merge_request:
author:
---
title: Show pipeline graph in MR widget if there are any stages
merge_request:
author:
---
title: Fix job to pipeline renaming
merge_request: 9147
author:
...@@ -50,7 +50,7 @@ Let's look into each of them: ...@@ -50,7 +50,7 @@ Let's look into each of them:
This is the index file of your new feature. This is where the root Vue instance This is the index file of your new feature. This is where the root Vue instance
of the new feature should be. of the new feature should be.
Don't forget to follow [these steps.][page-specific-javascript] Don't forget to follow [these steps.][page_specific_javascript]
**A folder for Components** **A folder for Components**
...@@ -250,23 +250,17 @@ information. ...@@ -250,23 +250,17 @@ information.
### Running frontend tests ### Running frontend tests
`rake teaspoon` runs the frontend-only (JavaScript) tests. `rake karma` runs the frontend-only (JavaScript) tests.
It consists of two subtasks: It consists of two subtasks:
- `rake teaspoon:fixtures` (re-)generates fixtures - `rake karma:fixtures` (re-)generates fixtures
- `rake teaspoon:tests` actually executes the tests - `rake karma:tests` actually executes the tests
As long as the fixtures don't change, `rake teaspoon:tests` is sufficient As long as the fixtures don't change, `rake karma:tests` is sufficient
(and saves you some time). (and saves you some time).
If you need to debug your tests and/or application code while they're
running, navigate to [localhost:3000/teaspoon](http://localhost:3000/teaspoon)
in your browser, open DevTools, and run tests for individual files by clicking
on them. This is also much faster than setting up and running tests from the
command line.
Please note: Not all of the frontend fixtures are generated. Some are still static Please note: Not all of the frontend fixtures are generated. Some are still static
files. These will not be touched by `rake teaspoon:fixtures`. files. These will not be touched by `rake karma:fixtures`.
## Design Patterns ## Design Patterns
...@@ -323,54 +317,13 @@ gl.MyThing = MyThing; ...@@ -323,54 +317,13 @@ gl.MyThing = MyThing;
For our currently-supported browsers, see our [requirements][requirements]. For our currently-supported browsers, see our [requirements][requirements].
[rails]: http://rubyonrails.org/
[haml]: http://haml.info/
[hamlit]: https://github.com/k0kubun/hamlit
[hamlit-limits]: https://github.com/k0kubun/hamlit/blob/master/REFERENCE.md#limitations
[scss]: http://sass-lang.com/
[es6]: https://babeljs.io/
[sprockets]: https://github.com/rails/sprockets
[jquery]: https://jquery.com/
[vue]: http://vuejs.org/
[vue-docs]: http://vuejs.org/guide/index.html
[web-page-test]: http://www.webpagetest.org/
[pagespeed-insights]: https://developers.google.com/speed/pagespeed/insights/
[google-devtools-profiling]: https://developers.google.com/web/tools/chrome-devtools/profile/?hl=en
[browser-diet]: https://browserdiet.com/
[d3]: https://d3js.org/
[chartjs]: http://www.chartjs.org/
[page-specific-js-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/13bb9ed77f405c5f6ee4fdbc964ecf635c9a223f/app/views/projects/graphs/_head.html.haml#L6-8
[chrome-accessibility-developer-tools]: https://github.com/GoogleChrome/accessibility-developer-tools
[audit-rules]: https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules
[observatory-cli]: https://github.com/mozilla/http-observatory-cli
[qualys-ssl]: https://www.ssllabs.com/ssltest/analyze.html
[secure_headers]: https://github.com/twitter/secureheaders
[mdn-csp]: https://developer.mozilla.org/en-US/docs/Web/Security/CSP
[github-eng-csp]: http://githubengineering.com/githubs-csp-journey/
[dropbox-csp-1]: https://blogs.dropbox.com/tech/2015/09/on-csp-reporting-and-filtering/
[dropbox-csp-2]: https://blogs.dropbox.com/tech/2015/09/unsafe-inline-and-nonce-deployment/
[dropbox-csp-3]: https://blogs.dropbox.com/tech/2015/09/csp-the-unexpected-eval/
[dropbox-csp-4]: https://blogs.dropbox.com/tech/2015/09/csp-third-party-integrations-and-privilege-separation/
[mdn-sri]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
[github-eng-sri]: http://githubengineering.com/subresource-integrity/
[sprockets-sri]: https://github.com/rails/sprockets-rails#sri-support
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
[scss-style-guide]: scss_styleguide.md
[requirements]: ../install/requirements.md#supported-web-browsers
[issue-boards]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/boards
[environments-table]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/environments
[page_specific_javascript]: https://docs.gitlab.com/ce/development/frontend.html#page-specific-javascript
[component-system]: https://vuejs.org/v2/guide/#Composing-with-Components
[state-management]: https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch
[vue-resource-repo]: https://github.com/pagekit/vue-resource
[issue-boards-service]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/boards/services/board_service.js.es6
## Gotchas ## Gotchas
### Spec errors due to use of ES6 features in `.js` files ### Spec errors due to use of ES6 features in `.js` files
If you see very generic JavaScript errors (e.g. `jQuery is undefined`) being If you see very generic JavaScript errors (e.g. `jQuery is undefined`) being
thrown in Teaspoon, Spinach, or Rspec tests but can't reproduce them manually, thrown in Karma, Spinach, or Rspec tests but can't reproduce them manually,
you may have included `ES6`-style JavaScript in files that don't have the you may have included `ES6`-style JavaScript in files that don't have the
`.js.es6` file extension. Either use ES5-friendly JavaScript or rename the file `.js.es6` file extension. Either use ES5-friendly JavaScript or rename the file
you're working in (`git mv <file.js> <file.js.es6>`). you're working in (`git mv <file.js> <file.js.es6>`).
...@@ -438,3 +391,46 @@ Scenario: Developer can approve merge request ...@@ -438,3 +391,46 @@ Scenario: Developer can approve merge request
Then I should see approved merge request "Bug NS-04" Then I should see approved merge request "Bug NS-04"
``` ```
[rails]: http://rubyonrails.org/
[haml]: http://haml.info/
[hamlit]: https://github.com/k0kubun/hamlit
[hamlit-limits]: https://github.com/k0kubun/hamlit/blob/master/REFERENCE.md#limitations
[scss]: http://sass-lang.com/
[es6]: https://babeljs.io/
[sprockets]: https://github.com/rails/sprockets
[jquery]: https://jquery.com/
[vue]: http://vuejs.org/
[vue-docs]: http://vuejs.org/guide/index.html
[web-page-test]: http://www.webpagetest.org/
[pagespeed-insights]: https://developers.google.com/speed/pagespeed/insights/
[google-devtools-profiling]: https://developers.google.com/web/tools/chrome-devtools/profile/?hl=en
[browser-diet]: https://browserdiet.com/
[d3]: https://d3js.org/
[chartjs]: http://www.chartjs.org/
[page-specific-js-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/13bb9ed77f405c5f6ee4fdbc964ecf635c9a223f/app/views/projects/graphs/_head.html.haml#L6-8
[chrome-accessibility-developer-tools]: https://github.com/GoogleChrome/accessibility-developer-tools
[audit-rules]: https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules
[observatory-cli]: https://github.com/mozilla/http-observatory-cli
[qualys-ssl]: https://www.ssllabs.com/ssltest/analyze.html
[secure_headers]: https://github.com/twitter/secureheaders
[mdn-csp]: https://developer.mozilla.org/en-US/docs/Web/Security/CSP
[github-eng-csp]: http://githubengineering.com/githubs-csp-journey/
[dropbox-csp-1]: https://blogs.dropbox.com/tech/2015/09/on-csp-reporting-and-filtering/
[dropbox-csp-2]: https://blogs.dropbox.com/tech/2015/09/unsafe-inline-and-nonce-deployment/
[dropbox-csp-3]: https://blogs.dropbox.com/tech/2015/09/csp-the-unexpected-eval/
[dropbox-csp-4]: https://blogs.dropbox.com/tech/2015/09/csp-third-party-integrations-and-privilege-separation/
[mdn-sri]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
[github-eng-sri]: http://githubengineering.com/subresource-integrity/
[sprockets-sri]: https://github.com/rails/sprockets-rails#sri-support
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
[scss-style-guide]: scss_styleguide.md
[requirements]: ../install/requirements.md#supported-web-browsers
[issue-boards]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/boards
[environments-table]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/environments
[page_specific_javascript]: https://docs.gitlab.com/ce/development/frontend.html#page-specific-javascript
[component-system]: https://vuejs.org/v2/guide/#Composing-with-Components
[state-management]: https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch
[vue-resource-repo]: https://github.com/pagekit/vue-resource
[issue-boards-service]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/boards/services/board_service.js.es6
...@@ -17,7 +17,7 @@ Note: `db:setup` calls `db:seed` but this does nothing. ...@@ -17,7 +17,7 @@ Note: `db:setup` calls `db:seed` but this does nothing.
In order to run the test you can use the following commands: In order to run the test you can use the following commands:
- `rake spinach` to run the spinach suite - `rake spinach` to run the spinach suite
- `rake spec` to run the rspec suite - `rake spec` to run the rspec suite
- `rake teaspoon` to run the teaspoon test suite - `rake karma` to run the karma test suite
- `rake gitlab:test` to run all the tests - `rake gitlab:test` to run all the tests
Note: Both `rake spinach` and `rake spec` takes significant time to pass. Note: Both `rake spinach` and `rake spec` takes significant time to pass.
......
...@@ -31,9 +31,8 @@ GitLab uses [factory_girl] as a test fixture replacement. ...@@ -31,9 +31,8 @@ GitLab uses [factory_girl] as a test fixture replacement.
## JavaScript ## JavaScript
GitLab uses [Teaspoon] to run its [Jasmine] JavaScript specs. They can be run on GitLab uses [Karma] to run its [Jasmine] JavaScript specs. They can be run on
the command line via `bundle exec teaspoon`, or via a web browser at the command line via `bundle exec karma`.
`http://localhost:3000/teaspoon` when the Rails server is running.
- JavaScript tests live in `spec/javascripts/`, matching the folder structure of - JavaScript tests live in `spec/javascripts/`, matching the folder structure of
`app/assets/javascripts/`: `app/assets/javascripts/behaviors/autosize.js.es6` has a corresponding `app/assets/javascripts/`: `app/assets/javascripts/behaviors/autosize.js.es6` has a corresponding
...@@ -51,7 +50,7 @@ the command line via `bundle exec teaspoon`, or via a web browser at ...@@ -51,7 +50,7 @@ the command line via `bundle exec teaspoon`, or via a web browser at
[`Notification`](https://developer.mozilla.org/en-US/docs/Web/API/notification), [`Notification`](https://developer.mozilla.org/en-US/docs/Web/API/notification),
which will have to be stubbed. which will have to be stubbed.
[Teaspoon]: https://github.com/modeset/teaspoon [Karma]: https://github.com/karma-runner/karma
[Jasmine]: https://github.com/jasmine/jasmine [Jasmine]: https://github.com/jasmine/jasmine
## RSpec ## RSpec
......
...@@ -13,10 +13,6 @@ module Gitlab ...@@ -13,10 +13,6 @@ module Gitlab
:code :code
end end
def legend
"Related Merge Requests"
end
def description def description
"Time until first merge request" "Time until first merge request"
end end
......
...@@ -14,10 +14,6 @@ module Gitlab ...@@ -14,10 +14,6 @@ module Gitlab
:issue :issue
end end
def legend
"Related Issues"
end
def description def description
"Time before an issue gets scheduled" "Time before an issue gets scheduled"
end end
......
...@@ -14,10 +14,6 @@ module Gitlab ...@@ -14,10 +14,6 @@ module Gitlab
:plan :plan
end end
def legend
"Related Commits"
end
def description def description
"Time before an issue starts implementation" "Time before an issue starts implementation"
end end
......
...@@ -15,10 +15,6 @@ module Gitlab ...@@ -15,10 +15,6 @@ module Gitlab
:production :production
end end
def legend
"Related Issues"
end
def description def description
"From issue creation until deploy to production" "From issue creation until deploy to production"
end end
......
...@@ -13,10 +13,6 @@ module Gitlab ...@@ -13,10 +13,6 @@ module Gitlab
:review :review
end end
def legend
"Relative Merged Requests"
end
def description def description
"Time between merge request creation and merge/close" "Time between merge request creation and merge/close"
end end
......
...@@ -14,10 +14,6 @@ module Gitlab ...@@ -14,10 +14,6 @@ module Gitlab
:staging :staging
end end
def legend
"Relative Deployed Builds"
end
def description def description
"From merge request merge until deploy to production" "From merge request merge until deploy to production"
end end
......
...@@ -13,10 +13,6 @@ module Gitlab ...@@ -13,10 +13,6 @@ module Gitlab
:test :test
end end
def legend
"Relative Builds Trigger by Commits"
end
def description def description
"Total test time for all commits/merges" "Total test time for all commits/merges"
end end
......
...@@ -66,7 +66,7 @@ feature 'Mini Pipeline Graph', :js, :feature do ...@@ -66,7 +66,7 @@ feature 'Mini Pipeline Graph', :js, :feature do
end end
it 'should close when toggle is clicked again' do it 'should close when toggle is clicked again' do
toggle.click toggle.trigger('click')
expect(toggle.find(:xpath, '..')).not_to have_selector('.mini-pipeline-graph-dropdown-menu') expect(toggle.find(:xpath, '..')).not_to have_selector('.mini-pipeline-graph-dropdown-menu')
end end
......
...@@ -40,7 +40,7 @@ require('~/behaviors/quick_submit'); ...@@ -40,7 +40,7 @@ require('~/behaviors/quick_submit');
expect($('input[type=submit]')).toBeDisabled(); expect($('input[type=submit]')).toBeDisabled();
return expect($('button[type=submit]')).toBeDisabled(); return expect($('button[type=submit]')).toBeDisabled();
}); });
// We cannot stub `navigator.userAgent` for CI's `rake teaspoon` task, so we'll // We cannot stub `navigator.userAgent` for CI's `rake karma` task, so we'll
// only run the tests that apply to the current platform // only run the tests that apply to the current platform
if (navigator.userAgent.match(/Macintosh/)) { if (navigator.userAgent.match(/Macintosh/)) {
it('responds to Meta+Enter', function() { it('responds to Meta+Enter', function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment