<commit_before>name: BDD Tests
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    container: python:3.9-slim

    services:
      couchdb:
        image: couchdb:latest
        ports:
          - 5984:5984
        env:
          COUCHDB_USER: admin                  
          COUCHDB_PASSWORD: <PASSWORD>                  
        options: >-
          --health-cmd "curl -X GET http://couchdb:5984/"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v2

      # - uses: browser-actions/setup-chrome@latest
      # - run: chrome --version

      # - name: setup-chromedriver
      #   uses: nanasess/setup-chromedriver@v1.0.1

      - name: Install dependencies
        run: |
          apt-get update
          apt-get install -y sudo git curl wget python3-selenium

      - name: Install packages
        run: |
          python -m pip install --upgrade pip wheel
          pip install -r requirements.txt

      - name: Run the server locally
        run: |
          curl -X PUT http://admin:pass@couchdb:5984/test
          gunicorn --log-level=critical --bind=127.0.0.1:8080 service:app &  # start a Web server in the background
          sleep 5
          curl -I http://localhost:8080/

      - name: Run unit tests with nose
        run: behave
        env:
          BINDING_CLOUDANT: '{"username":"admin","password":"<PASSWORD>","host":"couchdb","port":5984,"url":"http://admin:pass@couchdb:5984"}'

      - name: Upload code coverage
        uses: codecov/codecov-action@v2  
  <commit_msg>Move env vars to app server<commit_after>name: BDD Tests
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    container: python:3.9-slim

    services:
      couchdb:
        image: couchdb:latest
        ports:
          - 5984:5984
        env:
          COUCHDB_USER: admin                  
          COUCHDB_PASSWORD: <PASSWORD>                  
        options: >-
          --health-cmd "curl -X GET http://couchdb:5984/"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v2

      # - uses: browser-actions/setup-chrome@latest
      # - run: chrome --version

      # - name: setup-chromedriver
      #   uses: nanasess/setup-chromedriver@v1.0.1

      - name: Install dependencies
        run: |
          apt-get update
          apt-get install -y sudo git curl wget python3-selenium

      - name: Install packages
        run: |
          python -m pip install --upgrade pip wheel
          pip install -r requirements.txt

      - name: Run the server locally
        run: |
          echo "*** CREATING TEST DB ***"
          curl -X PUT http://admin:pass@couchdb:5984/test
          echo "*** STARTING APPLICATION ***"
          gunicorn --log-level=critical --bind=0.0.0.0:8080 service:app &
          sleep 5
          curl -I http://localhost:8080/
          echo "*** SERVER IS RUNNING ***"
        env:
          BINDING_CLOUDANT: '{"username":"admin","password":"<PASSWORD>","host":"couchdb","port":5984,"url":"http://admin:pass@couchdb:5984"}'

      - name: Run unit tests with nose
        run: behave

      - name: Upload code coverage
        uses: codecov/codecov-action@v2  
  
{'fraction_non_alphanumeric': 0.11246730601569312, 'fraction_numerical': 0.02906131938390003, 'mean_word_length': 1.6848673946957877, 'pattern_counts': {'":': 10, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1760027', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1043, 'n_words': 255}