<commit_before>sudo: required

language: generic

services:
  - docker

env:
  global:
    - COUCHBASE_ADMIN_USERNAME=admin
    - COUCHBASE_ADMIN_PASSWORD=password
    - "COUCHBASE_IP=\"$(/sbin/ifconfig ens4 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')\""
    - "COUCHBASE_LO=\"$(/sbin/ifconfig lo | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')\""
    - ADMIN_USERNAME=admin
    - ADMIN_PASSWORD=password
    - ADMIN_EMAIL=<EMAIL>
    - ROOT_SPACE=cc
    - ROOT_CURRENCY=cc

addons:
  apt:
    packages:
      - net-tools
      - npm

before_install:
  - /sbin/ifconfig
  - docker pull couchbase:community-2.2.0
  - docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase:community-2.2.0

install:
  - npm install

before_script:
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/nodes/self/controller/settings -H 'Content-Type: application/x-www-form-urlencoded' -d 'path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata&index_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata'"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/node/controller/rename -H 'Content-Type: application/x-www-form-urlencoded' -d hostname=127.0.0.1"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/pools/default -H 'Content-Type: application/x-www-form-urlencoded' -d memoryQuota=2048"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/settings/stats -H 'Content-Type: application/x-www-form-urlencoded' -d sendStats=false"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/settings/web -H 'Content-Type: application/x-www-form-urlencoded' -d \"password=${<PASSWORD>}&username=${COUCHBASE_ADMIN_USERNAME}&port=SAME\""
  - "curl -c /tmp/cookie -w '\n%{http_code}\n' -f -X POST http://localhost:8091/uilogin -H 'Content-Type: application/x-www-form-urlencoded' -d \"user=${COUCHBASE_ADMIN_USERNAME}&password=${<PASSWORD>}\""
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' -f -X POST http://localhost:8091/pools/default/buckets -H 'Content-Type: application/x-www-form-urlencoded' -d 'threadsNumber=3&replicaIndex=0&replicaNumber=2&ramQuotaMB=512&bucketType=membase&name=default&authType=sasl&saslPassword='"
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' -f -X POST http://localhost:8091/pools/default/buckets -H 'Content-Type: application/x-www-form-urlencoded' -d 'threadsNumber=3&replicaIndex=0&replicaNumber=2&ramQuotaMB=512&bucketType=membase&name=oauth2Server&authType=sasl&saslPassword='"
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' -f -X POST http://localhost:8091/pools/default/buckets -H 'Content-Type: application/x-www-form-urlencoded' -d 'threadsNumber=3&replicaIndex=0&replicaNumber=2&ramQuotaMB=512&bucketType=membase&name=openmoney_global&authType=sasl&saslPassword='"
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' -f -X POST http://localhost:8091/pools/default/buckets -H 'Content-Type: application/x-www-form-urlencoded' -d 'threadsNumber=3&replicaIndex=0&replicaNumber=2&ramQuotaMB=512&bucketType=membase&name=openmoney_stewards&authType=sasl&saslPassword='"
  - sleep 10s
  - docker run couchbase:community-2.2.0 /bin/sh -c "cd /opt/couchbase/bin; couchbase-cli bucket-list -c ${COUCHBASE_IP} -u ${COUCHBASE_ADMIN_USERNAME} -p ${COUCHBASE_ADMIN_PASSWORD} -d"
  - npm run install:db

script:
  - npm run start &
  - sleep 7s
  - npm run test
<commit_msg>chore: setup couchbase server 3.0.1 for travis<commit_after>sudo: required

language: generic

services:
  - docker

env:
  global:
    - COUCHBASE_ADMIN_USERNAME=admin
    - COUCHBASE_ADMIN_PASSWORD=password
    - "COUCHBASE_IP=\"$(/sbin/ifconfig ens4 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')\""
    - "COUCHBASE_LO=\"$(/sbin/ifconfig lo | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')\""
    - ADMIN_USERNAME=admin
    - ADMIN_PASSWORD=password
    - ADMIN_EMAIL=<EMAIL>
    - ROOT_SPACE=cc
    - ROOT_CURRENCY=cc

addons:
  apt:
    packages:
      - net-tools
      - npm

before_install:
  - /sbin/ifconfig
  - docker pull couchbase:community-3.0.1
  - docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase:community-3.0.1

install:
  - npm install

