Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
removed bitten parser
Browse files Browse the repository at this point in the history
Summary: Bitten is another kind of test output file, in addition to junit XML files. We have a parser for it, but we were unsure whether the parser is ever used. Based on stats (see https://vortex.pp.dropbox.com/search?metric_pattern=changes_new_bitten&since=a), the parser is never used, while the XML parser stats (https://vortex.pp.dropbox.com/graph?tags=dc%3D*&metric=statsclerk%7Cchanges_new_xunit_result_file%7C%7CSUM&start_time=-8035200&res=14400) has been active since end of June (both stats were put in at the same time). Based on this and the fact that the bitten parser code is untested, we should remove it.

Test Plan: unit tests

Reviewers: andrewhe, paulruan

Reviewed By: paulruan

Subscribers: changesbot, kylec

Differential Revision: https://tails.corp.dropbox.com/D223731
  • Loading branch information
Naphat Sanguansin committed Aug 26, 2016
1 parent 2563f0e commit b2c547f
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions changes/artifacts/xunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def xml_decl(self, version, encoding, standalone):

def _start(self, tag, attrs):
if tag == 'unittest-results':
self._set_subparser(BittenParser(self.step, self._parser))
statsreporter.stats().incr('new_bitten_result_file')
raise ArtifactParseError('Bitten is not supported.')
else:
self._set_subparser(XunitParser(self.step, self._parser))
statsreporter.stats().incr('new_xunit_result_file')
Expand Down Expand Up @@ -136,53 +135,6 @@ def close_message(self):
self._message_start = None


class BittenParser(XunitBaseParser):

def start(self, tag, attrs):
# Spec: http://bitten.edgewall.org/wiki/Documentation/reports.html
if tag == 'unittest-results':
pass
elif tag == 'test':
if attrs['status'] == 'success':
result = Result.passed
elif attrs['status'] == 'skipped':
result = Result.skipped
elif attrs['status'] in ('error', 'failure'):
result = Result.failed
else:
result = None

# no matching status tags were found
if result is None:
result = Result.passed

self._current_result = TestResult(
step=self.step,
name=attrs['name'],
package=attrs.get('fixture') or None,
duration=float(attrs['duration']) * 1000,
message='',
result=result,
)
elif tag == 'traceback':
self.start_message(tag, attrs)

def data(self, data):
if self._is_message:
self.process_message(data)

def end(self, tag):
if self._is_message:
self.close_message()
if tag == 'unittest-results':
pass
elif tag == 'test':
self.results.append(self._current_result)
self._current_result = None
elif tag == 'traceback':
pass


class XunitParser(XunitBaseParser):

def __init__(self, step, parser):
Expand Down

0 comments on commit b2c547f

Please sign in to comment.