.travis.yml
dist: trusty
sudo: required
language: python
python:
- "2.7"
# PyPy versions
addons:
sonarcloud:
organization: "4admin2root-github"
token:
secure: "$SONAR_TOKEN"
jdk:
- oraclejdk8
# command to install dependencies
install:
#- pip install .
- pip install -r requirements.txt
# command to run tests
services:
- "redis-server"
script:
- "sed -i '/REDIS_HOST/d' config.py && echo -e \"REDIS_HOST = 'localhost'\" >> config.py"
- "sed -i '/SERVER_HOST/d' config.py && echo -e \"SERVER_HOST = 'localhost'\" >> config.py"
- "python server.py &"
- "sleep 5"
- "python client.py &"
- "sleep 5"
- "cat logs/my_tcpconn.log"
- "curl -H \"Content-type: application/json\" -X POST -d '{\"tcp_conn_key\": \"tc_10.9.3.14_10.9.3.27_27017\", \"tcp_conn_value\": 100, \"tcp_conn_interval\": 60}' http://localhost:5000/tc/api/v1.0/tclist"
- "curl -X GET -s http://localhost:5000/tc/api/v1.0/bar.html"
- "curl -X GET -s -o /dev/null http://localhost:5000/"
#- "sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=4admin2root-github -X"
- "sonar-scanner -v"
- "sonar-scanner"
# total_hours_wasted_here = 3
# errors:
#ERROR: Error during SonarQube Scanner execution
#ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
# sonar-scanner \
# -Dsonar.projectKey=your_project_key_that_must_be_unique \
# -Dsonar.sources=. \
# -Dsonar.host.url=https://sonarcloud.io \
# -Dsonar.organization=your_organization_key \
# -Dsonar.login=abcdef0123456789
cache:
directories:
- '$HOME/.sonar/cache'