Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154317532
D10873.id29064.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D10873.id29064.diff
View Options
Index: devel/py-codecov/Makefile
===================================================================
--- devel/py-codecov/Makefile
+++ devel/py-codecov/Makefile
@@ -3,8 +3,8 @@
PORTNAME= codecov
PORTVERSION= 2.0.9
+DISTVERSIONPREFIX= v
CATEGORIES= devel python
-MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= cpm@FreeBSD.org
@@ -14,10 +14,19 @@
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}coverage>0:devel/py-coverage \
${PYTHON_PKGNAMEPREFIX}requests>=2.7.9:www/py-requests
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ddt>0:devel/py-ddt \
+ ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock \
+ ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest
USES= python
-USE_PYTHON= autoplist distutils
+USE_PYTHON= autoplist concurrent distutils
+USE_GITHUB= yes
+GH_PROJECT= ${PORTNAME}-python
+
NO_ARCH= yes
+do-test:
+ @cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v tests/test.py
+
.include <bsd.port.mk>
Index: devel/py-codecov/distinfo
===================================================================
--- devel/py-codecov/distinfo
+++ devel/py-codecov/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1493465689
-SHA256 (codecov-2.0.9.tar.gz) = db1c182ca896244d8644d8410a33f6f6dd1cc24d80209907a65077445923f00c
-SIZE (codecov-2.0.9.tar.gz) = 9563
+TIMESTAMP = 1495486257
+SHA256 (codecov-codecov-python-v2.0.9_GH0.tar.gz) = 3ea0fb29746bfe8856c43ce9be893896ad0b8097f139954c6fd17814d14fd282
+SIZE (codecov-codecov-python-v2.0.9_GH0.tar.gz) = 18122
Index: devel/py-codecov/files/patch-tests_test.py
===================================================================
--- devel/py-codecov/files/patch-tests_test.py
+++ devel/py-codecov/files/patch-tests_test.py
@@ -0,0 +1,137 @@
+# The following test cases fails because the .git directory is not included.
+# Remove them for now until the reported issue #100 is fixed.
+# https://github.com/codecov/codecov-python/issues/100
+
+--- tests/test.py.orig 2017-04-28 14:06:12 UTC
++++ tests/test.py
+@@ -2,9 +2,9 @@ import os
+ import sys
+ import pickle
+ import itertools
++import unittest
+ from ddt import ddt, data
+ from mock import patch, Mock
+-import unittest2 as unittest
+
+ import subprocess
+
+@@ -134,21 +134,6 @@ class TestUploader(unittest.TestCase):
+ self.assertEqual(codecov.main(), None)
+ assert post.called and put.called
+
+- def test_send(self):
+- with patch('requests.post') as post:
+- with patch('requests.put') as put:
+- post.return_value = Mock(status_code=200, text='target\ns3')
+- put.return_value = Mock(status_code=200)
+- with open(self.filepath, 'w+') as f:
+- f.write('coverage data')
+- res = self.run_cli(False, commit='a'*40, branch='master', token='<token>')
+- self.assertEqual(res['result'].strip(), 'target')
+- assert 'https://codecov.io/upload/v4?' in post.call_args[0][0]
+- assert 'commit=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in post.call_args[0][0]
+- assert 'token=%3Ctoken%3E' in post.call_args[0][0]
+- assert 'branch=master' in post.call_args[0][0]
+- assert 'tests/test.py' in put.call_args[1]['data']
+-
+ def test_send_error(self):
+ with patch('requests.post') as post:
+ post.return_value = Mock(status_code=400, text='error')
+@@ -181,18 +166,6 @@ class TestUploader(unittest.TestCase):
+ res = self.run_cli(token='@'+self.token, commit='a', branch='b')
+ self.assertIn('token=a', res['urlargs'])
+
+- def test_bowerrc(self):
+- with open(self.bowerrc, 'w+') as f:
+- f.write('{"directory": "tests"}')
+- with open(self.filepath, 'w+') as f:
+- f.write('coverage data')
+- try:
+- self.run_cli(**self.defaults)
+- except AssertionError as e:
+- self.assertEqual(str(e), "No coverage report found")
+- else:
+- raise Exception("Did not raise AssertionError")
+-
+ def test_disable_search(self):
+ self.fake_report()
+ try:
+@@ -246,33 +219,6 @@ class TestUploader(unittest.TestCase):
+ else:
+ raise Exception("Did not raise AssertionError")
+
+- def test_bowerrc_none(self):
+- with open(self.bowerrc, 'w+') as f:
+- f.write('{"other_key": "tests"}')
+- with open(self.filepath, 'w+') as f:
+- f.write('coverage data')
+- res = self.run_cli(**self.defaults)
+- self.assertIn('tests/test.py', res['reports'])
+-
+- def test_discovers(self):
+- with open(self.jacoco, 'w+') as f:
+- f.write('<jacoco></jacoco>')
+- with open(self.filepath, 'w+') as f:
+- f.write('coverage data')
+- res = self.run_cli(**self.defaults)
+- self.assertIn('coverage.xml', res['reports'])
+- self.assertIn('coverage data', res['reports'])
+- self.assertIn('jacoco.xml', res['reports'])
+- self.assertIn('<jacoco></jacoco>', res['reports'])
+-
+- def test_not_jacoco(self):
+- with open(self.filepath, 'w+') as f:
+- f.write('<data>')
+- res = self.run_cli(file='tests/coverage.xml', **self.defaults)
+- res = res['reports'].split('<<<<<< network\n')[1].splitlines()
+- self.assertEqual(res[0], '# path=tests/coverage.xml')
+- self.assertEqual(res[1], '<data>')
+-
+ def test_run_coverage(self):
+ self.skipTest('Not sure how to pull off atm')
+ with open(self.coverage, 'w+') as f:
+@@ -339,23 +285,6 @@ class TestUploader(unittest.TestCase):
+ self.assertEqual(res['query']['branch'], 'master')
+ self.assertEqual(res['codecov'].token, 'token')
+
+- def test_ci_jenkins_blue_ocean(self):
+- self.set_env(JENKINS_URL='https://....',
+- BUILD_URL='https://....',
+- BRANCH_NAME='master',
+- CHANGE_ID='1',
+- BUILD_NUMBER='41',
+- CODECOV_TOKEN='token')
+- self.fake_report()
+- res = self.run_cli()
+- self.assertEqual(res['query']['service'], 'jenkins')
+- self.assertEqual(res['query']['commit'], codecov.check_output(("git", "rev-parse", "HEAD")))
+- self.assertEqual(res['query']['build'], '41')
+- self.assertEqual(res['query']['build_url'], 'https://....')
+- self.assertEqual(res['query']['pr'], '1')
+- self.assertEqual(res['query']['branch'], 'master')
+- self.assertEqual(res['codecov'].token, 'token')
+-
+ def test_ci_travis(self):
+ self.set_env(TRAVIS="true",
+ TRAVIS_BRANCH="master",
+@@ -459,20 +388,6 @@ class TestUploader(unittest.TestCase):
+ self.assertEqual(res['query']['build'], '10')
+ self.assertEqual(res['query']['pr'], '10')
+ self.assertEqual(res['query']['job'], 'default')
+- self.assertEqual(res['codecov'].token, 'token')
+-
+- def test_ci_drone(self):
+- self.set_env(DRONE='true',
+- DRONE_BUILD_NUMBER='10',
+- DRONE_BRANCH='master',
+- DRONE_BUILD_URL='https://drone.io/github/builds/1',
+- CODECOV_TOKEN='token')
+- self.fake_report()
+- res = self.run_cli()
+- self.assertEqual(res['query']['service'], 'drone.io')
+- self.assertEqual(res['query']['commit'], codecov.check_output(("git", "rev-parse", "HEAD")))
+- self.assertEqual(res['query']['build'], '10')
+- self.assertEqual(res['query']['build_url'], 'https://drone.io/github/builds/1')
+ self.assertEqual(res['codecov'].token, 'token')
+
+ def test_ci_shippable(self):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 28, 7:29 PM (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32301466
Default Alt Text
D10873.id29064.diff (7 KB)
Attached To
Mode
D10873: devel/py-codecov: Add test support
Attached
Detach File
Event Timeline
Log In to Comment