<commit_before>version: 2
jobs:
  build:
    docker:
      - image: codegram/decidim
        environment:
          SIMPLECOV: true
          DATABASE_USERNAME: postgres
      - image: postgres
        environment:
          POSTGRES_USER: postgres
    parallelism: 4
    working_directory: /code
    steps:
      - run:
          name: Install PhantomJS
          command: |
            curl -OLk https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
            tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2
            mv phantomjs-2.1.1-linux-x86_64 /usr/local/share
            ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
            rm phantomjs-2.1.1-linux-x86_64.tar.bz2
      - checkout
      - run:
          name: Install app dependencies
          command: |
            bundle install
            npm i
      - run:
          name: Generate test app
          command: bundle exec rake decidim:generate_test_app
      - run:
          name: Run tests
          command: |
            case $CIRCLE_NODE_INDEX in
              0)
                (cd /code && npm run lint) &&
                (cd /code && npm test -- decidim-api) &&
                (cd /code/decidim-api && bundle exec rake) &&
                (cd /code && npm test -- decidim-core) &&
                (cd /code/decidim-core && bundle exec rake) &&
                (cd /code && npm test -- decidim-participatory_processes) &&
                (cd /code/decidim-participatory_processes && bundle exec rake) &&
                (cd /code && npm test -- decidim-assemblies) &&
                (cd /code/decidim-assemblies && bundle exec rake)
                ;;
              1)
                (cd /code && bundle exec rspec) &&
                (cd /code && npm test -- decidim-admin) &&
                (cd /code/decidim-admin && bundle exec rake) &&
                (cd /code && npm test -- decidim-meetings) &&
                (cd /code/decidim-meetings && bundle exec rake)
                ;;
              2)
                (cd /code && npm test -- decidim-proposals) &&
                (cd /code/decidim-proposals && bundle exec rake) &&
                (cd /code && npm test -- decidim-comments) &&
                (cd /code/decidim-comments && bundle exec rake)
                ;;
              3)
                (cd /code && npm test -- decidim-pages) &&
                (cd /code/decidim-pages && bundle exec rake) &&
                (cd /code && npm test -- decidim-system) &&
                (cd /code/decidim-system && bundle exec rake) &&
                (cd /code && npm test -- decidim-results) &&
                (cd /code/decidim-results && bundle exec rake) &&
                (cd /code && npm test -- decidim-budgets) &&
                (cd /code/decidim-budgets && bundle exec rake) &&
                (cd /code && npm test -- decidim-surveys) &&
                (cd /code/decidim-surveys && bundle exec rake)
                ;;
            esac
      - store_artifacts:
          path: /code/spec/decidim_dummy_app/tmp/capybara
<commit_msg>[WIP] Balance test builds timings (#1767)<commit_after>version: 2
jobs:
  build:
    docker:
      - image: codegram/decidim
        environment:
          SIMPLECOV: true
          DATABASE_USERNAME: postgres
      - image: postgres
        environment:
          POSTGRES_USER: postgres
    parallelism: 4
    working_directory: /code
    steps:
      - run:
          name: Install PhantomJS
          command: |
            curl -OLk https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
            tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2
            mv phantomjs-2.1.1-linux-x86_64 /usr/local/share
            ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
            rm phantomjs-2.1.1-linux-x86_64.tar.bz2
      - checkout
      - run:
          name: Install app dependencies
          command: |
            bundle install
            npm i
      - run:
          name: Generate test app
          command: bundle exec rake decidim:generate_test_app
      - run:
          name: Run tests
          command: |
            case $CIRCLE_NODE_INDEX in
              0)
                (cd /code && time npm run lint) &&
                (cd /code && time bundle exec rspec) &&
                (cd /code && time npm test -- decidim-core) &&
                (cd /code/decidim-core && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-assemblies) &&
                (cd /code/decidim-assemblies && time bundle exec rake)
                ;;
              1)
                (cd /code && time npm test -- decidim-api) &&
                (cd /code/decidim-api && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-participatory_processes) &&
                (cd /code/decidim-participatory_processes && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-admin) &&
                (cd /code/decidim-admin && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-system) &&
                (cd /code/decidim-system && time bundle exec rake)
                ;;
              2)
                (cd /code && time npm test -- decidim-proposals) &&
                (cd /code/decidim-proposals && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-comments) &&
                (cd /code/decidim-comments && time bundle exec rake)
                ;;
              3)
                (cd /code && time npm test -- decidim-meetings) &&
                (cd /code/decidim-meetings && time bundle exec rake)
                (cd /code && time npm test -- decidim-pages) &&
                (cd /code/decidim-pages && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-results) &&
                (cd /code/decidim-results && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-budgets) &&
                (cd /code/decidim-budgets && time bundle exec rake) &&
                (cd /code && time npm test -- decidim-surveys) &&
                (cd /code/decidim-surveys && time bundle exec rake)
                ;;
            esac
      - store_artifacts:
          path: /code/spec/decidim_dummy_app/tmp/capybara

{'fraction_non_alphanumeric': 0.11616240790092491, 'fraction_numerical': 0.01442232324815802, 'mean_word_length': 1.3568526043590692, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6112523', 'n_tokens_mistral': 2054, 'n_tokens_neox': 1869, 'n_words': 471}