Commit bc5d3b91 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch...

Merge branch '227005-consider-running-eslint-as-if-foss-to-catch-potential-foss-specific-failures-in-advance' into 'master'

Run eslint as-if-foss upon any frontend changes in EE

Closes #227005

See merge request gitlab-org/gitlab!36049
parents 22c0334a 2562dc81
...@@ -2,16 +2,18 @@ ...@@ -2,16 +2,18 @@
extends: extends:
- .default-retry - .default-retry
- .default-before_script - .default-before_script
- .assets-compile-cache
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
# we override the max_old_space_size to prevent OOM errors # we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584 NODE_OPTIONS: --max_old_space_size=3584
WEBPACK_VENDOR_DLL: "true"
.compile-assets-base: .compile-assets-base:
extends: .frontend-base extends:
- .frontend-base
- .assets-compile-cache
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-git-2.27-lfs-2.9-node-12.x-yarn-1.21-graphicsmagick-1.3.34 image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-git-2.27-lfs-2.9-node-12.x-yarn-1.21-graphicsmagick-1.3.34
variables:
WEBPACK_VENDOR_DLL: "true"
stage: prepare stage: prepare
script: script:
- node --version - node --version
...@@ -99,6 +101,7 @@ update-yarn-cache: ...@@ -99,6 +101,7 @@ update-yarn-cache:
needs: ["setup-test-env", "compile-test-assets"] needs: ["setup-test-env", "compile-test-assets"]
variables: variables:
SETUP_DB: "true" SETUP_DB: "true"
WEBPACK_VENDOR_DLL: "true"
script: script:
- run_timed_command "scripts/gitaly-test-build" - run_timed_command "scripts/gitaly-test-build"
- run_timed_command "scripts/gitaly-test-spawn" - run_timed_command "scripts/gitaly-test-spawn"
...@@ -123,22 +126,25 @@ frontend-fixtures-as-if-foss: ...@@ -123,22 +126,25 @@ frontend-fixtures-as-if-foss:
.frontend-test-base: .frontend-test-base:
extends: extends:
- .default-retry - .frontend-base
- .yarn-cache - .yarn-cache
variables: variables:
USE_BUNDLE_INSTALL: "false" USE_BUNDLE_INSTALL: "false"
SETUP_DB: "false"
stage: test stage: test
before_script:
- source scripts/utils.sh eslint-as-if-foss:
extends:
- .frontend-test-base
- .frontend:rules:eslint-as-if-foss
- .as-if-foss
needs: []
script:
- run_timed_command "retry yarn install --frozen-lockfile"
- yarn run eslint
.karma-base: .karma-base:
extends: .frontend-test-base extends: .frontend-test-base
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
script: script:
- source scripts/utils.sh
- export BABEL_ENV=coverage CHROME_LOG_FILE=chrome_debug.log - export BABEL_ENV=coverage CHROME_LOG_FILE=chrome_debug.log
- run_timed_command "retry yarn install --frozen-lockfile" - run_timed_command "retry yarn install --frozen-lockfile"
- run_timed_command "yarn karma" - run_timed_command "yarn karma"
...@@ -171,7 +177,6 @@ karma-as-if-foss: ...@@ -171,7 +177,6 @@ karma-as-if-foss:
.jest-base: .jest-base:
extends: .frontend-test-base extends: .frontend-test-base
script: script:
- source scripts/utils.sh
- run_timed_command "retry yarn install --frozen-lockfile" - run_timed_command "retry yarn install --frozen-lockfile"
- run_timed_command "yarn jest --ci --coverage --testSequencer ./scripts/frontend/parallel_ci_sequencer.js" - run_timed_command "yarn jest --ci --coverage --testSequencer ./scripts/frontend/parallel_ci_sequencer.js"
...@@ -197,7 +202,6 @@ jest-integration: ...@@ -197,7 +202,6 @@ jest-integration:
- .frontend-test-base - .frontend-test-base
- .frontend:rules:default-frontend-jobs - .frontend:rules:default-frontend-jobs
script: script:
- source scripts/utils.sh
- run_timed_command "retry yarn install --frozen-lockfile" - run_timed_command "retry yarn install --frozen-lockfile"
- run_timed_command "yarn jest:integration --ci" - run_timed_command "yarn jest:integration --ci"
needs: ["frontend-fixtures"] needs: ["frontend-fixtures"]
......
...@@ -340,6 +340,15 @@ ...@@ -340,6 +340,15 @@
- <<: *if-merge-request - <<: *if-merge-request
changes: *ci-patterns changes: *ci-patterns
.frontend:rules:eslint-as-if-foss:
rules:
- <<: *if-not-ee
when: never
- <<: *if-merge-request-title-as-if-foss
when: never
- <<: *if-merge-request
changes: *frontend-patterns
.frontend:rules:ee-mr-and-master-only: .frontend:rules:ee-mr-and-master-only:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
......
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