Commit 49a2d827 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents fd5ae2da acd5fbf6
...@@ -1198,7 +1198,7 @@ Confirm the following are all true: ...@@ -1198,7 +1198,7 @@ Confirm the following are all true:
successfully creates the project, but doesn't create the README. successfully creates the project, but doesn't create the README.
- When [tailing the logs](https://docs.gitlab.com/omnibus/settings/logs.html#tail-logs-in-a-console-on-the-server) - When [tailing the logs](https://docs.gitlab.com/omnibus/settings/logs.html#tail-logs-in-a-console-on-the-server)
on a Gitaly client and reproducing the error, you get `401` errors on a Gitaly client and reproducing the error, you get `401` errors
when reaching the `/api/v4/internal/allowed` endpoint: when reaching the [`/api/v4/internal/allowed`](../../development/internal_api.md) endpoint:
```shell ```shell
# api_json.log # api_json.log
......
...@@ -301,7 +301,7 @@ Confirm the following are all true: ...@@ -301,7 +301,7 @@ Confirm the following are all true:
- Creating a new project and [initializing it with a README](../../user/project/working_with_projects.md#blank-projects) - Creating a new project and [initializing it with a README](../../user/project/working_with_projects.md#blank-projects)
successfully creates the project but doesn't create the README. successfully creates the project but doesn't create the README.
- When [tailing the logs](https://docs.gitlab.com/omnibus/settings/logs.html#tail-logs-in-a-console-on-the-server) on an app node and reproducing the error, you get `401` errors - When [tailing the logs](https://docs.gitlab.com/omnibus/settings/logs.html#tail-logs-in-a-console-on-the-server) on an app node and reproducing the error, you get `401` errors
when reaching the `/api/v4/internal/allowed` endpoint: when reaching the [`/api/v4/internal/allowed`](../../development/internal_api.md) endpoint:
```shell ```shell
# api_json.log # api_json.log
......
...@@ -255,7 +255,7 @@ separate Rails process to debug the issue: ...@@ -255,7 +255,7 @@ separate Rails process to debug the issue:
### GitLab: API is not accessible ### GitLab: API is not accessible
This often occurs when GitLab Shell attempts to request authorization via the This often occurs when GitLab Shell attempts to request authorization via the
internal API (e.g., `http://localhost:8080/api/v4/internal/allowed`), and [internal API](../../development/internal_api.md) (e.g., `http://localhost:8080/api/v4/internal/allowed`), and
something in the check fails. There are many reasons why this may happen: something in the check fails. There are many reasons why this may happen:
1. Timeout connecting to a database (e.g., PostgreSQL or Redis) 1. Timeout connecting to a database (e.g., PostgreSQL or Redis)
...@@ -271,8 +271,8 @@ strace -ttTfyyy -s 1024 -p <PID of unicorn worker> -o /tmp/unicorn.txt ...@@ -271,8 +271,8 @@ strace -ttTfyyy -s 1024 -p <PID of unicorn worker> -o /tmp/unicorn.txt
``` ```
If you cannot isolate which Unicorn worker is the issue, try to run `strace` If you cannot isolate which Unicorn worker is the issue, try to run `strace`
on all the Unicorn workers to see where the `/internal/allowed` endpoint gets on all the Unicorn workers to see where the
stuck: [`/internal/allowed`](../../development/internal_api.md) endpoint gets stuck:
```shell ```shell
ps auwx | grep unicorn | awk '{ print " -p " $2}' | xargs strace -ttTfyyy -s 1024 -o /tmp/unicorn.txt ps auwx | grep unicorn | awk '{ print " -p " $2}' | xargs strace -ttTfyyy -s 1024 -o /tmp/unicorn.txt
......
...@@ -899,7 +899,7 @@ in Rails, scheduled to run whenever an SSH key is modified by a user. ...@@ -899,7 +899,7 @@ in Rails, scheduled to run whenever an SSH key is modified by a user.
instead of keys. In this case, `AuthorizedKeysCommand` is replaced with an instead of keys. In this case, `AuthorizedKeysCommand` is replaced with an
`AuthorizedPrincipalsCommand`. This extracts a username from the certificate `AuthorizedPrincipalsCommand`. This extracts a username from the certificate
without using the Rails internal API, which is used instead of `key_id` in the without using the Rails internal API, which is used instead of `key_id` in the
`/api/internal/allowed` call later. [`/api/internal/allowed`](internal_api.md) call later.
GitLab Shell also has a few operations that do not involve Gitaly, such as GitLab Shell also has a few operations that do not involve Gitaly, such as
resetting two-factor authentication codes. These are handled in the same way, resetting two-factor authentication codes. These are handled in the same way,
......
...@@ -35,12 +35,12 @@ This is called by [Gitaly](https://gitlab.com/gitlab-org/gitaly) and ...@@ -35,12 +35,12 @@ This is called by [Gitaly](https://gitlab.com/gitlab-org/gitaly) and
[GitLab Shell](https://gitlab.com/gitlab-org/gitlab-shell) to check access to a [GitLab Shell](https://gitlab.com/gitlab-org/gitlab-shell) to check access to a
repository. repository.
When called from GitLab Shell no changes are passed and the internal - **When called from GitLab Shell**: No changes are passed, and the internal
API replies with the information needed to pass the request on to API replies with the information needed to pass the request on to Gitaly.
Gitaly. - **When called from Gitaly in a `pre-receive` hook**: The changes are passed
and validated to determine if the push is allowed.
When called from Gitaly in a `pre-receive` hook the changes are passed Calls are limited to 50 seconds each.
and those are validated to determine if the push is allowed.
```plaintext ```plaintext
POST /internal/allowed POST /internal/allowed
......
...@@ -13,7 +13,7 @@ GitLab Maintenance Mode **only** blocks writes from HTTP and SSH requests at the ...@@ -13,7 +13,7 @@ GitLab Maintenance Mode **only** blocks writes from HTTP and SSH requests at the
- [the read-only database method](https://gitlab.com/gitlab-org/gitlab/blob/2425e9de50c678413ceaad6ee3bf66f42b7e228c/ee/lib/ee/gitlab/database.rb#L13), which toggles special behavior when we are not allowed to write to the database. [Search the codebase for `Gitlab::Database.read_only?`.](https://gitlab.com/search?utf8=%E2%9C%93&search=Gitlab%3A%3ADatabase.read_only%3F&group_id=9970&project_id=278964&scope=blobs&search_code=false&snippets=false&repository_ref=) - [the read-only database method](https://gitlab.com/gitlab-org/gitlab/blob/2425e9de50c678413ceaad6ee3bf66f42b7e228c/ee/lib/ee/gitlab/database.rb#L13), which toggles special behavior when we are not allowed to write to the database. [Search the codebase for `Gitlab::Database.read_only?`.](https://gitlab.com/search?utf8=%E2%9C%93&search=Gitlab%3A%3ADatabase.read_only%3F&group_id=9970&project_id=278964&scope=blobs&search_code=false&snippets=false&repository_ref=)
- [the read-only middleware](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/ee/gitlab/middleware/read_only/controller.rb), where HTTP requests that cause database writes are blocked, unless explicitly allowed. - [the read-only middleware](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/ee/gitlab/middleware/read_only/controller.rb), where HTTP requests that cause database writes are blocked, unless explicitly allowed.
- [Git push access via SSH is denied](https://gitlab.com/gitlab-org/gitlab/-/blob/2425e9de50c678413ceaad6ee3bf66f42b7e228c/ee/lib/ee/gitlab/git_access.rb#L13) by returning 401 when `gitlab-shell` POSTs to `/internal/allowed` to [check if access is allowed](internal_api.md#git-authentication). - [Git push access via SSH is denied](https://gitlab.com/gitlab-org/gitlab/-/blob/2425e9de50c678413ceaad6ee3bf66f42b7e228c/ee/lib/ee/gitlab/git_access.rb#L13) by returning 401 when `gitlab-shell` POSTs to [`/internal/allowed`](internal_api.md) to [check if access is allowed](internal_api.md#git-authentication).
- [Container registry authentication service](https://gitlab.com/gitlab-org/gitlab/-/blob/2425e9de50c678413ceaad6ee3bf66f42b7e228c/ee/app/services/ee/auth/container_registry_authentication_service.rb#L12), where updates to the container registry are blocked. - [Container registry authentication service](https://gitlab.com/gitlab-org/gitlab/-/blob/2425e9de50c678413ceaad6ee3bf66f42b7e228c/ee/app/services/ee/auth/container_registry_authentication_service.rb#L12), where updates to the container registry are blocked.
The database itself is not in read-only mode (except in a Geo secondary site) and can be written by sources other than the ones blocked. The database itself is not in read-only mode (except in a Geo secondary site) and can be written by sources other than the ones blocked.
...@@ -281,7 +281,7 @@ example [`resources.yml` file](#example-resourcesyml-file) in the following ways ...@@ -281,7 +281,7 @@ example [`resources.yml` file](#example-resourcesyml-file) in the following ways
after you install the `gitlab-kas` sub-chart, or enable `gitlab-kas` for Omnibus GitLab. after you install the `gitlab-kas` sub-chart, or enable `gitlab-kas` for Omnibus GitLab.
When using the sub-chart, you must set `wss://kas.host.tld:443` as When using the sub-chart, you must set `wss://kas.host.tld:443` as
`kas-address`, where `host.tld` is the domain you've setup for your GitLab installation. `kas-address`, where `host.tld` is the domain you've setup for your GitLab installation.
When using Omnibus GitLab, you must set `wss://GitLab.host.tld:443/-/kubernetes-agent` as When using Omnibus GitLab, you must set `wss://GitLab.host.tld:443/-/kubernetes-agent/` as
`kas-address`, where `GitLab.host.tld` is your GitLab hostname. `kas-address`, where `GitLab.host.tld` is your GitLab hostname.
- When using the sub-chart, specify the `ws` scheme (such as `ws://kas.host.tld:80`) - When using the sub-chart, specify the `ws` scheme (such as `ws://kas.host.tld:80`)
to use an unencrypted WebSockets connection. to use an unencrypted WebSockets connection.
...@@ -346,7 +346,7 @@ spec: ...@@ -346,7 +346,7 @@ spec:
- --token-file=/config/token - --token-file=/config/token
- --kas-address - --kas-address
- wss://kas.host.tld:443 # change this line for the one below if using Omnibus GitLab - wss://kas.host.tld:443 # change this line for the one below if using Omnibus GitLab
# - wss://gitlab.host.tld:443/-/kubernetes-agent # - wss://gitlab.host.tld:443/-/kubernetes-agent/
volumeMounts: volumeMounts:
- name: token-volume - name: token-volume
mountPath: /config mountPath: /config
...@@ -569,7 +569,7 @@ This error is shown if there are some connectivity issues between the address ...@@ -569,7 +569,7 @@ This error is shown if there are some connectivity issues between the address
specified as `kas-address`, and your Agent pod. To fix it, make sure that you specified as `kas-address`, and your Agent pod. To fix it, make sure that you
specified the `kas-address` correctly. specified the `kas-address` correctly.
### Agent logs - ValidationError(Deployment.metadata ### Agent logs - ValidationError(Deployment.metadata)
```plaintext ```plaintext
{"level":"info","time":"2020-10-30T08:56:54.329Z","msg":"Synced","project_id":"root/kas-manifest001","resource_key":"apps/Deployment/kas-test001/nginx-deployment","sync_result":"error validating data: [ValidationError(Deployment.metadata): unknown field \"replicas\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta, ValidationError(Deployment.metadata): unknown field \"selector\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta, ValidationError(Deployment.metadata): unknown field \"template\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta]"} {"level":"info","time":"2020-10-30T08:56:54.329Z","msg":"Synced","project_id":"root/kas-manifest001","resource_key":"apps/Deployment/kas-test001/nginx-deployment","sync_result":"error validating data: [ValidationError(Deployment.metadata): unknown field \"replicas\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta, ValidationError(Deployment.metadata): unknown field \"selector\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta, ValidationError(Deployment.metadata): unknown field \"template\" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta]"}
...@@ -603,3 +603,72 @@ issue is in progress, directly edit the deployment with the ...@@ -603,3 +603,72 @@ issue is in progress, directly edit the deployment with the
This error is shown if the version of the agent is newer that the version of KAS. This error is shown if the version of the agent is newer that the version of KAS.
To fix it, make sure that both `agentk` and KAS use the same versions. To fix it, make sure that both `agentk` and KAS use the same versions.
### Agent logs - Certificate signed by unknown authority
```plaintext
{"level":"error","time":"2021-02-25T07:22:37.158Z","msg":"Reverse tunnel","mod_name":"reverse_tunnel","error":"Connect(): rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing failed to WebSocket dial: failed to send handshake request: Get \\\"https://GitLabhost.tld:443/-/kubernetes-agent/\\\": x509: certificate signed by unknown authority\""}
```
This error is shown if your GitLab instance is using a certificate signed by an internal CA that
is unknown to the agent. One approach to fixing it is to present the CA certificate file to the agent
via a Kubernetes `configmap` and mount the file in the agent `/etc/ssl/certs` directory from where it
will be picked up automatically.
For example, if your internal CA certifciate is `myCA.pem`:
```plaintext
kubectl -n gitlab-agent create configmap ca-pemstore --from-file=myCA.pem
```
Then in `resources.yml`:
```plaintext
spec:
serviceAccountName: gitlab-agent
containers:
- name: agent
image: "registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/agentk:latest"
args:
- --token-file=/config/token
- --kas-address
- wss://kas.host.tld:443 # change this line for the one below if using Omnibus GitLab
# - wss://gitlab.host.tld:443/-/kubernetes-agent
volumeMounts:
- name: token-volume
mountPath: /config
- name: ca-pemstore-volume
mountPath: /etc/ssl/certs/myCA.pem
subPath: myCA.pem
volumes:
- name: token-volume
secret:
secretName: gitlab-agent-token
- name: ca-pemstore-volume
configMap:
name: ca-pemstore
items:
- key: myCA.pem
path: myCA.pem
```
Alternatively, you can mount the certificate file at a different location and include it using the
`--ca-cert-file` agent parameter:
```plaintext
containers:
- name: agent
image: "registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/agentk:latest"
args:
- --ca-cert-file=/tmp/myCA.pem
- --token-file=/config/token
- --kas-address
- wss://kas.host.tld:443 # change this line for the one below if using Omnibus GitLab
# - wss://gitlab.host.tld:443/-/kubernetes-agent
volumeMounts:
- name: token-volume
mountPath: /config
- name: ca-pemstore-volume
mountPath: /tmp/myCA.pem
subPath: myCA.pem
```
describe('Sidebar', () => { describe('Sidebar', () => {
preloadFixtures('issues/open-issue.html');
beforeEach(() => loadFixtures('issues/open-issue.html')); beforeEach(() => loadFixtures('issues/open-issue.html'));
it('does not have a max select', () => { it('does not have a max select', () => {
......
...@@ -19,7 +19,6 @@ jest.mock('ee/saml_providers/scim_token_service', () => { ...@@ -19,7 +19,6 @@ jest.mock('ee/saml_providers/scim_token_service', () => {
describe('SCIMTokenToggleArea', () => { describe('SCIMTokenToggleArea', () => {
const FIXTURE = 'groups/saml_providers/show.html'; const FIXTURE = 'groups/saml_providers/show.html';
let scimTokenToggleArea; let scimTokenToggleArea;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -5,8 +5,6 @@ const ceFixture = 'search/blob_search_result.html'; ...@@ -5,8 +5,6 @@ const ceFixture = 'search/blob_search_result.html';
const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79 const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79
describe('ee/search/highlight_blob_search_result', () => { describe('ee/search/highlight_blob_search_result', () => {
preloadFixtures(fixture, ceFixture);
// Basic search support // Basic search support
it('highlights lines with search term occurrence', () => { it('highlights lines with search term occurrence', () => {
loadFixtures(ceFixture); loadFixtures(ceFixture);
......
...@@ -14,7 +14,6 @@ settings: ...@@ -14,7 +14,6 @@ settings:
globals: globals:
getJSONFixture: false getJSONFixture: false
loadFixtures: false loadFixtures: false
preloadFixtures: false
setFixtures: false setFixtures: false
rules: rules:
jest/expect-expect: jest/expect-expect:
......
...@@ -8,8 +8,6 @@ describe('U2FAuthenticate', () => { ...@@ -8,8 +8,6 @@ describe('U2FAuthenticate', () => {
let container; let container;
let component; let component;
preloadFixtures('u2f/authenticate.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('u2f/authenticate.html'); loadFixtures('u2f/authenticate.html');
u2fDevice = new MockU2FDevice(); u2fDevice = new MockU2FDevice();
......
...@@ -8,8 +8,6 @@ describe('U2FRegister', () => { ...@@ -8,8 +8,6 @@ describe('U2FRegister', () => {
let container; let container;
let component; let component;
preloadFixtures('u2f/register.html');
beforeEach((done) => { beforeEach((done) => {
loadFixtures('u2f/register.html'); loadFixtures('u2f/register.html');
u2fDevice = new MockU2FDevice(); u2fDevice = new MockU2FDevice();
......
...@@ -13,7 +13,6 @@ const mockResponse = { ...@@ -13,7 +13,6 @@ const mockResponse = {
}; };
describe('WebAuthnAuthenticate', () => { describe('WebAuthnAuthenticate', () => {
preloadFixtures('webauthn/authenticate.html');
useMockNavigatorCredentials(); useMockNavigatorCredentials();
let fallbackElement; let fallbackElement;
......
...@@ -5,7 +5,6 @@ import MockWebAuthnDevice from './mock_webauthn_device'; ...@@ -5,7 +5,6 @@ import MockWebAuthnDevice from './mock_webauthn_device';
import { useMockNavigatorCredentials } from './util'; import { useMockNavigatorCredentials } from './util';
describe('WebAuthnRegister', () => { describe('WebAuthnRegister', () => {
preloadFixtures('webauthn/register.html');
useMockNavigatorCredentials(); useMockNavigatorCredentials();
const mockResponse = { const mockResponse = {
......
...@@ -60,7 +60,6 @@ describe('AwardsHandler', () => { ...@@ -60,7 +60,6 @@ describe('AwardsHandler', () => {
u: '6.0', u: '6.0',
}, },
}; };
preloadFixtures('snippets/show.html');
const openAndWaitForEmojiMenu = (sel = '.js-add-award') => { const openAndWaitForEmojiMenu = (sel = '.js-add-award') => {
$(sel).eq(0).click(); $(sel).eq(0).click();
......
...@@ -6,8 +6,6 @@ describe('Quick Submit behavior', () => { ...@@ -6,8 +6,6 @@ describe('Quick Submit behavior', () => {
const keydownEvent = (options = { keyCode: 13, metaKey: true }) => $.Event('keydown', options); const keydownEvent = (options = { keyCode: 13, metaKey: true }) => $.Event('keydown', options);
preloadFixtures('snippets/show.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('snippets/show.html'); loadFixtures('snippets/show.html');
......
...@@ -3,7 +3,6 @@ import '~/behaviors/requires_input'; ...@@ -3,7 +3,6 @@ import '~/behaviors/requires_input';
describe('requiresInput', () => { describe('requiresInput', () => {
let submitButton; let submitButton;
preloadFixtures('branches/new_branch.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('branches/new_branch.html'); loadFixtures('branches/new_branch.html');
......
...@@ -13,8 +13,6 @@ describe('ShortcutsIssuable', () => { ...@@ -13,8 +13,6 @@ describe('ShortcutsIssuable', () => {
const snippetShowFixtureName = 'snippets/show.html'; const snippetShowFixtureName = 'snippets/show.html';
const mrShowFixtureName = 'merge_requests/merge_request_of_current_user.html'; const mrShowFixtureName = 'merge_requests/merge_request_of_current_user.html';
preloadFixtures(snippetShowFixtureName, mrShowFixtureName);
beforeAll((done) => { beforeAll((done) => {
initCopyAsGFM(); initCopyAsGFM();
......
...@@ -7,7 +7,6 @@ jest.mock('~/projects/upload_file_experiment', () => ({ ...@@ -7,7 +7,6 @@ jest.mock('~/projects/upload_file_experiment', () => ({
})); }));
describe('BlobFileDropzone', () => { describe('BlobFileDropzone', () => {
preloadFixtures('blob/show.html');
let dropzone; let dropzone;
let replaceFileButton; let replaceFileButton;
......
...@@ -4,8 +4,6 @@ import SketchLoader from '~/blob/sketch'; ...@@ -4,8 +4,6 @@ import SketchLoader from '~/blob/sketch';
jest.mock('jszip'); jest.mock('jszip');
describe('Sketch viewer', () => { describe('Sketch viewer', () => {
preloadFixtures('static/sketch_viewer.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/sketch_viewer.html'); loadFixtures('static/sketch_viewer.html');
}); });
......
...@@ -16,8 +16,6 @@ describe('Blob viewer', () => { ...@@ -16,8 +16,6 @@ describe('Blob viewer', () => {
setTestTimeout(2000); setTestTimeout(2000);
preloadFixtures('blob/show_readme.html');
beforeEach(() => { beforeEach(() => {
$.fn.extend(jQueryMock); $.fn.extend(jQueryMock);
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
describe('Linked Tabs', () => { describe('Linked Tabs', () => {
preloadFixtures('static/linked_tabs.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/linked_tabs.html'); loadFixtures('static/linked_tabs.html');
}); });
......
...@@ -4,9 +4,6 @@ import VariableList from '~/ci_variable_list/ci_variable_list'; ...@@ -4,9 +4,6 @@ import VariableList from '~/ci_variable_list/ci_variable_list';
const HIDE_CLASS = 'hide'; const HIDE_CLASS = 'hide';
describe('VariableList', () => { describe('VariableList', () => {
preloadFixtures('pipeline_schedules/edit.html');
preloadFixtures('pipeline_schedules/edit_with_variables.html');
let $wrapper; let $wrapper;
let variableList; let variableList;
......
...@@ -2,8 +2,6 @@ import $ from 'jquery'; ...@@ -2,8 +2,6 @@ import $ from 'jquery';
import setupNativeFormVariableList from '~/ci_variable_list/native_form_variable_list'; import setupNativeFormVariableList from '~/ci_variable_list/native_form_variable_list';
describe('NativeFormVariableList', () => { describe('NativeFormVariableList', () => {
preloadFixtures('pipeline_schedules/edit.html');
let $wrapper; let $wrapper;
beforeEach(() => { beforeEach(() => {
......
...@@ -14,9 +14,6 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -14,9 +14,6 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
const jsonFixtureName = 'todos/todos.json'; const jsonFixtureName = 'todos/todos.json';
let mock; let mock;
preloadFixtures(fixtureName);
preloadFixtures(jsonFixtureName);
beforeEach(() => { beforeEach(() => {
const todoData = getJSONFixture(jsonFixtureName); const todoData = getJSONFixture(jsonFixtureName);
new Sidebar(); new Sidebar();
......
...@@ -17,8 +17,6 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -17,8 +17,6 @@ describe('Pipelines table in Commits and Merge requests', () => {
errorStateSvgPath: 'foo', errorStateSvgPath: 'foo',
}; };
preloadFixtures(jsonFixtureName);
const findRunPipelineBtn = () => vm.$el.querySelector('[data-testid="run_pipeline_button"]'); const findRunPipelineBtn = () => vm.$el.querySelector('[data-testid="run_pipeline_button"]');
const findRunPipelineBtnMobile = () => const findRunPipelineBtnMobile = () =>
vm.$el.querySelector('[data-testid="run_pipeline_button_mobile"]'); vm.$el.querySelector('[data-testid="run_pipeline_button_mobile"]');
......
...@@ -20,8 +20,6 @@ const DROPDOWN_ITEM_DATA = [ ...@@ -20,8 +20,6 @@ const DROPDOWN_ITEM_DATA = [
]; ];
describe('CreateItemDropdown', () => { describe('CreateItemDropdown', () => {
preloadFixtures('static/create_item_dropdown.html');
let $wrapperEl; let $wrapperEl;
let createItemDropdown; let createItemDropdown;
......
...@@ -10,8 +10,6 @@ jest.mock('~/lib/utils/url_utility', () => ({ ...@@ -10,8 +10,6 @@ jest.mock('~/lib/utils/url_utility', () => ({
})); }));
describe('deprecatedJQueryDropdown', () => { describe('deprecatedJQueryDropdown', () => {
preloadFixtures('static/deprecated_jquery_dropdown.html');
const NON_SELECTABLE_CLASSES = const NON_SELECTABLE_CLASSES =
'.divider, .separator, .dropdown-header, .dropdown-menu-empty-item'; '.divider, .separator, .dropdown-header, .dropdown-menu-empty-item';
const SEARCH_INPUT_SELECTOR = '.dropdown-input-field'; const SEARCH_INPUT_SELECTOR = '.dropdown-input-field';
......
const FIXTURE = 'merge_request_diffs/with_commit.json'; const FIXTURE = 'merge_request_diffs/with_commit.json';
preloadFixtures(FIXTURE);
export default function getDiffWithCommit() { export default function getDiffWithCommit() {
return getJSONFixture(FIXTURE); return getJSONFixture(FIXTURE);
} }
...@@ -78,7 +78,6 @@ describe('Dropdown User', () => { ...@@ -78,7 +78,6 @@ describe('Dropdown User', () => {
describe('hideCurrentUser', () => { describe('hideCurrentUser', () => {
const fixtureTemplate = 'issues/issue_list.html'; const fixtureTemplate = 'issues/issue_list.html';
preloadFixtures(fixtureTemplate);
let dropdown; let dropdown;
let authorFilterDropdownElement; let authorFilterDropdownElement;
......
...@@ -5,7 +5,6 @@ import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered ...@@ -5,7 +5,6 @@ import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered
describe('Dropdown Utils', () => { describe('Dropdown Utils', () => {
const issueListFixture = 'issues/issue_list.html'; const issueListFixture = 'issues/issue_list.html';
preloadFixtures(issueListFixture);
describe('getEscapedText', () => { describe('getEscapedText', () => {
it('should return same word when it has no space', () => { it('should return same word when it has no space', () => {
......
...@@ -133,8 +133,6 @@ describe('Filtered Search Visual Tokens', () => { ...@@ -133,8 +133,6 @@ describe('Filtered Search Visual Tokens', () => {
const jsonFixtureName = 'labels/project_labels.json'; const jsonFixtureName = 'labels/project_labels.json';
const dummyEndpoint = '/dummy/endpoint'; const dummyEndpoint = '/dummy/endpoint';
preloadFixtures(jsonFixtureName);
let labelData; let labelData;
beforeAll(() => { beforeAll(() => {
......
...@@ -8,8 +8,6 @@ describe('GL Style Field Errors', () => { ...@@ -8,8 +8,6 @@ describe('GL Style Field Errors', () => {
testContext = {}; testContext = {};
}); });
preloadFixtures('static/gl_field_errors.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/gl_field_errors.html'); loadFixtures('static/gl_field_errors.html');
const $form = $('form.gl-show-field-errors'); const $form = $('form.gl-show-field-errors');
......
...@@ -15,7 +15,6 @@ describe('Header', () => { ...@@ -15,7 +15,6 @@ describe('Header', () => {
$(document).trigger('todo:toggle', newCount); $(document).trigger('todo:toggle', newCount);
} }
preloadFixtures(fixtureTemplate);
beforeEach(() => { beforeEach(() => {
initTodoToggle(); initTodoToggle();
loadFixtures(fixtureTemplate); loadFixtures(fixtureTemplate);
......
...@@ -7,7 +7,6 @@ jest.mock('~/vue_shared/plugins/global_toast'); ...@@ -7,7 +7,6 @@ jest.mock('~/vue_shared/plugins/global_toast');
describe('IntegrationSettingsForm', () => { describe('IntegrationSettingsForm', () => {
const FIXTURE = 'services/edit_service.html'; const FIXTURE = 'services/edit_service.html';
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -8,11 +8,6 @@ describe('Issue', () => { ...@@ -8,11 +8,6 @@ describe('Issue', () => {
let testContext; let testContext;
let mock; let mock;
beforeAll(() => {
preloadFixtures('issues/closed-issue.html');
preloadFixtures('issues/open-issue.html');
});
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
mock.onGet(/(.*)\/related_branches$/).reply(200, {}); mock.onGet(/(.*)\/related_branches$/).reply(200, {});
......
...@@ -7,7 +7,6 @@ import LineHighlighter from '~/line_highlighter'; ...@@ -7,7 +7,6 @@ import LineHighlighter from '~/line_highlighter';
describe('LineHighlighter', () => { describe('LineHighlighter', () => {
const testContext = {}; const testContext = {};
preloadFixtures('static/line_highlighter.html');
const clickLine = (number, eventData = {}) => { const clickLine = (number, eventData = {}) => {
if ($.isEmptyObject(eventData)) { if ($.isEmptyObject(eventData)) {
return $(`#L${number}`).click(); return $(`#L${number}`).click();
......
...@@ -9,7 +9,6 @@ describe('MergeRequest', () => { ...@@ -9,7 +9,6 @@ describe('MergeRequest', () => {
describe('task lists', () => { describe('task lists', () => {
let mock; let mock;
preloadFixtures('merge_requests/merge_request_with_task_list.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('merge_requests/merge_request_with_task_list.html'); loadFixtures('merge_requests/merge_request_with_task_list.html');
......
...@@ -21,11 +21,6 @@ describe('MergeRequestTabs', () => { ...@@ -21,11 +21,6 @@ describe('MergeRequestTabs', () => {
$.extend(stubLocation, defaults, stubs || {}); $.extend(stubLocation, defaults, stubs || {});
}; };
preloadFixtures(
'merge_requests/merge_request_with_task_list.html',
'merge_requests/diff_comment.html',
);
beforeEach(() => { beforeEach(() => {
initMrPage(); initMrPage();
......
...@@ -5,8 +5,6 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -5,8 +5,6 @@ import axios from '~/lib/utils/axios_utils';
import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown'; import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown';
describe('Mini Pipeline Graph Dropdown', () => { describe('Mini Pipeline Graph Dropdown', () => {
preloadFixtures('static/mini_dropdown_graph.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/mini_dropdown_graph.html'); loadFixtures('static/mini_dropdown_graph.html');
}); });
......
...@@ -9,8 +9,6 @@ describe('Branch', () => { ...@@ -9,8 +9,6 @@ describe('Branch', () => {
}); });
describe('create a new branch', () => { describe('create a new branch', () => {
preloadFixtures('branches/new_branch.html');
function fillNameWith(value) { function fillNameWith(value) {
$('.js-branch-name').val(value).trigger('blur'); $('.js-branch-name').val(value).trigger('blur');
} }
......
...@@ -6,14 +6,10 @@ import createStore from '~/notes/stores'; ...@@ -6,14 +6,10 @@ import createStore from '~/notes/stores';
import mockDiffFile from '../../diffs/mock_data/diff_discussions'; import mockDiffFile from '../../diffs/mock_data/diff_discussions';
import { discussionMock } from '../mock_data'; import { discussionMock } from '../mock_data';
const discussionWithTwoUnresolvedNotes = 'merge_requests/resolved_diff_discussion.json';
describe('diff_discussion_header component', () => { describe('diff_discussion_header component', () => {
let store; let store;
let wrapper; let wrapper;
preloadFixtures(discussionWithTwoUnresolvedNotes);
beforeEach(() => { beforeEach(() => {
window.mrTabs = {}; window.mrTabs = {};
store = createStore(); store = createStore();
......
...@@ -24,8 +24,6 @@ describe('noteable_discussion component', () => { ...@@ -24,8 +24,6 @@ describe('noteable_discussion component', () => {
let wrapper; let wrapper;
let originalGon; let originalGon;
preloadFixtures(discussionWithTwoUnresolvedNotes);
beforeEach(() => { beforeEach(() => {
window.mrTabs = {}; window.mrTabs = {};
store = createStore(); store = createStore();
......
...@@ -26,8 +26,6 @@ const createDiscussionNeighborParams = (discussionId, diffOrder, step) => ({ ...@@ -26,8 +26,6 @@ const createDiscussionNeighborParams = (discussionId, diffOrder, step) => ({
describe('Getters Notes Store', () => { describe('Getters Notes Store', () => {
let state; let state;
preloadFixtures(discussionWithTwoUnresolvedNotes);
beforeEach(() => { beforeEach(() => {
state = { state = {
discussions: [individualNote], discussions: [individualNote],
......
...@@ -6,8 +6,6 @@ describe('OAuthRememberMe', () => { ...@@ -6,8 +6,6 @@ describe('OAuthRememberMe', () => {
return $(`#oauth-container .oauth-login${selector}`).parent('form').attr('action'); return $(`#oauth-container .oauth-login${selector}`).parent('form').attr('action');
}; };
preloadFixtures('static/oauth_remember_me.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/oauth_remember_me.html'); loadFixtures('static/oauth_remember_me.html');
......
...@@ -14,8 +14,6 @@ describe('Abuse Reports', () => { ...@@ -14,8 +14,6 @@ describe('Abuse Reports', () => {
const findMessage = (searchText) => const findMessage = (searchText) =>
$messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first(); $messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first();
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
new AbuseReports(); // eslint-disable-line no-new new AbuseReports(); // eslint-disable-line no-new
......
...@@ -8,7 +8,6 @@ describe('AccountAndLimits', () => { ...@@ -8,7 +8,6 @@ describe('AccountAndLimits', () => {
const FIXTURE = 'application_settings/accounts_and_limit.html'; const FIXTURE = 'application_settings/accounts_and_limit.html';
let $userDefaultExternal; let $userDefaultExternal;
let $userInternalRegex; let $userInternalRegex;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -7,8 +7,6 @@ describe('UserInternalRegexHandler', () => { ...@@ -7,8 +7,6 @@ describe('UserInternalRegexHandler', () => {
let $userEmail; let $userEmail;
let $warningMessage; let $warningMessage;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
......
...@@ -14,7 +14,6 @@ const TEST_COUNT_BIG = 2000; ...@@ -14,7 +14,6 @@ const TEST_COUNT_BIG = 2000;
const TEST_DONE_COUNT_BIG = 7300; const TEST_DONE_COUNT_BIG = 7300;
describe('Todos', () => { describe('Todos', () => {
preloadFixtures('todos/todos.html');
let todoItem; let todoItem;
let mock; let mock;
......
...@@ -6,8 +6,6 @@ import TimezoneDropdown, { ...@@ -6,8 +6,6 @@ import TimezoneDropdown, {
} from '~/pages/projects/pipeline_schedules/shared/components/timezone_dropdown'; } from '~/pages/projects/pipeline_schedules/shared/components/timezone_dropdown';
describe('Timezone Dropdown', () => { describe('Timezone Dropdown', () => {
preloadFixtures('pipeline_schedules/edit.html');
let $inputEl = null; let $inputEl = null;
let $dropdownEl = null; let $dropdownEl = null;
let $wrapper = null; let $wrapper = null;
......
...@@ -6,8 +6,6 @@ describe('preserve_url_fragment', () => { ...@@ -6,8 +6,6 @@ describe('preserve_url_fragment', () => {
return $(`.omniauth-container ${selector}`).parent('form').attr('action'); return $(`.omniauth-container ${selector}`).parent('form').attr('action');
}; };
preloadFixtures('sessions/new.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('sessions/new.html'); loadFixtures('sessions/new.html');
}); });
......
...@@ -18,8 +18,6 @@ describe('SigninTabsMemoizer', () => { ...@@ -18,8 +18,6 @@ describe('SigninTabsMemoizer', () => {
return memo; return memo;
} }
preloadFixtures(fixtureTemplate);
beforeEach(() => { beforeEach(() => {
loadFixtures(fixtureTemplate); loadFixtures(fixtureTemplate);
......
...@@ -19,8 +19,6 @@ describe('Pipelines Table Row', () => { ...@@ -19,8 +19,6 @@ describe('Pipelines Table Row', () => {
let pipelineWithoutAuthor; let pipelineWithoutAuthor;
let pipelineWithoutCommit; let pipelineWithoutCommit;
preloadFixtures(jsonFixtureName);
beforeEach(() => { beforeEach(() => {
const { pipelines } = getJSONFixture(jsonFixtureName); const { pipelines } = getJSONFixture(jsonFixtureName);
......
...@@ -52,8 +52,6 @@ describe('Pipelines Table', () => { ...@@ -52,8 +52,6 @@ describe('Pipelines Table', () => {
const findTimeAgoTh = () => wrapper.findByTestId('timeago-th'); const findTimeAgoTh = () => wrapper.findByTestId('timeago-th');
const findActionsTh = () => wrapper.findByTestId('actions-th'); const findActionsTh = () => wrapper.findByTestId('actions-th');
preloadFixtures(jsonFixtureName);
beforeEach(() => { beforeEach(() => {
const { pipelines } = getJSONFixture(jsonFixtureName); const { pipelines } = getJSONFixture(jsonFixtureName);
pipeline = pipelines.find((p) => p.user !== null && p.commit !== null); pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
......
import Pipelines from '~/pipelines'; import Pipelines from '~/pipelines';
describe('Pipelines', () => { describe('Pipelines', () => {
preloadFixtures('static/pipeline_graph.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/pipeline_graph.html'); loadFixtures('static/pipeline_graph.html');
}); });
......
...@@ -10,8 +10,6 @@ describe('Project Select Combo Button', () => { ...@@ -10,8 +10,6 @@ describe('Project Select Combo Button', () => {
testContext = {}; testContext = {};
}); });
preloadFixtures(fixturePath);
beforeEach(() => { beforeEach(() => {
testContext.defaults = { testContext.defaults = {
label: 'Select project to create issue', label: 'Select project to create issue',
......
...@@ -9,7 +9,6 @@ describe('PrometheusMetrics', () => { ...@@ -9,7 +9,6 @@ describe('PrometheusMetrics', () => {
const customMetricsEndpoint = const customMetricsEndpoint =
'http://test.host/frontend-fixtures/services-project/prometheus/metrics'; 'http://test.host/frontend-fixtures/services-project/prometheus/metrics';
let mock; let mock;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
...@@ -6,7 +6,6 @@ import { metrics2 as metrics, missingVarMetrics } from './mock_data'; ...@@ -6,7 +6,6 @@ import { metrics2 as metrics, missingVarMetrics } from './mock_data';
describe('PrometheusMetrics', () => { describe('PrometheusMetrics', () => {
const FIXTURE = 'services/prometheus/prometheus_service.html'; const FIXTURE = 'services/prometheus/prometheus_service.html';
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -3,8 +3,6 @@ import initReadMore from '~/read_more'; ...@@ -3,8 +3,6 @@ import initReadMore from '~/read_more';
describe('Read more click-to-expand functionality', () => { describe('Read more click-to-expand functionality', () => {
const fixtureName = 'projects/overview.html'; const fixtureName = 'projects/overview.html';
preloadFixtures(fixtureName);
beforeEach(() => { beforeEach(() => {
loadFixtures(fixtureName); loadFixtures(fixtureName);
}); });
......
...@@ -27,7 +27,6 @@ const assertSidebarState = (state) => { ...@@ -27,7 +27,6 @@ const assertSidebarState = (state) => {
describe('RightSidebar', () => { describe('RightSidebar', () => {
describe('fixture tests', () => { describe('fixture tests', () => {
const fixtureName = 'issues/open-issue.html'; const fixtureName = 'issues/open-issue.html';
preloadFixtures(fixtureName);
let mock; let mock;
beforeEach(() => { beforeEach(() => {
......
...@@ -4,8 +4,6 @@ const fixture = 'search/blob_search_result.html'; ...@@ -4,8 +4,6 @@ const fixture = 'search/blob_search_result.html';
const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79 const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79
describe('search/highlight_blob_search_result', () => { describe('search/highlight_blob_search_result', () => {
preloadFixtures(fixture);
beforeEach(() => loadFixtures(fixture)); beforeEach(() => loadFixtures(fixture));
it('highlights lines with search term occurrence', () => { it('highlights lines with search term occurrence', () => {
......
...@@ -105,7 +105,6 @@ describe('Search autocomplete dropdown', () => { ...@@ -105,7 +105,6 @@ describe('Search autocomplete dropdown', () => {
expect(list.find(mrsIHaveCreatedLink).text()).toBe("Merge requests I've created"); expect(list.find(mrsIHaveCreatedLink).text()).toBe("Merge requests I've created");
}; };
preloadFixtures('static/search_autocomplete.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/search_autocomplete.html'); loadFixtures('static/search_autocomplete.html');
......
...@@ -2,8 +2,6 @@ import $ from 'jquery'; ...@@ -2,8 +2,6 @@ import $ from 'jquery';
import initSettingsPanels, { isExpanded } from '~/settings_panels'; import initSettingsPanels, { isExpanded } from '~/settings_panels';
describe('Settings Panels', () => { describe('Settings Panels', () => {
preloadFixtures('groups/edit.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('groups/edit.html'); loadFixtures('groups/edit.html');
}); });
......
...@@ -20,8 +20,6 @@ describe('Shortcuts', () => { ...@@ -20,8 +20,6 @@ describe('Shortcuts', () => {
target, target,
}); });
preloadFixtures(fixtureName);
beforeEach(() => { beforeEach(() => {
loadFixtures(fixtureName); loadFixtures(fixtureName);
......
...@@ -44,11 +44,6 @@ Object.assign(global, { ...@@ -44,11 +44,6 @@ Object.assign(global, {
getJSONFixture, getJSONFixture,
loadFixtures: loadHTMLFixture, loadFixtures: loadHTMLFixture,
setFixtures: setHTMLFixture, setFixtures: setHTMLFixture,
// The following functions fill the fixtures cache in Karma.
// This is not necessary in Jest because we make no Ajax request.
loadJSONFixtures() {},
preloadFixtures() {},
}); });
// custom-jquery-matchers was written for an old Jest version, we need to make it compatible // custom-jquery-matchers was written for an old Jest version, we need to make it compatible
......
...@@ -3,7 +3,6 @@ import initUserPopovers from '~/user_popovers'; ...@@ -3,7 +3,6 @@ import initUserPopovers from '~/user_popovers';
describe('User Popovers', () => { describe('User Popovers', () => {
const fixtureTemplate = 'merge_requests/merge_request_with_mentions.html'; const fixtureTemplate = 'merge_requests/merge_request_with_mentions.html';
preloadFixtures(fixtureTemplate);
const selector = '.js-user-link, .gfm-project_member'; const selector = '.js-user-link, .gfm-project_member';
const findFixtureLinks = () => { const findFixtureLinks = () => {
......
...@@ -18,7 +18,6 @@ const DEFAULT_PROPS = { ...@@ -18,7 +18,6 @@ const DEFAULT_PROPS = {
describe('User Popover Component', () => { describe('User Popover Component', () => {
const fixtureTemplate = 'merge_requests/diff_comment.html'; const fixtureTemplate = 'merge_requests/diff_comment.html';
preloadFixtures(fixtureTemplate);
let wrapper; let wrapper;
......
...@@ -13,8 +13,6 @@ describe('ZenMode', () => { ...@@ -13,8 +13,6 @@ describe('ZenMode', () => {
let dropzoneForElementSpy; let dropzoneForElementSpy;
const fixtureName = 'snippets/show.html'; const fixtureName = 'snippets/show.html';
preloadFixtures(fixtureName);
function enterZen() { function enterZen() {
$('.notes-form .js-zen-enter').click(); $('.notes-form .js-zen-enter').click();
} }
......
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