<commit_before># .circleci/config.yml
version: 2
jobs:

  build:
    machine: true
    steps:
      - checkout

      - run:
          name: Create Docker Compose configuration file
          command: |
            echo "POSTGRES_USER=postgres" >> ./.env
            echo "POSTGRES_PASSWORD=password" >> ./.env
            echo "DATABASE_URL=postgres://postgres:password@db:5432/data_quality" >> ./.env
            echo "GRAPHQL_URL=http://graphql:5433/graphql" >> ./.env
            echo "MAIL_HOST=smtp.server.org" >> ./.env
            echo "MAIL_PORT=25" >> ./.env
            echo "MAIL_SENDER=<EMAIL>" >> ./.env
            echo "NODE_ENV=development" >> ./.env
            echo "REACT_APP_GRAPHQL_API_URL=http://0.0.0.0:5433/graphql" >> ./.env

      - run:
          name: Build Docker images
          command: |
            docker-compose -f docker-compose.yml -f docker-compose.test.yml build db

      - run:
          name: Run Docker containers
          command: |
            docker network create data-quality-network
            docker volume create data-quality-db-volume
            docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d db
            docker ps -a

      - run:
          name: Install Unix ODBC
          command: |
            sudo apt-get update
            sudo apt-get install -y g++ unixodbc-dev

      - run:
          name: Install FreeTDS ODBC driver
          command: |
            sudo apt-get install -y tdsodbc

      - run:
          name: Install MySQL ODBC driver
          command: |
            sudo tar xvzf ./scripts/init/drivers/mysql-connector-odbc-8.0.12-linux-debian9-x86-64bit.tar.gz
            sudo cp ./mysql-connector-odbc-8.0.12-linux-debian9-x86-64bit/lib/libmyodbc8* /usr/lib/x86_64-linux-gnu/odbc/
            sudo rm -R ./mysql-connector-odbc-8.0.12-linux-debian9-x86-64bit

      - run:
          name: Install PostgreSQL ODBC driver
          command: |
            sudo apt-get install -y odbc-postgresql

      - run:
          name: Install Teradata ODBC driver
          command: |
            sudo apt-get install -y lib32stdc++6
            sudo tar xvzf ./scripts/init/drivers/tdodbc1620__ubuntu_indep.16.20.00.36-1.tar.gz
            sudo dpkg -i ./tdodbc1620/tdodbc1620-16.20.00.36-1.noarch.deb
            sudo rm -R ./tdodbc1620

      - run:
          name: Move ODBC configuration file
          command: |
            sudo cp ./scripts/init/odbcinst.ini /etc

      - run:
          name: Show ODBC configuration file
          command: |
            cat /etc/odbcinst.ini
            cd /usr/lib/x86_64-linux-gnu/odbc/
            ls -l

      - run:
          name: Install Python environment
          command: |
            sudo apt-get install software-properties-common
            sudo add-apt-repository ppa:deadsnakes/ppa
            sudo apt-get update
            sudo apt-get install python3.6
            sudo apt-get install python3-pip

      - run:
          name: Install Python dependencies
          command: |
            sudo pip3 install --upgrade pip
            sudo pip3 install pyodbc

      - run:
          name: Test Pyodbc connection to postgreSQL
          command: |
            python3.6 -V
            pip list
            pip3 list
            python ./test/test_pyodbc.py

      - store_artifacts:
          path: test/junit/test-results.xml
          destination: test-results

      - store_test_results:
          path: test<commit_msg>Test CircleCI configuration<commit_after># .circleci/config.yml
version: 2
jobs:

  build:
    machine: true
    steps:
      - checkout

      - run:
          name: Create Docker Compose configuration file
          command: |
            echo "POSTGRES_USER=postgres" >> ./.env
            echo "POSTGRES_PASSWORD=password" >> ./.env
            echo "DATABASE_URL=postgres://postgres:password@db:5432/data_quality" >> ./.env
            echo "GRAPHQL_URL=http://graphql:5433/graphql" >> ./.env
            echo "MAIL_HOST=smtp.server.org" >> ./.env
            echo "MAIL_PORT=25" >> ./.env
            echo "MAIL_SENDER=<EMAIL>" >> ./.env
            echo "NODE_ENV=development" >> ./.env
            echo "REACT_APP_GRAPHQL_API_URL=http://0.0.0.0:5433/graphql" >> ./.env

      - run:
          name: Build Docker images
          command: |
            docker-compose -f docker-compose.yml -f docker-compose.test.yml build db

      - run:
          name: Run Docker containers
          command: |
            docker network create data-quality-network
            docker volume create data-quality-db-volume
            docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d db
            docker ps -a

      - run:
          name: Install Unix ODBC
          command: |
            sudo apt-get update
            sudo apt-get install -y g++ unixodbc-dev

      - run:
          name: Install FreeTDS ODBC driver
          command: |
            sudo apt-get install -y tdsodbc

      - run:
          name: Install MySQL ODBC driver
          command: |
            sudo tar xvzf ./scripts/init/drivers/mysql-connector-odbc-8.0.12-linux-debian9-x86-64bit.tar.gz
            sudo cp ./mysql-connector-odbc-8.0.12-linux-debian9-x86-64bit/lib/libmyodbc8* /usr/lib/x86_64-linux-gnu/odbc/
            sudo rm -R ./mysql-connector-odbc-8.0.12-linux-debian9-x86-64bit

      - run:
          name: Install PostgreSQL ODBC driver
          command: |
            sudo apt-get install -y odbc-postgresql

      - run:
          name: Install Teradata ODBC driver
          command: |
            sudo apt-get install -y lib32stdc++6
            sudo tar xvzf ./scripts/init/drivers/tdodbc1620__ubuntu_indep.16.20.00.36-1.tar.gz
            sudo dpkg -i ./tdodbc1620/tdodbc1620-16.20.00.36-1.noarch.deb
            sudo rm -R ./tdodbc1620

      - run:
          name: Move ODBC configuration file
          command: |
            sudo cp ./scripts/init/odbcinst.ini /etc

      - run:
          name: Show ODBC configuration file
          command: |
            cat /etc/odbcinst.ini
            cd /usr/lib/x86_64-linux-gnu/odbc/
            ls -l

      - run:
          name: Install Python environment
          command: |
            sudo apt-get install software-properties-common
            sudo add-apt-repository ppa:deadsnakes/ppa
            sudo apt-get update
            sudo apt-get install python3.6
            sudo apt-get install python3-pip

      - run:
          name: Install Python dependencies
          command: |
            sudo pip3 install --upgrade pip
            sudo pip3 install pyodbc
            sudo pip3 list

      - run:
          name: Test Pyodbc connection to postgreSQL
          command: |
            python3.6 -V
            python3.6 ./test/test_pyodbc.py

      - store_artifacts:
          path: test/junit/test-results.xml
          destination: test-results

      - store_test_results:
          path: test
{'fraction_non_alphanumeric': 0.0967092973128323, 'fraction_numerical': 0.02902715907457968, 'mean_word_length': 1.5117286178274991, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 6, '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': '310497', 'n_tokens_mistral': 2321, 'n_tokens_neox': 2093, 'n_words': 504}