Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
branch = True
source = prometheus_client

[paths]
source =
prometheus_client
.tox/*/lib/python*/site-packages/prometheus_client
.tox/pypy/site-packages/prometheus_client

[report]
show_missing = True
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dist
*.egg-info
*.pyc
*.swp
.coverage.*
.coverage
.tox
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
sudo: false
cache:
directories:
- $HOME/.cache/pip

language: python

matrix:
include:
- python: "2.7"
env: TOXENV=py27
- python: "2.7"
env: TOXENV=py27-nooptionals
- python: "3.4"
env: TOXENV=py34
- python: "3.5"
env: TOXENV=py35
- python: "3.5"
env: TOXENV=py35-nooptionals
- python: "pypy"
env: TOXENV=pypy

install:
- pip install tox

script:
- tox

notifications:
email: false
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: System :: Monitoring",
"License :: OSI Approved :: Apache Software License",
],
Expand Down
5 changes: 5 additions & 0 deletions tests/test_exposition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import os
import sys
import threading
import time
import unittest
Expand Down Expand Up @@ -160,6 +161,10 @@ def test_delete_with_groupingkey(self):
self.assertEqual(self.requests[0][0].headers.get('content-type'), CONTENT_TYPE_LATEST)
self.assertEqual(self.requests[0][1], b'')

@unittest.skipIf(
sys.platform == "darwin",
"instance_ip_grouping_key() does not work on macOS."
)
def test_instance_ip_grouping_key(self):
self.assertTrue('' != instance_ip_grouping_key()['instance'])

Expand Down
38 changes: 38 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[tox]
envlist = coverage-clean,py27,py34,py35,pypy,{py27,py35}-nooptionals,coverage-report


[base]
deps =
coverage
pytest

[testenv]
deps =
{[base]deps}
twisted
commands = coverage run --parallel -m pytest {posargs}


; Ensure test suite passes if no optional dependencies are present.
[testenv:py27-nooptionals]
deps = {[base]deps}
commands = coverage run --parallel -m pytest {posargs}

[testenv:py35-nooptionals]
deps = {[base]deps}
commands = coverage run --parallel -m pytest {posargs}


[testenv:coverage-clean]
deps = coverage
skip_install = true
commands = coverage erase


[testenv:coverage-report]
deps = coverage
skip_install = true
commands =
coverage combine
coverage report