Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Python 3.7 for tests #3243

Merged
merged 15 commits into from
Mar 4, 2019
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist: xenial
sudo: required
services:
- docker
Expand All @@ -8,6 +9,7 @@ addons:
apt:
packages:
- tdsodbc
- unixodbc-dev
cache:
directories:
- "$HOME/.cache/pip"
Expand Down Expand Up @@ -277,7 +279,7 @@ jobs:
env: CHECK=zk PYTHON3=true
before_install:
- bash .travis/prepare.sh
- PATH="$PATH:$(pyenv root)/versions/3.6/bin"
- PATH="$(pyenv root)/versions/3.7.1/bin:$PATH:$(pyenv root)/versions/3.6.7/bin"
install:
- pip install -U pip setuptools codecov
- pip install ./datadog_checks_dev[cli]
Expand Down
4 changes: 2 additions & 2 deletions active_directory/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-active_directory
py{27,37}-active_directory
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions activemq_xml/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-activemq_xml
py{27,37}-activemq_xml
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions aerospike/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
minversion = 2.0
skip_missing_interpreters = true
basepython = py36
basepython = py37
envlist =
py{27,36}-latest
py{27,37}-latest
flake8

[testenv]
Expand Down
6 changes: 2 additions & 4 deletions agent_metrics/tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py27
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be py37?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only Agent 5 so py2

envlist =
agent_metrics
py27-agent_metrics
ofek marked this conversation as resolved.
Show resolved Hide resolved
flake8

[testenv]
usedevelop = true
platform = linux|darwin|win32

[testenv:agent_metrics]
deps =
-e../datadog_checks_base[deps]
-rrequirements-dev.txt
Expand Down
4 changes: 2 additions & 2 deletions apache/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-apache
py{27,37}-apache
flake8

[testenv]
Expand Down
13 changes: 7 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '{branch}.{build}'
image: Visual Studio 2017
clone_depth: 3
build: off
test: off
Expand All @@ -9,7 +10,7 @@ services:
# We can't start more than one MSSQL instance to avoid conflicts on TCP port 1433. The only workaround to test a check
# against multiple versions is letting the test code to start/stop the corresponding services so that they run one at
# a time. See https://www.appveyor.com/docs/services-databases/ for details.
- mssql2008r2sp2
- mssql2017

skip_branch_with_pr: true
skip_tags: true
Expand All @@ -19,15 +20,15 @@ branches:

environment:
PYTHON2: C:\Python27-x64
PYTHON3: C:\Python36-x64
PYTHON3: C:\Python37-x64

init:
# Add Python 3 to PATH
- set PATH=%PYTHON3%;%PYTHON3%\Scripts;%PATH%
# Add Python 2 to PATH
- set PATH=%PYTHON2%;%PYTHON2%\Scripts;%PATH%
- python -c "import sys; print(sys.version)"

# Add Python 2 to PATH before Python 3
- set PATH=%PYTHON2%;%PYTHON2%\Scripts;%PATH%
# Add Python 3 to PATH before Python 2
- set PATH=%PYTHON3%;%PYTHON3%\Scripts;%PATH%
- python -c "import sys; print(sys.version)"

# Decide how we'll run tests
Expand Down
4 changes: 2 additions & 2 deletions aspdotnet/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-aspdotnet
py{27,37}-aspdotnet
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions btrfs/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-btrfs
py{27,37}-btrfs
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions cacti/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-cacti
py{27,37}-cacti
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions cassandra_nodetool/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-{2.1,unit}
py{27,37}-{2.1,unit}
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions ceph/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-latest
py{27,37}-latest
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions cisco_aci/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-unit
py{27,37}-unit
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions cockroachdb/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
minversion = 2.0
skip_missing_interpreters = true
basepython = py36
basepython = py37
envlist =
py{27,36}-(latest,2.0.5}
py{27,37}-(latest,2.0.5}
flake8
bench

Expand Down
4 changes: 2 additions & 2 deletions consul/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-{0.6.4,0.7.2,1.0.0,1.0.6,unit}
py{27,37}-{0.6.4,0.7.2,1.0.0,1.0.6,unit}
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions coredns/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-{1.2.0}
py{27,37}-{1.2.0}
flake8

[testenv]
Expand Down
13 changes: 8 additions & 5 deletions couch/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import json
import time

import pytest
import requests

