<commit_before>image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6"

cache:
  key: "ruby-233-with-yarn"
  paths:
  - vendor/ruby
  - .yarn-cache/

variables:
  MYSQL_ALLOW_EMPTY_PASSWORD: "1"
  RAILS_ENV: "test"
  NODE_ENV: "test"
  SIMPLECOV: "true"
  GIT_DEPTH: "20"
  GIT_SUBMODULE_STRATEGY: "none"
  PHANTOMJS_VERSION: "2.1.1"
  GET_SOURCES_ATTEMPTS: "3"
  KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master.json
  KNAPSACK_SPINACH_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/spinach_report-master.json

before_script:
  - bundle --version
  - source scripts/utils.sh
  - source scripts/prepare_build.sh

stages:
- build
- prepare
- test
- post-test
- pages

# Predefined scopes
.dedicated-runner: &dedicated-runner
  tags:
    - gitlab-org

.knapsack-state: &knapsack-state
  services: []
  variables:
    SETUP_DB: "false"
    USE_BUNDLE_INSTALL: "false"
    KNAPSACK_S3_BUCKET: "gitlab-ce-cache"
  cache:
    key: "knapsack"
    paths:
      - knapsack/
  artifacts:
    expire_in: 31d
    paths:
      - knapsack/

.use-pg: &use-pg
  services:
    - postgres:latest
    - redis:alpine

.use-mysql: &use-mysql
  services:
    - mysql:latest
    - redis:alpine

.only-master-and-ee-or-mysql: &only-master-and-ee-or-mysql
  only:
    - /mysql/
    - master@gitlab-org/gitlab-ce
    - master@gitlab/gitlabhq
    - tags@gitlab-org/gitlab-ce
    - tags@gitlab/gitlabhq
    - //@gitlab-org/gitlab-ee
    - //@gitlab/gitlab-ee

# Skip all jobs except the ones that begin with 'docs/'.
# Used for commits including ONLY documentation changes.
# https://docs.gitlab.com/ce/development/writing_documentation.html#testing
.except-docs: &except-docs
  except:
    - /(^docs[\/-].*|.*-docs$)/

.rspec-knapsack: &rspec-knapsack
  stage: test
  <<: *dedicated-runner
  script:
    - JOB_NAME=( $CI_JOB_NAME )
    - export CI_NODE_INDEX=${JOB_NAME[-2]}
    - export CI_NODE_TOTAL=${JOB_NAME[-1]}
    - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
    - export KNAPSACK_GENERATE_REPORT=true
    - export CACHE_CLASSES=true
    - cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
    - knapsack rspec "--color --format documentation"
  artifacts:
    expire_in: 31d<commit_msg>Run MySQL tests on *-stable as well<commit_after>image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6"

cache:
  key: "ruby-233-with-yarn"
  paths:
  - vendor/ruby
  - .yarn-cache/

variables:
  MYSQL_ALLOW_EMPTY_PASSWORD: "1"
  RAILS_ENV: "test"
  NODE_ENV: "test"
  SIMPLECOV: "true"
  GIT_DEPTH: "20"
  GIT_SUBMODULE_STRATEGY: "none"
  PHANTOMJS_VERSION: "2.1.1"
  GET_SOURCES_ATTEMPTS: "3"
  KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master.json
  KNAPSACK_SPINACH_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/spinach_report-master.json

before_script:
  - bundle --version
  - source scripts/utils.sh
  - source scripts/prepare_build.sh

stages:
- build
- prepare
- test
- post-test
- pages

# Predefined scopes
.dedicated-runner: &dedicated-runner
  tags:
    - gitlab-org

.knapsack-state: &knapsack-state
  services: []
  variables:
    SETUP_DB: "false"
    USE_BUNDLE_INSTALL: "false"
    KNAPSACK_S3_BUCKET: "gitlab-ce-cache"
  cache:
    key: "knapsack"
    paths:
      - knapsack/
  artifacts:
    expire_in: 31d
    paths:
      - knapsack/

.use-pg: &use-pg
  services:
    - postgres:latest
    - redis:alpine

.use-mysql: &use-mysql
  services:
    - mysql:latest
    - redis:alpine

.only-master-and-ee-or-mysql: &only-master-and-ee-or-mysql
  only:
    - /mysql/
    - /-stable$/
    - master@gitlab-org/gitlab-ce
    - master@gitlab/gitlabhq
    - tags@gitlab-org/gitlab-ce
    - tags@gitlab/gitlabhq
    - //@gitlab-org/gitlab-ee
    - //@gitlab/gitlab-ee

# Skip all jobs except the ones that begin with 'docs/'.
# Used for commits including ONLY documentation changes.
# https://docs.gitlab.com/ce/development/writing_documentation.html#testing
.except-docs: &except-docs
  except:
    - /(^docs[\/-].*|.*-docs$)/

.rspec-knapsack: &rspec-knapsack
  stage: test
  <<: *dedicated-runner
  script:
    - JOB_NAME=( $CI_JOB_NAME )
    - export CI_NODE_INDEX=${JOB_NAME[-2]}
    - export CI_NODE_TOTAL=${JOB_NAME[-1]}
    - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
    - export KNAPSACK_GENERATE_REPORT=true
    - export CACHE_CLASSES=true
    - cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
    - knapsack rspec "--color --format documentation"
  artifacts:
    expire_in: 31d
{'fraction_non_alphanumeric': 0.13883637891199327, 'fraction_numerical': 0.014702793530770846, 'mean_word_length': 3.336976320582878, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4758691', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1973, 'n_words': 284}