Skip to content

Commit 0202c27

Browse files
committed
ft
1 parent 3ea56a9 commit 0202c27

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

codecov/__init__.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ def main(*argv, **kwargs):
289289

290290
# Merge Commits
291291
# -------------
292-
res = try_to_run('git log -1 --pretty=%B').strip()
293-
if is_merge_commit(res):
292+
res = try_to_run('git log -1 --pretty=%B')
293+
if res and is_merge_commit.match(res.strip()):
294294
query['commit'] = res.split(' ')[1]
295295

296296
# --------
@@ -638,11 +638,14 @@ def main(*argv, **kwargs):
638638
'''$(find "%(root)s" -type f -name '*.php' -exec grep -nIH '^[[:space:]]*}$' {} \;)\n'''
639639
'''$(find "%(root)s" -type f -name '*.php' -exec grep -nIH '^[[:space:]]*{' {} \;)"\n'''
640640
'''"''' % dict(root=root))
641-
write(" --> Found %s adjustments" % (adjustments.count('\n') - adjustments.count('\n\n') - 1))
642-
try:
643-
reports = str(reports) + '\n# path=fixes\n' + str(adjustments.encode('utf-8')) + '<<<<<< EOF'
644-
except:
645-
reports = str(reports) + '\n# path=fixes\n' + str(remove_non_ascii(adjustments)) + '<<<<<< EOF'
641+
if adjustments:
642+
write(" --> Found %s adjustments" % (adjustments.count('\n') - adjustments.count('\n\n') - 1))
643+
try:
644+
reports = str(reports) + '\n# path=fixes\n' + str(adjustments.encode('utf-8')) + '<<<<<< EOF'
645+
except:
646+
reports = str(reports) + '\n# path=fixes\n' + str(remove_non_ascii(adjustments)) + '<<<<<< EOF'
647+
else:
648+
write(" --> Found no adjustments")
646649

647650
result = ''
648651
if codecov.dump:

tests/test.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_send(self):
143143
f.write('coverage data')
144144
res = self.run_cli(False, commit='a'*40, branch='master', token='<token>')
145145
self.assertEqual(res['result'].strip(), 'target')
146-
assert 'https://codecov.io/upload/v3?' in post.call_args[0][0]
146+
assert 'https://codecov.io/upload/v4?' in post.call_args[0][0]
147147
assert 'commit=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in post.call_args[0][0]
148148
assert 'token=%3Ctoken%3E' in post.call_args[0][0]
149149
assert 'branch=master' in post.call_args[0][0]
@@ -265,14 +265,6 @@ def test_discovers(self):
265265
self.assertIn('jacoco.xml', res['reports'])
266266
self.assertIn('<jacoco></jacoco>', res['reports'])
267267

268-
def test_jacoco(self):
269-
with open(self.jacoco, 'w+') as f:
270-
f.write('<jacoco></jacoco>')
271-
res = self.run_cli(file='jacoco.xml', **self.defaults)
272-
report = res['reports'].split('<<<<<< network\n')[1].splitlines()
273-
self.assertEqual(report[0], '# path=jacoco.xml')
274-
self.assertEqual(report[1], '<jacoco></jacoco>')
275-
276268
def test_not_jacoco(self):
277269
with open(self.filepath, 'w+') as f:
278270
f.write('<data>')

0 commit comments

Comments
 (0)