before_script:
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/nodes/self/controller/settings -H 'Content-Type: application/x-www-form-urlencoded' -d 'path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata&index_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata'"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/pools/default -H 'Content-Type: application/x-www-form-urlencoded' -d memoryQuota=2048"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/settings/stats -H 'Content-Type: application/x-www-form-urlencoded' -d sendStats=false"
  - "curl -f -w '\n%{http_code}\n' -X POST http://localhost:8091/settings/web -H 'Content-Type: application/x-www-form-urlencoded' -d \"password=${<PASSWORD>}&username=${COUCHBASE_ADMIN_USERNAME}&port=SAME\""
  - "curl -c /tmp/cookie -w '\n%{http_code}\n' -f -X POST http://localhost:8091/uilogin -H 'Content-Type: application/x-www-form-urlencoded' -d \"user=${COUCHBASE_ADMIN_USERNAME}&password=${COUCHBASE_<PASSWORD>_PASSWORD}\""
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' 'http://localhost:8091/pools/default/buckets' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: en-CA,en-US;q=0.7,en;q=0.3' --compressed -H 'Content-Type: application/x-www-form-urlencoded' -H 'invalid-auth-response: on' -H 'Cache-Control: no-cache' -H 'Pragma: no-cache' -H 'ns_server-ui: yes' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: http://localhost:8091' -H 'Connection: keep-alive' -H 'Referer: http://localhost:8091/index.html' --data 'parallelDBAndViewCompaction=false&autoCompactionDefined=false&threadsNumber=3&replicaIndex=0&replicaNumber=0&saslPassword=&authType=<PASSWORD>&evictionPolicy=fullEviction&ramQuotaMB=512&bucketType=membase&name=default'"
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' 'http://localhost:8091/pools/default/buckets' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: en-CA,en-US;q=0.7,en;q=0.3' --compressed -H 'Content-Type: application/x-www-form-urlencoded' -H 'invalid-auth-response: on' -H 'Cache-Control: no-cache' -H 'Pragma: no-cache' -H 'ns_server-ui: yes' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: http://localhost:8091' -H 'Connection: keep-alive' -H 'Referer: http://localhost:8091/index.html' --data 'parallelDBAndViewCompaction=false&autoCompactionDefined=false&threadsNumber=3&replicaIndex=0&replicaNumber=0&saslPassword=&authType=sasl&evictionPolicy=fullEviction&ramQuotaMB=512&bucketType=membase&name=oauth2Server'"
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' 'http://localhost:8091/pools/default/buckets' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: en-CA,en-US;q=0.7,en;q=0.3' --compressed -H 'Content-Type: application/x-www-form-urlencoded' -H 'invalid-auth-response: on' -H 'Cache-Control: no-cache' -H 'Pragma: no-cache' -H 'ns_server-ui: yes' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: http://localhost:8091' -H 'Connection: keep-alive' -H 'Referer: http://localhost:8091/index.html' --data 'parallelDBAndViewCompaction=false&autoCompactionDefined=false&threadsNumber=3&replicaIndex=0&replicaNumber=0&saslPassword=&authType=sasl&evictionPolicy=fullEviction&ramQuotaMB=512&bucketType=membase&name=openmoney_global'"
  - "curl -b /tmp/cookie -w '\n%{http_code}\n' 'http://localhost:8091/pools/default/buckets' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: en-CA,en-US;q=0.7,en;q=0.3' --compressed -H 'Content-Type: application/x-www-form-urlencoded' -H 'invalid-auth-response: on' -H 'Cache-Control: no-cache' -H 'Pragma: no-cache' -H 'ns_server-ui: yes' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: http://localhost:8091' -H 'Connection: keep-alive' -H 'Referer: http://localhost:8091/index.html' --data 'parallelDBAndViewCompaction=false&autoCompactionDefined=false&threadsNumber=3&replicaIndex=0&replicaNumber=0&saslPassword=&authType=sasl&evictionPolicy=fullEviction&ramQuotaMB=512&bucketType=membase&name=openmoney_stewards'"
  - sleep 10s
  - docker run couchbase:community-3.0.1 /bin/sh -c "cd /opt/couchbase/bin; couchbase-cli bucket-list -c ${COUCHBASE_IP} -u ${COUCHBASE_ADMIN_USERNAME} -p ${COUCHBASE_ADMIN_PASSWORD} -d"
  - npm run install:db

script:
  - npm run start &
  - sleep 7s
  - npm run test

{'fraction_non_alphanumeric': 0.1758254183627318, 'fraction_numerical': 0.04534147444595206, 'mean_word_length': 4.644543714103382, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 19, 'xml': 0}, 'pii_count': 1, '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': '2295566', 'n_tokens_mistral': 3761, 'n_tokens_neox': 3494, 'n_words': 596}