diff options
author | Phil Hughes <me@iamphill.com> | 2019-07-19 17:23:41 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-07-19 17:23:41 +0300 |
commit | b83a4f8327caa93b4857aacceff95d44c214702c (patch) | |
tree | 8c6d31fd41748c42b9a488aa159f98484cb583d2 /spec | |
parent | 4c30b0a1cf5ead26d20845b82ae528fcbdf98728 (diff) | |
parent | 444a3627b6d469819f33e875dc194765d6b55b8e (diff) |
Merge branch '64722-mg-export-frontend-fixtures' into 'master'
Resolve "Export frontend fixtures as pipeline artifact"
Closes #64722 and #59166
See merge request gitlab-org/gitlab-ce!30917
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/environment.js | 8 | ||||
-rw-r--r-- | spec/frontend/fixtures/abuse_reports.rb (renamed from spec/javascripts/fixtures/abuse_reports.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/admin_users.rb (renamed from spec/javascripts/fixtures/admin_users.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/application_settings.rb (renamed from spec/javascripts/fixtures/application_settings.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/autocomplete_sources.rb (renamed from spec/javascripts/fixtures/autocomplete_sources.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/blob.rb (renamed from spec/javascripts/fixtures/blob.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/boards.rb (renamed from spec/javascripts/fixtures/boards.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/branches.rb (renamed from spec/javascripts/fixtures/branches.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/clusters.rb (renamed from spec/javascripts/fixtures/clusters.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/commit.rb (renamed from spec/javascripts/fixtures/commit.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/deploy_keys.rb (renamed from spec/javascripts/fixtures/deploy_keys.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/groups.rb (renamed from spec/javascripts/fixtures/groups.rb) | 4 | ||||
-rw-r--r-- | spec/frontend/fixtures/issues.rb (renamed from spec/javascripts/fixtures/issues.rb) | 6 | ||||
-rw-r--r-- | spec/frontend/fixtures/jobs.rb (renamed from spec/javascripts/fixtures/jobs.rb) | 4 | ||||
-rw-r--r-- | spec/frontend/fixtures/labels.rb (renamed from spec/javascripts/fixtures/labels.rb) | 4 | ||||
-rw-r--r-- | spec/frontend/fixtures/merge_requests.rb (renamed from spec/javascripts/fixtures/merge_requests.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/merge_requests_diffs.rb (renamed from spec/javascripts/fixtures/merge_requests_diffs.rb) | 3 | ||||
-rw-r--r-- | spec/frontend/fixtures/pipeline_schedules.rb (renamed from spec/javascripts/fixtures/pipeline_schedules.rb) | 4 | ||||
-rw-r--r-- | spec/frontend/fixtures/pipelines.rb (renamed from spec/javascripts/fixtures/pipelines.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/projects.rb (renamed from spec/javascripts/fixtures/projects.rb) | 12 | ||||
-rw-r--r-- | spec/frontend/fixtures/prometheus_service.rb (renamed from spec/javascripts/fixtures/prometheus_service.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/raw.rb (renamed from spec/javascripts/fixtures/raw.rb) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/search.rb (renamed from spec/javascripts/fixtures/search.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/services.rb (renamed from spec/javascripts/fixtures/services.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/sessions.rb (renamed from spec/javascripts/fixtures/sessions.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/snippet.rb (renamed from spec/javascripts/fixtures/snippet.rb) | 2 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/README.md | 3 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/ajax_loading_spinner.html (renamed from spec/javascripts/fixtures/static/ajax_loading_spinner.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/balsamiq_viewer.html (renamed from spec/javascripts/fixtures/static/balsamiq_viewer.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/create_item_dropdown.html (renamed from spec/javascripts/fixtures/static/create_item_dropdown.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/environments/table.html (renamed from spec/javascripts/fixtures/static/environments/table.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/environments_logs.html | 29 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/event_filter.html (renamed from spec/javascripts/fixtures/static/event_filter.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/gl_dropdown.html (renamed from spec/javascripts/fixtures/static/gl_dropdown.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/gl_field_errors.html (renamed from spec/javascripts/fixtures/static/gl_field_errors.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/images/green_box.png (renamed from spec/javascripts/fixtures/static/images/green_box.png) | bin | 1306 -> 1306 bytes | |||
-rw-r--r-- | spec/frontend/fixtures/static/images/one_white_pixel.png (renamed from spec/javascripts/fixtures/static/images/one_white_pixel.png) | bin | 68 -> 68 bytes | |||
-rw-r--r-- | spec/frontend/fixtures/static/images/red_box.png (renamed from spec/javascripts/fixtures/static/images/red_box.png) | bin | 1305 -> 1305 bytes | |||
-rw-r--r-- | spec/frontend/fixtures/static/issuable_filter.html (renamed from spec/javascripts/fixtures/static/issuable_filter.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/issue_sidebar_label.html (renamed from spec/javascripts/fixtures/static/issue_sidebar_label.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/line_highlighter.html (renamed from spec/javascripts/fixtures/static/line_highlighter.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/linked_tabs.html (renamed from spec/javascripts/fixtures/static/linked_tabs.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/merge_requests_show.html (renamed from spec/javascripts/fixtures/static/merge_requests_show.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/mini_dropdown_graph.html (renamed from spec/javascripts/fixtures/static/mini_dropdown_graph.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/notebook_viewer.html (renamed from spec/javascripts/fixtures/static/notebook_viewer.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/oauth_remember_me.html (renamed from spec/javascripts/fixtures/static/oauth_remember_me.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/pdf_viewer.html (renamed from spec/javascripts/fixtures/static/pdf_viewer.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/pipeline_graph.html (renamed from spec/javascripts/fixtures/static/pipeline_graph.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/pipelines.html (renamed from spec/javascripts/fixtures/static/pipelines.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/project_select_combo_button.html (renamed from spec/javascripts/fixtures/static/project_select_combo_button.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/projects.json (renamed from spec/javascripts/fixtures/static/projects.json) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/search_autocomplete.html (renamed from spec/javascripts/fixtures/static/search_autocomplete.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/signin_tabs.html (renamed from spec/javascripts/fixtures/static/signin_tabs.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/static/sketch_viewer.html (renamed from spec/javascripts/fixtures/static/sketch_viewer.html) | 0 | ||||
-rw-r--r-- | spec/frontend/fixtures/todos.rb (renamed from spec/javascripts/fixtures/todos.rb) | 4 | ||||
-rw-r--r-- | spec/frontend/fixtures/u2f.rb (renamed from spec/javascripts/fixtures/u2f.rb) | 4 | ||||
-rw-r--r-- | spec/frontend/helpers/fixtures.js | 7 | ||||
-rw-r--r-- | spec/javascripts/fixtures/.gitignore | 7 | ||||
-rw-r--r-- | spec/javascripts/fixtures/static/README.md | 3 | ||||
-rw-r--r-- | spec/javascripts/test_constants.js | 4 | ||||
-rw-r--r-- | spec/support/helpers/javascript_fixtures_helpers.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers/test_env.rb | 3 |
62 files changed, 88 insertions, 57 deletions
diff --git a/spec/frontend/environment.js b/spec/frontend/environment.js index a8c8688441d..290c0e797cb 100644 --- a/spec/frontend/environment.js +++ b/spec/frontend/environment.js @@ -1,8 +1,11 @@ /* eslint-disable import/no-commonjs */ +const path = require('path'); const { ErrorWithStack } = require('jest-util'); const JSDOMEnvironment = require('jest-environment-jsdom'); +const ROOT_PATH = path.resolve(__dirname, '../..'); + class CustomEnvironment extends JSDOMEnvironment { constructor(config, context) { super(config, context); @@ -35,9 +38,8 @@ class CustomEnvironment extends JSDOMEnvironment { this.rejectedPromises.push(error); }; - this.global.fixturesBasePath = `${process.cwd()}/${ - IS_EE ? 'ee/' : '' - }spec/javascripts/fixtures`; + this.global.fixturesBasePath = `${ROOT_PATH}/tmp/tests/frontend/fixtures${IS_EE ? '-ee' : ''}`; + this.global.staticFixturesBasePath = `${ROOT_PATH}/spec/frontend/fixtures`; // Not yet supported by JSDOM: https://github.com/jsdom/jsdom/issues/317 this.global.document.createRange = () => ({ diff --git a/spec/javascripts/fixtures/abuse_reports.rb b/spec/frontend/fixtures/abuse_reports.rb index e0aaecf626a..21356390cae 100644 --- a/spec/javascripts/fixtures/abuse_reports.rb +++ b/spec/frontend/fixtures/abuse_reports.rb @@ -21,6 +21,6 @@ describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :controll it 'abuse_reports/abuse_reports_list.html' do get :index - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/admin_users.rb b/spec/frontend/fixtures/admin_users.rb index 22a5de66577..0209594dadc 100644 --- a/spec/javascripts/fixtures/admin_users.rb +++ b/spec/frontend/fixtures/admin_users.rb @@ -23,6 +23,6 @@ describe Admin::UsersController, '(JavaScript fixtures)', type: :controller do get :new - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/application_settings.rb b/spec/frontend/fixtures/application_settings.rb index d4651fa6ece..38a060580c1 100644 --- a/spec/javascripts/fixtures/application_settings.rb +++ b/spec/frontend/fixtures/application_settings.rb @@ -28,6 +28,6 @@ describe Admin::ApplicationSettingsController, '(JavaScript fixtures)', type: :c get :show - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/autocomplete_sources.rb b/spec/frontend/fixtures/autocomplete_sources.rb index b20a0159d7d..9e04328e2b9 100644 --- a/spec/javascripts/fixtures/autocomplete_sources.rb +++ b/spec/frontend/fixtures/autocomplete_sources.rb @@ -34,6 +34,6 @@ describe Projects::AutocompleteSourcesController, '(JavaScript fixtures)', type: type_id: issue.id } - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/blob.rb b/spec/frontend/fixtures/blob.rb index 07670552cd5..ce5030efbf8 100644 --- a/spec/javascripts/fixtures/blob.rb +++ b/spec/frontend/fixtures/blob.rb @@ -29,6 +29,6 @@ describe Projects::BlobController, '(JavaScript fixtures)', type: :controller do id: 'add-ipython-files/files/ipython/basic.ipynb' }) - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/boards.rb b/spec/frontend/fixtures/boards.rb index 5835721d3d5..f257d80390f 100644 --- a/spec/javascripts/fixtures/boards.rb +++ b/spec/frontend/fixtures/boards.rb @@ -23,6 +23,6 @@ describe Projects::BoardsController, '(JavaScript fixtures)', type: :controller project_id: project }) - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/branches.rb b/spec/frontend/fixtures/branches.rb index 204aa9b7c7a..197fe42c52a 100644 --- a/spec/javascripts/fixtures/branches.rb +++ b/spec/frontend/fixtures/branches.rb @@ -27,6 +27,6 @@ describe Projects::BranchesController, '(JavaScript fixtures)', type: :controlle project_id: project } - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/clusters.rb b/spec/frontend/fixtures/clusters.rb index 1076404e0e3..f15ef010807 100644 --- a/spec/javascripts/fixtures/clusters.rb +++ b/spec/frontend/fixtures/clusters.rb @@ -29,6 +29,6 @@ describe Projects::ClustersController, '(JavaScript fixtures)', type: :controlle id: cluster } - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/commit.rb b/spec/frontend/fixtures/commit.rb index ff9a4bc1adc..a328c455356 100644 --- a/spec/javascripts/fixtures/commit.rb +++ b/spec/frontend/fixtures/commit.rb @@ -28,6 +28,6 @@ describe Projects::CommitController, '(JavaScript fixtures)', type: :controller get :show, params: params - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/deploy_keys.rb b/spec/frontend/fixtures/deploy_keys.rb index 38eab853da2..fca233c6f59 100644 --- a/spec/javascripts/fixtures/deploy_keys.rb +++ b/spec/frontend/fixtures/deploy_keys.rb @@ -38,6 +38,6 @@ describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :control project_id: project }, format: :json - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/groups.rb b/spec/frontend/fixtures/groups.rb index 4d0afc3ce1a..c1bb2d43332 100644 --- a/spec/javascripts/fixtures/groups.rb +++ b/spec/frontend/fixtures/groups.rb @@ -21,7 +21,7 @@ describe 'Groups (JavaScript fixtures)', type: :controller do it 'groups/edit.html' do get :edit, params: { id: group } - expect(response).to be_success + expect(response).to be_successful end end @@ -29,7 +29,7 @@ describe 'Groups (JavaScript fixtures)', type: :controller do it 'groups/ci_cd_settings.html' do get :show, params: { group_id: group } - expect(response).to be_success + expect(response).to be_successful end end end diff --git a/spec/javascripts/fixtures/issues.rb b/spec/frontend/fixtures/issues.rb index d8d77f767de..b5eb38e0023 100644 --- a/spec/javascripts/fixtures/issues.rb +++ b/spec/frontend/fixtures/issues.rb @@ -48,7 +48,7 @@ describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller project_id: project } - expect(response).to be_success + expect(response).to be_successful end private @@ -60,7 +60,7 @@ describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller id: issue.to_param } - expect(response).to be_success + expect(response).to be_successful end end @@ -117,6 +117,6 @@ describe API::Issues, '(JavaScript fixtures)', type: :request do get_related_merge_requests(project.id, issue.iid, user) - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/jobs.rb b/spec/frontend/fixtures/jobs.rb index 46ccd6f8c8a..a3a7759c85b 100644 --- a/spec/javascripts/fixtures/jobs.rb +++ b/spec/frontend/fixtures/jobs.rb @@ -39,7 +39,7 @@ describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do id: build_with_artifacts.to_param } - expect(response).to be_success + expect(response).to be_successful end it 'jobs/delayed.json' do @@ -49,6 +49,6 @@ describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do id: delayed_job.to_param }, format: :json - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/labels.rb b/spec/frontend/fixtures/labels.rb index 4d1b7317274..a312287970f 100644 --- a/spec/javascripts/fixtures/labels.rb +++ b/spec/frontend/fixtures/labels.rb @@ -35,7 +35,7 @@ describe 'Labels (JavaScript fixtures)' do group_id: group }, format: 'json' - expect(response).to be_success + expect(response).to be_successful end end @@ -52,7 +52,7 @@ describe 'Labels (JavaScript fixtures)' do project_id: project }, format: 'json' - expect(response).to be_success + expect(response).to be_successful end end end diff --git a/spec/javascripts/fixtures/merge_requests.rb b/spec/frontend/fixtures/merge_requests.rb index 05860be2291..88706e96676 100644 --- a/spec/javascripts/fixtures/merge_requests.rb +++ b/spec/frontend/fixtures/merge_requests.rb @@ -129,6 +129,6 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont id: merge_request.to_param }, format: :html - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/merge_requests_diffs.rb b/spec/frontend/fixtures/merge_requests_diffs.rb index 03b9b713fd8..b633a0495a6 100644 --- a/spec/javascripts/fixtures/merge_requests_diffs.rb +++ b/spec/frontend/fixtures/merge_requests_diffs.rb @@ -1,4 +1,3 @@ - require 'spec_helper' describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type: :controller do @@ -65,6 +64,6 @@ describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type **extra_params }, format: :json - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/pipeline_schedules.rb b/spec/frontend/fixtures/pipeline_schedules.rb index aecd56e6198..a70091a3919 100644 --- a/spec/javascripts/fixtures/pipeline_schedules.rb +++ b/spec/frontend/fixtures/pipeline_schedules.rb @@ -28,7 +28,7 @@ describe Projects::PipelineSchedulesController, '(JavaScript fixtures)', type: : id: pipeline_schedule.id } - expect(response).to be_success + expect(response).to be_successful end it 'pipeline_schedules/edit_with_variables.html' do @@ -38,6 +38,6 @@ describe Projects::PipelineSchedulesController, '(JavaScript fixtures)', type: : id: pipeline_schedule_populated.id } - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/pipelines.rb b/spec/frontend/fixtures/pipelines.rb index 6b6b0eefab9..ed57eb0aa80 100644 --- a/spec/javascripts/fixtures/pipelines.rb +++ b/spec/frontend/fixtures/pipelines.rb @@ -29,6 +29,6 @@ describe Projects::PipelinesController, '(JavaScript fixtures)', type: :controll project_id: project }, format: :json - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/projects.rb b/spec/frontend/fixtures/projects.rb index 94c59207898..b6c29003e57 100644 --- a/spec/javascripts/fixtures/projects.rb +++ b/spec/frontend/fixtures/projects.rb @@ -18,6 +18,8 @@ describe 'Projects (JavaScript fixtures)', type: :controller do end before do + stub_licensed_features(variable_environment_scope: true) + project.add_maintainer(admin) sign_in(admin) allow(SecureRandom).to receive(:hex).and_return('securerandomhex:thereisnospoon') @@ -34,7 +36,7 @@ describe 'Projects (JavaScript fixtures)', type: :controller do id: project } - expect(response).to be_success + expect(response).to be_successful end it 'projects/overview.html' do @@ -43,7 +45,7 @@ describe 'Projects (JavaScript fixtures)', type: :controller do id: project_with_repo } - expect(response).to be_success + expect(response).to be_successful end it 'projects/edit.html' do @@ -52,7 +54,7 @@ describe 'Projects (JavaScript fixtures)', type: :controller do id: project } - expect(response).to be_success + expect(response).to be_successful end end @@ -63,7 +65,7 @@ describe 'Projects (JavaScript fixtures)', type: :controller do project_id: project } - expect(response).to be_success + expect(response).to be_successful end it 'projects/ci_cd_settings_with_variables.html' do @@ -75,7 +77,7 @@ describe 'Projects (JavaScript fixtures)', type: :controller do project_id: project_variable_populated } - expect(response).to be_success + expect(response).to be_successful end end end diff --git a/spec/javascripts/fixtures/prometheus_service.rb b/spec/frontend/fixtures/prometheus_service.rb index f3171fdd97b..93ee81120d7 100644 --- a/spec/javascripts/fixtures/prometheus_service.rb +++ b/spec/frontend/fixtures/prometheus_service.rb @@ -29,6 +29,6 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle id: service.to_param } - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/raw.rb b/spec/frontend/fixtures/raw.rb index 801c80a0112..801c80a0112 100644 --- a/spec/javascripts/fixtures/raw.rb +++ b/spec/frontend/fixtures/raw.rb diff --git a/spec/javascripts/fixtures/search.rb b/spec/frontend/fixtures/search.rb index 22fc546d761..c26c6998ae9 100644 --- a/spec/javascripts/fixtures/search.rb +++ b/spec/frontend/fixtures/search.rb @@ -12,6 +12,6 @@ describe SearchController, '(JavaScript fixtures)', type: :controller do it 'search/show.html' do get :show - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/services.rb b/spec/frontend/fixtures/services.rb index 2237702ccca..ee1e088f158 100644 --- a/spec/javascripts/fixtures/services.rb +++ b/spec/frontend/fixtures/services.rb @@ -29,6 +29,6 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle id: service.to_param } - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/javascripts/fixtures/sessions.rb b/spec/frontend/fixtures/sessions.rb index 92b74c01c89..18574ea06b5 100644 --- a/spec/javascripts/fixtures/sessions.rb +++ b/spec/frontend/fixtures/sessions.rb @@ -19,7 +19,7 @@ describe 'Sessions (JavaScript fixtures)' do it 'sessions/new.html' do get :new - expect(response).to be_success + expect(response).to be_successful end end end diff --git a/spec/javascripts/fixtures/snippet.rb b/spec/frontend/fixtures/snippet.rb index ace84b14eb7..23bcdb47ac6 100644 --- a/spec/javascripts/fixtures/snippet.rb +++ b/spec/frontend/fixtures/snippet.rb @@ -28,6 +28,6 @@ describe SnippetsController, '(JavaScript fixtures)', type: :controller do get(:show, params: { id: snippet.to_param }) - expect(response).to be_success + expect(response).to be_successful end end diff --git a/spec/frontend/fixtures/static/README.md b/spec/frontend/fixtures/static/README.md new file mode 100644 index 00000000000..011601d0df8 --- /dev/null +++ b/spec/frontend/fixtures/static/README.md @@ -0,0 +1,3 @@ +# Please do not add new files here! + +Instead use a Ruby file in the fixtures root directory (`spec/frontend/fixtures/`). diff --git a/spec/javascripts/fixtures/static/ajax_loading_spinner.html b/spec/frontend/fixtures/static/ajax_loading_spinner.html index 0e1ebb32b1c..0e1ebb32b1c 100644 --- a/spec/javascripts/fixtures/static/ajax_loading_spinner.html +++ b/spec/frontend/fixtures/static/ajax_loading_spinner.html diff --git a/spec/javascripts/fixtures/static/balsamiq_viewer.html b/spec/frontend/fixtures/static/balsamiq_viewer.html index cdd723d1a84..cdd723d1a84 100644 --- a/spec/javascripts/fixtures/static/balsamiq_viewer.html +++ b/spec/frontend/fixtures/static/balsamiq_viewer.html diff --git a/spec/javascripts/fixtures/static/create_item_dropdown.html b/spec/frontend/fixtures/static/create_item_dropdown.html index d2d38370092..d2d38370092 100644 --- a/spec/javascripts/fixtures/static/create_item_dropdown.html +++ b/spec/frontend/fixtures/static/create_item_dropdown.html diff --git a/spec/javascripts/fixtures/static/environments/table.html b/spec/frontend/fixtures/static/environments/table.html index 417af564ff1..417af564ff1 100644 --- a/spec/javascripts/fixtures/static/environments/table.html +++ b/spec/frontend/fixtures/static/environments/table.html diff --git a/spec/frontend/fixtures/static/environments_logs.html b/spec/frontend/fixtures/static/environments_logs.html new file mode 100644 index 00000000000..6179d3dbc23 --- /dev/null +++ b/spec/frontend/fixtures/static/environments_logs.html @@ -0,0 +1,29 @@ +<div class="js-kubernetes-logs" data-logs-path="/root/kubernetes-app/environments/1/logs"> + <div class="build-page"> + <div class="build-trace-container prepend-top-default"> + <div class="top-bar js-top-bar"> + <div class="truncated-info hidden-xs pull-left"></div> + <div class="dropdown prepend-left-10 js-pod-dropdown"> + <button aria-expanded="false" class="dropdown-menu-toggle" data-toggle="dropdown" type="button"> + <i class="fa fa-chevron-down"></i> + </button> + <div class="dropdown-menu dropdown-menu-selectable dropdown-menu-drop-up"></div> + </div> + <div class="controllers pull-right"> + <div class="has-tooltip controllers-buttons" data-container="body" data-placement="top" title="Scroll to top"> + <button class="js-scroll-up btn-scroll btn-transparent btn-blank" disabled type="button"></button> + </div> + <div class="has-tooltip controllers-buttons" data-container="body" data-placement="top" title="Scroll to bottom"> + <button class="js-scroll-down btn-scroll btn-transparent btn-blank" disabled type="button"></button> + </div> + <div class="refresh-control pull-right"> + <div class="has-tooltip controllers-buttons" data-container="body" data-placement="top" title="Refresh"> + <button class="js-refresh-log btn-default btn-refresh" disabled type="button"></button> + </div> + </div> + </div> + </div> + <pre class="build-trace" id="build-trace"><code class="bash js-build-output"><div class="build-loader-animation js-build-refresh"></div></code></pre> + </div> + </div> +</div> diff --git a/spec/javascripts/fixtures/static/event_filter.html b/spec/frontend/fixtures/static/event_filter.html index 8e9b6fb1b5c..8e9b6fb1b5c 100644 --- a/spec/javascripts/fixtures/static/event_filter.html +++ b/spec/frontend/fixtures/static/event_filter.html diff --git a/spec/javascripts/fixtures/static/gl_dropdown.html b/spec/frontend/fixtures/static/gl_dropdown.html index 08f6738414e..08f6738414e 100644 --- a/spec/javascripts/fixtures/static/gl_dropdown.html +++ b/spec/frontend/fixtures/static/gl_dropdown.html diff --git a/spec/javascripts/fixtures/static/gl_field_errors.html b/spec/frontend/fixtures/static/gl_field_errors.html index f8470e02b7c..f8470e02b7c 100644 --- a/spec/javascripts/fixtures/static/gl_field_errors.html +++ b/spec/frontend/fixtures/static/gl_field_errors.html diff --git a/spec/javascripts/fixtures/static/images/green_box.png b/spec/frontend/fixtures/static/images/green_box.png Binary files differindex cd1ff9f9ade..cd1ff9f9ade 100644 --- a/spec/javascripts/fixtures/static/images/green_box.png +++ b/spec/frontend/fixtures/static/images/green_box.png diff --git a/spec/javascripts/fixtures/static/images/one_white_pixel.png b/spec/frontend/fixtures/static/images/one_white_pixel.png Binary files differindex 073fcf40a18..073fcf40a18 100644 --- a/spec/javascripts/fixtures/static/images/one_white_pixel.png +++ b/spec/frontend/fixtures/static/images/one_white_pixel.png diff --git a/spec/javascripts/fixtures/static/images/red_box.png b/spec/frontend/fixtures/static/images/red_box.png Binary files differindex 73b2927da0f..73b2927da0f 100644 --- a/spec/javascripts/fixtures/static/images/red_box.png +++ b/spec/frontend/fixtures/static/images/red_box.png diff --git a/spec/javascripts/fixtures/static/issuable_filter.html b/spec/frontend/fixtures/static/issuable_filter.html index 06b70fb43f1..06b70fb43f1 100644 --- a/spec/javascripts/fixtures/static/issuable_filter.html +++ b/spec/frontend/fixtures/static/issuable_filter.html diff --git a/spec/javascripts/fixtures/static/issue_sidebar_label.html b/spec/frontend/fixtures/static/issue_sidebar_label.html index ec8fb30f219..ec8fb30f219 100644 --- a/spec/javascripts/fixtures/static/issue_sidebar_label.html +++ b/spec/frontend/fixtures/static/issue_sidebar_label.html diff --git a/spec/javascripts/fixtures/static/line_highlighter.html b/spec/frontend/fixtures/static/line_highlighter.html index 897a25d6760..897a25d6760 100644 --- a/spec/javascripts/fixtures/static/line_highlighter.html +++ b/spec/frontend/fixtures/static/line_highlighter.html diff --git a/spec/javascripts/fixtures/static/linked_tabs.html b/spec/frontend/fixtures/static/linked_tabs.html index c25463bf1db..c25463bf1db 100644 --- a/spec/javascripts/fixtures/static/linked_tabs.html +++ b/spec/frontend/fixtures/static/linked_tabs.html diff --git a/spec/javascripts/fixtures/static/merge_requests_show.html b/spec/frontend/fixtures/static/merge_requests_show.html index 87e36c9f315..87e36c9f315 100644 --- a/spec/javascripts/fixtures/static/merge_requests_show.html +++ b/spec/frontend/fixtures/static/merge_requests_show.html diff --git a/spec/javascripts/fixtures/static/mini_dropdown_graph.html b/spec/frontend/fixtures/static/mini_dropdown_graph.html index cd0b8dec3fc..cd0b8dec3fc 100644 --- a/spec/javascripts/fixtures/static/mini_dropdown_graph.html +++ b/spec/frontend/fixtures/static/mini_dropdown_graph.html diff --git a/spec/javascripts/fixtures/static/notebook_viewer.html b/spec/frontend/fixtures/static/notebook_viewer.html index 4bbb7bf1094..4bbb7bf1094 100644 --- a/spec/javascripts/fixtures/static/notebook_viewer.html +++ b/spec/frontend/fixtures/static/notebook_viewer.html diff --git a/spec/javascripts/fixtures/static/oauth_remember_me.html b/spec/frontend/fixtures/static/oauth_remember_me.html index 9ba1ffc72fe..9ba1ffc72fe 100644 --- a/spec/javascripts/fixtures/static/oauth_remember_me.html +++ b/spec/frontend/fixtures/static/oauth_remember_me.html diff --git a/spec/javascripts/fixtures/static/pdf_viewer.html b/spec/frontend/fixtures/static/pdf_viewer.html index 350d35a262f..350d35a262f 100644 --- a/spec/javascripts/fixtures/static/pdf_viewer.html +++ b/spec/frontend/fixtures/static/pdf_viewer.html diff --git a/spec/javascripts/fixtures/static/pipeline_graph.html b/spec/frontend/fixtures/static/pipeline_graph.html index 422372bb7d5..422372bb7d5 100644 --- a/spec/javascripts/fixtures/static/pipeline_graph.html +++ b/spec/frontend/fixtures/static/pipeline_graph.html diff --git a/spec/javascripts/fixtures/static/pipelines.html b/spec/frontend/fixtures/static/pipelines.html index 42333f94f2f..42333f94f2f 100644 --- a/spec/javascripts/fixtures/static/pipelines.html +++ b/spec/frontend/fixtures/static/pipelines.html diff --git a/spec/javascripts/fixtures/static/project_select_combo_button.html b/spec/frontend/fixtures/static/project_select_combo_button.html index 50c826051c0..50c826051c0 100644 --- a/spec/javascripts/fixtures/static/project_select_combo_button.html +++ b/spec/frontend/fixtures/static/project_select_combo_button.html diff --git a/spec/javascripts/fixtures/static/projects.json b/spec/frontend/fixtures/static/projects.json index 68a150f602a..68a150f602a 100644 --- a/spec/javascripts/fixtures/static/projects.json +++ b/spec/frontend/fixtures/static/projects.json diff --git a/spec/javascripts/fixtures/static/search_autocomplete.html b/spec/frontend/fixtures/static/search_autocomplete.html index 29db9020424..29db9020424 100644 --- a/spec/javascripts/fixtures/static/search_autocomplete.html +++ b/spec/frontend/fixtures/static/search_autocomplete.html diff --git a/spec/javascripts/fixtures/static/signin_tabs.html b/spec/frontend/fixtures/static/signin_tabs.html index 7e66ab9394b..7e66ab9394b 100644 --- a/spec/javascripts/fixtures/static/signin_tabs.html +++ b/spec/frontend/fixtures/static/signin_tabs.html diff --git a/spec/javascripts/fixtures/static/sketch_viewer.html b/spec/frontend/fixtures/static/sketch_viewer.html index e25e554e568..e25e554e568 100644 --- a/spec/javascripts/fixtures/static/sketch_viewer.html +++ b/spec/frontend/fixtures/static/sketch_viewer.html diff --git a/spec/javascripts/fixtures/todos.rb b/spec/frontend/fixtures/todos.rb index d0c8a6eca01..a7c183d2414 100644 --- a/spec/javascripts/fixtures/todos.rb +++ b/spec/frontend/fixtures/todos.rb @@ -29,7 +29,7 @@ describe 'Todos (JavaScript fixtures)' do it 'todos/todos.html' do get :index - expect(response).to be_success + expect(response).to be_successful end end @@ -48,7 +48,7 @@ describe 'Todos (JavaScript fixtures)' do issuable_id: issue_2.id }, format: 'json' - expect(response).to be_success + expect(response).to be_successful end end end diff --git a/spec/javascripts/fixtures/u2f.rb b/spec/frontend/fixtures/u2f.rb index f52832b6efb..8ecbc0390cd 100644 --- a/spec/javascripts/fixtures/u2f.rb +++ b/spec/frontend/fixtures/u2f.rb @@ -23,7 +23,7 @@ context 'U2F' do post :create, params: { user: { login: user.username, password: user.password } } - expect(response).to be_success + expect(response).to be_successful end end @@ -38,7 +38,7 @@ context 'U2F' do it 'u2f/register.html' do get :show - expect(response).to be_success + expect(response).to be_successful end end end diff --git a/spec/frontend/helpers/fixtures.js b/spec/frontend/helpers/fixtures.js index b77bcd6266e..778196843db 100644 --- a/spec/frontend/helpers/fixtures.js +++ b/spec/frontend/helpers/fixtures.js @@ -4,12 +4,15 @@ import path from 'path'; import { ErrorWithStack } from 'jest-util'; export function getFixture(relativePath) { - const absolutePath = path.join(global.fixturesBasePath, relativePath); + const basePath = relativePath.startsWith('static/') + ? global.staticFixturesBasePath + : global.fixturesBasePath; + const absolutePath = path.join(basePath, relativePath); if (!fs.existsSync(absolutePath)) { throw new ErrorWithStack( `Fixture file ${relativePath} does not exist. -Did you run bin/rake karma:fixtures?`, +Did you run bin/rake frontend:fixtures?`, getFixture, ); } diff --git a/spec/javascripts/fixtures/.gitignore b/spec/javascripts/fixtures/.gitignore index bed020f5b0a..d6b7ef32c84 100644 --- a/spec/javascripts/fixtures/.gitignore +++ b/spec/javascripts/fixtures/.gitignore @@ -1,5 +1,2 @@ -*.html.raw -*.html -*.json -*.pdf -*.bmpr +* +!.gitignore diff --git a/spec/javascripts/fixtures/static/README.md b/spec/javascripts/fixtures/static/README.md deleted file mode 100644 index b5c2f8233bf..00000000000 --- a/spec/javascripts/fixtures/static/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not add new files here! - -Instead use a Ruby file in the fixtures root directory (`spec/javascripts/fixtures/`). diff --git a/spec/javascripts/test_constants.js b/spec/javascripts/test_constants.js index 77c206585fe..c97d47a6406 100644 --- a/spec/javascripts/test_constants.js +++ b/spec/javascripts/test_constants.js @@ -1,6 +1,4 @@ -export const FIXTURES_PATH = `/base/${ - process.env.IS_GITLAB_EE ? 'ee/' : '' -}spec/javascripts/fixtures`; +export const FIXTURES_PATH = `/fixtures`; export const TEST_HOST = 'http://test.host'; export const DUMMY_IMAGE_URL = `${FIXTURES_PATH}/static/images/one_white_pixel.png`; diff --git a/spec/support/helpers/javascript_fixtures_helpers.rb b/spec/support/helpers/javascript_fixtures_helpers.rb index cdd7724cc13..e9129bd263e 100644 --- a/spec/support/helpers/javascript_fixtures_helpers.rb +++ b/spec/support/helpers/javascript_fixtures_helpers.rb @@ -19,7 +19,7 @@ module JavaScriptFixturesHelpers end def fixture_root_path - (Gitlab.ee? ? 'ee/' : '') + 'spec/javascripts/fixtures' + 'tmp/tests/frontend/fixtures' + (Gitlab.ee? ? '-ee' : '') end # Public: Removes all fixture files from given directory diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index 16938da50cc..b062631b995 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -130,7 +130,7 @@ module TestEnv # Keeps gitlab-shell and gitlab-test def clean_test_path Dir[TMP_TEST_PATH].each do |entry| - unless File.basename(entry) =~ /\A(gitaly|gitlab-(shell|test|test_bare|test-fork|test-fork_bare))\z/ + unless test_dirs.include?(File.basename(entry)) FileUtils.rm_rf(entry) end end @@ -316,6 +316,7 @@ module TestEnv # These are directories that should be preserved at cleanup time def test_dirs @test_dirs ||= %w[ + frontend gitaly gitlab-shell gitlab-test |