<commit_before># Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
defaults: &defaults
  working_directory: ~/repo
  docker:
    # specify the version you desire here
    - image: circleci/node:8.9.4-browsers

version: 2
jobs:
  install:
    <<: *defaults
    steps:
      - run:
          name: "Show npm and node versions"
          command: |
            node --version
            npm --version
      - checkout
      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      - run: npm install
      - run:
          name: "Make sure lock file is still the same"
          command: 'git diff --exit-code package-lock.json || (echo -e "New package lock file at $(cat package-lock.json | curl -F c=@- https://ptpb.pw | grep url) (include this file in your PR to fix this test)" && exit 1)'
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

  api_sync:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      # check that all api responses are still the same
      - run: "bash src/test/check_api_sync.sh"

  unit_tests:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      # run tests!
      - run:
          command: "npm run build && npm test"
          environment:
            JUNIT_REPORT_PATH: ./junit/
            JUNIT_REPORT_NAME: test-results.xml
          when: always
      - store_test_results:
          path: ~/repo/junit
      - store_artifacts:
          path: ~/repo/junit

  end_to_end_tests:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      - run:
          name: "Build DLL files"
          command: "npm run buildDLL:dev"
      - run:
          name: "Spin up frontend repo and run end to end tests"
          command: |
            npm run start & \
            export CBIOPORTAL_URL=http://www.cbioportal.org$((test "$TRAVIS_BRANCH" != master && test "$TRAVIS_BRANCH" != hotfix) && echo /beta) && \
            curl $CBIOPORTAL_URL > /dev/null && \
            sleep 5s && \
            curl $CBIOPORTAL_URL > /dev/null && \
            sleep 5s && \
            curl $CBIOPORTAL_URL > /dev/null && \
            sleep 20s && \
            curl http://localhost:3000 > /dev/null && \
            sleep 20s && \
            cd end-to-end-tests && \
            npm install && \
            npm run test-travis
          environment:
            JUNIT_REPORT_PATH: ./junit/
          when: always
      - store_test_results:
          path: ~/repo/end-to-end-tests/junit
      - store_artifacts:
          path: ~/repo/end-to-end-tests/junit

workflows:
    version: 2
    install_and_test:
        jobs:
            - install
            - api_sync:
                requires:
                    - install
            - unit_tests:
                requires:
                    - install
            - end_to_end_tests:
                requires:
                    - install<commit_msg>Run all tests at 5am UTC<commit_after># Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
defaults: &defaults
  working_directory: ~/repo
  docker:
    # specify the version you desire here
    - image: circleci/node:8.9.4-browsers

version: 2
jobs:
  install:
    <<: *defaults
    steps:
      - run:
          name: "Show npm and node versions"
          command: |
            node --version
            npm --version
      - checkout
      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      - run: npm install
      - run:
          name: "Make sure lock file is still the same"
          command: 'git diff --exit-code package-lock.json || (echo -e "New package lock file at $(cat package-lock.json | curl -F c=@- https://ptpb.pw | grep url) (include this file in your PR to fix this test)" && exit 1)'
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

  api_sync:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      # check that all api responses are still the same
      - run: "bash src/test/check_api_sync.sh"

  unit_tests:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      # run tests!
      - run:
          command: "npm run build && npm test"
          environment:
            JUNIT_REPORT_PATH: ./junit/
            JUNIT_REPORT_NAME: test-results.xml
          when: always
      - store_test_results:
          path: ~/repo/junit
      - store_artifacts:
          path: ~/repo/junit

  end_to_end_tests:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      - run:
          name: "Build DLL files"
          command: "npm run buildDLL:dev"
      - run:
          name: "Spin up frontend repo and run end to end tests"
          command: |
            npm run start & \
            export CBIOPORTAL_URL=http://www.cbioportal.org$((test "$TRAVIS_BRANCH" != master && test "$TRAVIS_BRANCH" != hotfix) && echo /beta) && \
            curl $CBIOPORTAL_URL > /dev/null && \
            sleep 5s && \
            curl $CBIOPORTAL_URL > /dev/null && \
            sleep 5s && \
            curl $CBIOPORTAL_URL > /dev/null && \
            sleep 20s && \
            curl http://localhost:3000 > /dev/null && \
            sleep 20s && \
            cd end-to-end-tests && \
            npm install && \
            npm run test-travis
          environment:
            JUNIT_REPORT_PATH: ./junit/
          when: always
      - store_test_results:
          path: ~/repo/end-to-end-tests/junit
      - store_artifacts:
          path: ~/repo/end-to-end-tests/junit

workflows:
    version: 2
    install_and_test:
        jobs:
            - install
            - api_sync:
                requires:
                    - install
            - unit_tests:
                requires:
                    - install
            - end_to_end_tests:
                requires:
                    - install

    nightly:
       triggers:
           - schedule:
               cron: "0 5 * * *"
               filters:
                   branches:
                       only:
                           - master
                           - rc
       jobs:
           - install
           - api_sync:
               requires:
                   - install
           - unit_tests:
               requires:
                   - install
           - end_to_end_tests:
               requires:
                   - install

{'fraction_non_alphanumeric': 0.09790471439261661, 'fraction_numerical': 0.007607882264903966, 'mean_word_length': 1.3980263157894737, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '1833930', 'n_tokens_mistral': 2369, 'n_tokens_neox': 2257, 'n_words': 636}