<commit_before>image: "ruby:2.1"

services:
  - mysql:latest
  - redis:alpine

cache:
  key: "ruby21"
  paths:
  - vendor

variables:
  MYSQL_ALLOW_EMPTY_PASSWORD: "1"
  # retry tests only in CI environment
  RSPEC_RETRY_RETRY_COUNT: "3"
  RAILS_ENV: "test"
  SIMPLECOV: "true"
  USE_DB: "true"
  USE_BUNDLE_INSTALL: "true"

before_script:
  - source ./scripts/prepare_build.sh
  - cp config/gitlab.yml.example config/gitlab.yml
  - bundle --version
  - '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"'
  - retry gem install knapsack
  - '[ "$USE_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate'

stages:
- prepare
- test
- post-test
- notifications

# Prepare and merge knapsack tests

.knapsack-state: &knapsack-state
  services: []
  variables:
    USE_DB: "false"
    USE_BUNDLE_INSTALL: "false"
  cache:
    key: "knapsack"
    paths:
    - knapsack/
  artifacts:
    paths:
    - knapsack/

knapsack:
  <<: *knapsack-state
  stage: prepare
  script:
    - mkdir -p knapsack/
    - '[[ -f knapsack/rspec_report.json ]] || echo "{}" > knapsack/rspec_report.json'
    - '[[ -f knapsack/spinach_report.json ]] || echo "{}" > knapsack/spinach_report.json'

update-knapsack:
  <<: *knapsack-state
  stage: post-test
  script:
    - scripts/merge-reports knapsack/rspec_report.json knapsack/rspec_node_*.json<commit_msg>Remove stage notifications [ci skip]<commit_after>image: "ruby:2.1"

services:
  - mysql:latest
  - redis:alpine

cache:
  key: "ruby21"
  paths:
  - vendor

variables:
  MYSQL_ALLOW_EMPTY_PASSWORD: "1"
  # retry tests only in CI environment
  RSPEC_RETRY_RETRY_COUNT: "3"
  RAILS_ENV: "test"
  SIMPLECOV: "true"
  USE_DB: "true"
  USE_BUNDLE_INSTALL: "true"

before_script:
  - source ./scripts/prepare_build.sh
  - cp config/gitlab.yml.example config/gitlab.yml
  - bundle --version
  - '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"'
  - retry gem install knapsack
  - '[ "$USE_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate'

stages:
- prepare
- test
- post-test

# Prepare and merge knapsack tests

.knapsack-state: &knapsack-state
  services: []
  variables:
    USE_DB: "false"
    USE_BUNDLE_INSTALL: "false"
  cache:
    key: "knapsack"
    paths:
    - knapsack/
  artifacts:
    paths:
    - knapsack/

knapsack:
  <<: *knapsack-state
  stage: prepare
  script:
    - mkdir -p knapsack/
    - '[[ -f knapsack/rspec_report.json ]] || echo "{}" > knapsack/rspec_report.json'
    - '[[ -f knapsack/spinach_report.json ]] || echo "{}" > knapsack/spinach_report.json'

update-knapsack:
  <<: *knapsack-state
  stage: post-test
  script:
    - scripts/merge-reports knapsack/rspec_report.json knapsack/rspec_node_*.json
{'fraction_non_alphanumeric': 0.1425569176882662, 'fraction_numerical': 0.004203152364273205, 'mean_word_length': 3.393846153846154, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '1721699', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1110, 'n_words': 224}