<commit_before># CircleCI 2.0 configuration file. See <https://circleci.com/docs/2.0/language-python/>.
version: 2
jobs:
  build:
    # parallelism: 4
    docker:
      - image: circleci/node:8-jessie-browsers
    environment:
      WATAI_TESTS: tests/integration
      SAUCE_USERNAME: openfisca
      # SAUCE_ACCESS_KEY is defined in the CircleCI web UI
      PORT: 2030 # Legislation Explorer ExpressJS server port

    steps:
      - checkout
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - restore_cache:
          key: sc-4.4.9
      - run:
          name: Install app dependencies
          command: npm install
      - run:
          name: Install saucelabs
          command: |
            npm install saucelabs --no-save # allow sending Watai results to SauceLabs. Don't save in package.json, as this would change its checksum and mess up the cache.
            if [ -d sc ]; then exit; fi  # sc has already been downloaded
            mkdir sc
            wget https://saucelabs.com/downloads/sc-4.4.9-linux.tar.gz --directory-prefix sc
            tar -xzf sc/sc-4.4.9-linux.tar.gz --directory sc
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
      - save_cache:
          key: sc-4.4.9
          paths:
            - sc
      - run:
          name: Copy CI .env file
          command: cp .circleci/.env.ci .env
      - run:
          name: Build app
          command: npm run build
      - run:
          name: Run app
          command: npm start
          background: true
      - run:
          name: Start Sauce Connect
          command: cd sc/sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --tunnel-identifier "circle-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX" --readyfile ~/sauce_is_ready > /tmp/sauce_log.txt
          background: true
      - run:
          name: Wait for Sauce Connect
          command: while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
      - run:
          name: Wait for app to start
          command: wget --retry-connrefused --waitretry=1 --quiet http://localhost:$PORT
      - run:
          name: Prepare CI-specific config holder and add CI-specific config to Watai
          command: mkdir $HOME/.watai && cp $WATAI_TESTS/config-ci.js $HOME/.watai/config.js
      - run:
          name: Run tests
          command: npm test
      - run:
          name: Kill Sauce Connect
          command: pkill sc
      - store_artifacts:
          path: /tmp/sauce_log.txt
          destination: sauce-log

workflows:
  version: 2
  build:
    jobs:
      - build
<commit_msg>Unleash parralelism<commit_after># CircleCI 2.0 configuration file. See <https://circleci.com/docs/2.0/language-python/>.
version: 2
jobs:
  build:
    parallelism: 4
    docker:
      - image: circleci/node:8-jessie-browsers
    environment:
      WATAI_TESTS: tests/integration
      SAUCE_USERNAME: openfisca
      # SAUCE_ACCESS_KEY is defined in the CircleCI web UI
      PORT: 2030 # Legislation Explorer ExpressJS server port

    steps:
      - checkout
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - restore_cache:
          key: sc-4.4.9
      - run:
          name: Install app dependencies
          command: npm install
      - run:
          name: Install saucelabs
          command: |
            npm install saucelabs --no-save # allow sending Watai results to SauceLabs. Don't save in package.json, as this would change its checksum and mess up the cache.
            if [ -d sc ]; then exit; fi  # sc has already been downloaded
            mkdir sc
            wget https://saucelabs.com/downloads/sc-4.4.9-linux.tar.gz --directory-prefix sc
            tar -xzf sc/sc-4.4.9-linux.tar.gz --directory sc
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
      - save_cache:
          key: sc-4.4.9
          paths:
            - sc
      - run:
          name: Copy CI .env file
          command: cp .circleci/.env.ci .env
      - run:
          name: Build app
          command: npm run build
      - run:
          name: Run app
          command: npm start
          background: true
      - run:
          name: Start Sauce Connect
          command: cd sc/sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --tunnel-identifier "circle-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX" --readyfile ~/sauce_is_ready > /tmp/sauce_log.txt
          background: true
      - run:
          name: Wait for Sauce Connect
          command: while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
      - run:
          name: Wait for app to start
          command: wget --retry-connrefused --waitretry=1 --quiet http://localhost:$PORT
      - run:
          name: Prepare CI-specific config holder and add CI-specific config to Watai
          command: mkdir $HOME/.watai && cp $WATAI_TESTS/config-ci.js $HOME/.watai/config.js
      - run:
          name: Run tests
          command: npm test
      - run:
          name: Kill Sauce Connect
          command: pkill sc
      - store_artifacts:
          path: /tmp/sauce_log.txt
          destination: sauce-log

workflows:
  version: 2
  build:
    jobs:
      - build

{'fraction_non_alphanumeric': 0.0958364591147787, 'fraction_numerical': 0.009752438109527382, 'mean_word_length': 1.7250894225855902, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4077968', 'n_tokens_mistral': 1684, 'n_tokens_neox': 1623, 'n_words': 473}