8000 Add CI, make tests pass on non-linux · pythonAI/client_python@d70c6d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit d70c6d8

Browse files
committed
Add CI, make tests pass on non-linux
1 parent 42671e2 commit d70c6d8

File tree

6 files changed

+96
-0
lines changed

6 files changed

+96
-0
lines changed

.coveragerc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[run]
2+
branch = True
3+
source = prometheus_client
4+
5+
[paths]
6+
source =
7+
prometheus_client
8+
.tox/*/lib/python*/site-packages/prometheus_client
9+
.tox/pypy/site-packages/prometheus_client
10+
11+
[report]
12+
show_missing = True

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ dist
33
*.egg-info
44
*.pyc
55
*.swp
6+
.coverage.*
7+
.coverage
8+
.tox

.travis.yml

+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
sudo: false
2+
cache:
3+
directories:
4+
- $HOME/.cache/pip
5+
6+
language: python
7+
8+
matrix:
9+
include:
10+
- python: "2.7"
11+
env: TOXENV=py27
12+
- python: "2.7"
13+
env: TOXENV=py27-nooptionals
14+
- python: "3.4"
15+
env: TOXENV=py34
16+
- python: "3.5"
17+
env: TOXENV=py35
18+
- python: "3.5"
19+
env: TOXENV=py35-nooptionals
20+
- python: "pypy"
21+
env: TOXENV=pypy
22+
23+
install:
24+
- pip install tox
25+
26+
script:
27+
- tox
28+
29+
notifications:
30+
email: false

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
"Intended Audience :: Developers",
2222
"Intended Audience :: Information Technology",
2323
"Intended Audience :: System Administrators",
24+
"Programming Language :: Python",
25+
"Programming Language :: Python :: 2",
26+
"Programming Language :: Python :: 2.7",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.4",
29+
"Programming Language :: Python :: 3.5",
30+
"Programming Language :: Python :: Implementation :: CPython",
31+
"Programming Language :: Python :: Implementation :: PyPy",
2432
"Topic :: System :: Monitoring",
2533
"License :: OSI Approved :: Apache Software License",
2634
],

tests/test_exposition.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import unicode_literals
22
import os
3+
import sys
34
import threading
45
import time
56
import unittest
@@ -160,6 +161,10 @@ def test_delete_with_groupingkey(self):
160161
self.assertEqual(self.requests[0][0].headers.get('content-type'), CONTENT_TYPE_LATEST)
161162
self.assertEqual(self.requests[0][1], b'')
162163

164+
@unittest.skipIf(
165+
sys.platform == "darwin",
166+
"instance_ip_grouping_key() does not work on macOS."
167+
)
163168
def test_instance_ip_grouping_key(self):
164169
self.assertTrue('' != instance_ip_grouping_key()['instance'])
165170

tox.ini

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[tox]
2+
envlist = coverage-clean,py27,py34,py35,pypy,{py27,py35}-nooptionals,coverage-report
3+
4+
5+
[base]
6+
deps =
7+
coverage
8+
pytest
9+
10+
[testenv]
11+
deps =
12+
{[base]deps}
13+
twisted
14+
commands = coverage run --parallel -m pytest {posargs}
15+
16+
17+
; Ensure test suite passes if no optional dependencies are present.
18+
[testenv:py27-nooptionals]
19+
deps = {[base]deps}
20+
commands = coverage run --parallel -m pytest {posargs}
21+
22+
[testenv:py35-nooptionals]
23+
deps = {[base]deps}
24+
commands = coverage run --parallel -m pytest {posargs}
25+
26+
27+
[testenv:coverage-clean]
28+
deps = coverage
29+
skip_install = true
30+
commands = coverage erase
31+
32+
33+
[testenv:coverage-report]
34+
deps = coverage
35+
skip_install = true
36+
commands =
37+
coverage combine
38+
coverage report

0 commit comments

Comments
 (0)
0