[Piglit] [PATCH 01/16] summary.py: replace multiple attributes with a single dict attribute

Jose Fonseca jfonseca at vmware.com
Thu Jun 27 10:50:40 PDT 2013


----- Original Message -----
> Yes, some of the problems were that I was encoding in unicode rather than
> ascii, I was unaware that xml required ascii. changing to ascii did solve
> most of the problems; however, there were still characters not being
> properly escaped, and it seemed more trouble than it was worth to fix it.

XML doesn't require ascii, but there is a bunch of valid unicode/ASCII characters that are not valid XML (most control codes below 32). I had to hack translation tables in junit.py as I couln't find any standard python library that would do what I wanted.

> Since this code exists for your use and you're not interested in a mako
> version I'll do as you suggest and move the old summary code into
> piglit-summary-junit, and remove it from summary. I'll send out and updated
> patch series later today.

Thanks. I appreciate your attention to this.

Jose

> On Thu, Jun 27, 2013 at 6:35 AM, Jose Fonseca <jfonseca at vmware.com> wrote:
> 
> > Dylan,
> >
> > I tried it with live results but unfortunately it fails:
> >
> > $ ./piglit-summary-junit.py test-llvmpipe-piglit/results/custom.results/
> > Traceback (most recent call last):
> >   File "./piglit-summary-junit.py", line 54, in <module>
> >     main()
> >   File "./piglit-summary-junit.py", line 50, in main
> >     output.generateJUnit(args.output)
> >   File "/home/jfonseca/work/vmware/tests/piglit/framework/summary.py",
> > line 645, in generateJUnit
> >     numberoftests=len(self.tests['all'])))
> >   File "/usr/lib/python2.7/dist-packages/mako/template.py", line 412, in
> > render
> >     return runtime._render(self, self.callable_, args, data)
> >   File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 766, in
> > _render
> >     **_kwargs_for_callable(callable_, data))
> >   File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 798, in
> > _render_context
> >     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
> >   File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 824, in
> > _exec_template
> >     callable_(context, *args, **kwargs)
> >   File "/home/jfonseca/work/vmware/tests/piglit/.makotmp/templates/
> > junit.mako.py", line 41, in render_body
> >     __M_writer(unicode(each['system-err']))
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 101:
> > ordinal not in range(128)
> >
> > This can be avoided doing
> >
> > diff --git a/templates/junit.mako b/templates/junit.mako
> > index f123878..1a480dd 100644
> > --- a/templates/junit.mako
> > +++ b/templates/junit.mako
> > @@ -3,8 +3,8 @@
> >    <testsuite name="piglit" tests="${numberoftests}">
> >    % for each in tests:
> >      <testcase classname="${each['classname']}" name="${each['testname']}"
> > time="${each['time']}">
> > -      <system-out>${each['system-out']}</system-out>
> > -      <system-err>${each['system-err']}</system-err>
> > +      <system-out>${each['system-out'].decode('ascii',
> > 'ignore')}</system-out>
> > +      <system-err>${each['system-err'].decode('ascii',
> > 'ignore')}</system-err>
> >      </testcase>
> >    % endfor
> >    </testsuite>
> >
> > But still, the output is still very broken -- there are no failures,
> > skips, etc. recorded on the XML.
> >
> >
> > I spent a considerable amount of time in fine tuning the existing junit.py
> > script to work correctly and robustly, and given that nobody else is
> > actually interested in jenkins integration, I rather not to spend time
> > reimplementing this in a different clothing.
> >
> > So I'd prefer to keep the non-mako piglit-summary-junit.py implemention.
> >  Feel free to move any old code from framework inside
> > piglit-summary-junit.py though.
> >
> >
> > If you want to verify, I've uploaded the results I used to test to
> > http://people.freedesktop.org/~jrfonseca/test-llvmpipe-piglit-results.tar.bz2
> >
> >
> > Jose
> >
> >
> > ----- Original Message -----
> > > Yes, it's at my github here: git://github.com/crymson/piglit.git
> > >  mako-complete
> > >
> > > junit isn't too interesting to me or intel (whom I contract with),
> > however
> > > I converted piglit's html summary to mako a while back, and wrote a new
> > > summary class for that. I'd like to get all of the summary output using
> > > this backend, so junit and the text output of piglit-summary.py are
> > targets
> > > for that.
> > >
> > >
> > > On Wed, Jun 26, 2013 at 2:54 PM, Jose Fonseca <jfonseca at vmware.com>
> > wrote:
> > >
> > > > ----- Original Message -----
> > > > > I'm bumping this series hoping to get some review, since I feel it's
> > too
> > > > > big to 'just push'
> > > > >
> > > > > Brian and Jose, I'd specifically appreciate if you would look at the
> > > > later
> > > > > set of patches, since they change/replace code that you originally
> > wrote.
> > > >
> > > > Thanks for the heads up Dylan.  Sorry for not noticing earlier.  Nobody
> > > > else showed interest in junit/jenkins so I wasn't expecting it.
> > > >
> > > > I'm using the junit.py here in many other places (to conform results
> > from
> > > > conform, apitrace, mesa demos, MS conformance test, etc) to
> > jenkins/hudson.
> > > > So having piglit using something else doesn't really save me much work.
> > > >
> > > > But I don't object replacing my script with mako -- piglit has its test
> > > > framework anyway -- provided there are no regressions.
> > > >
> > > > I'd like to test first though.  Can I pull this from somewhere, or
> > could
> > > > you do push this in two phases: 1) first add the new mechanism without
> > > > touching the old one, then 2) remove it after I have time to run more
> > tests
> > > > here.
> > > >
> > > > Jose
> > > >
> > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > > On Thu, Jun 13, 2013 at 8:36 AM, Dylan Baker <
> > baker.dylan.c at gmail.com
> > > > >wrote:
> > > > >
> > > > > > Replaces self.alltests, self.changes, self.problems,
> > self.regressions,
> > > > > > self.fixes, and self.skipped with self.test, a dictionary
> > containing
> > > > all
> > > > > > of the same information. This cleans the namespace for the
> > NewSummary
> > > > > > object, as well as allowing for some other code simplification
> > > > > >
> > > > > > Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
> >
> 


More information about the Piglit mailing list