Expand Down Expand Up @@ -52,7 +54,7 @@ def dd_environment():
with docker_run(
compose_file=os.path.join(common.HERE, 'compose', 'compose_v{}.yaml'.format(couch_version)),
env_vars=env,
conditions=[CheckEndpoints([common.URL]), lambda: generate_data(couch_version)],
conditions=[CheckEndpoints([common.URL]), lambda: generate_data(couch_version), lambda: time.sleep(10)],
):
yield common.BASIC_CONFIG

Expand All @@ -63,9 +65,10 @@ def generate_data(couch_version):
"""
# pass in authentication info for version 2
auth = (common.USER, common.PASSWORD) if couch_version == "2" else None
headers = {'Accept': 'text/json'}

# Generate a test database
requests.put("{}/kennel".format(common.URL), auth=auth)
requests.put("{}/kennel".format(common.URL), auth=auth, headers=headers)

# Populate the database
data = {
Expand All @@ -79,7 +82,7 @@ def generate_data(couch_version):
}
}
}
requests.put("{}/kennel/_design/dummy".format(common.URL), json=data, auth=auth)
requests.put("{}/kennel/_design/dummy".format(common.URL), json=data, auth=auth, headers=headers)

urls = [
"{}/_node/node1@127.0.0.1/_stats".format(common.URL),
Expand All @@ -88,12 +91,12 @@ def generate_data(couch_version):
]

ready = defaultdict(bool)
for i in range(60):
for i in range(120):
print("Waiting for stats to be generated on the nodes...")
try:
for url in urls:
if not ready[url]:
res = requests.get(url, auth=auth)
res = requests.get(url, auth=auth, headers=headers)
if res.json():
ready[url] = True
if len(ready) and all(ready.values()):
Expand Down
9 changes: 7 additions & 2 deletions couch/tests/test_couchv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,13 @@ def stop(self):
metric_found = False
while not metric_found and tries < 40:
tries += 1
for config in [common.NODE1, common.NODE2, common.NODE3]:
check.check(config)

try:
for config in [common.NODE1, common.NODE2, common.NODE3]:
check.check(config)
except Exception:
time.sleep(1)
continue

for m_name in aggregator._metrics:
if re.search(r'view_compaction\.progress', str(m_name)) is not None:
Expand Down
4 changes: 2 additions & 2 deletions couch/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-{1.6,2.0}
py{27,37}-{1.6,2.0}
flake8

[testenv]
Expand Down
10 changes: 5 additions & 5 deletions couchbase/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def dd_environment():
compose_file=os.path.join(HERE, 'compose', 'standalone.compose'),
env_vars={'CB_CONTAINER_NAME': CB_CONTAINER_NAME},
conditions=[
WaitFor(couchbase_container, attempts=15),
WaitFor(couchbase_init, attempts=15),
WaitFor(couchbase_setup, attempts=15),
WaitFor(node_stats, attempts=15),
WaitFor(bucket_stats, attempts=15),
WaitFor(couchbase_container),
WaitFor(couchbase_init),
WaitFor(couchbase_setup),
WaitFor(node_stats),
WaitFor(bucket_stats),
]
):
yield DEFAULT_INSTANCE
Expand Down
4 changes: 2 additions & 2 deletions couchbase/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-{5.5.3,unit}
py{27,37}-{5.5.3,unit}
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions crio/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
minversion = 2.0
skip_missing_interpreters = true
basepython = py36
basepython = py37
envlist =
py{27,36}-crio
py{27,37}-crio
flake8

[testenv]
Expand Down
2 changes: 1 addition & 1 deletion datadog_checks_base/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
minversion = 2.0
skip_missing_interpreters = true
envlist =
py{27,36}
py{27,37}
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions datadog_checks_dev/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
minversion = 2.0
skip_missing_interpreters = true
basepython = py36
basepython = py37
envlist =
py{27,36}-{docker,default}
py{27,37}-{docker,default}
flake8

[testenv]
Expand Down
2 changes: 1 addition & 1 deletion datadog_checks_downloader/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
minversion = 2.0
skip_missing_interpreters = true
envlist =
py{27,36,37}
py{27,37}
flake8

[testenv]
Expand Down
4 changes: 2 additions & 2 deletions directory/tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
minversion = 2.0
skip_missing_interpreters = true
basepython = py36
basepython = py37
envlist =
py{27,36}-directory
py{27,37}-directory
flake8
bench

Expand Down
4 changes: 2 additions & 2 deletions disk/tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
minversion = 2.0
basepython = py36
basepython = py37
envlist =
py{27,36}-default
py{27,37}-default
flake8

[testenv]
Expand Down
Loading