unit test ordering differences in generated XML

Bug #1333349 reported by Peter Eisentraut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Fix Committed
Medium
Khai Do

Bug Description

I'm starting from scratch per documentation:

    git clone https://git.openstack.org/openstack-infra/jenkins-job-builder
    cd jenkins-job-builder
    python setup.py install
    tox -e doc

So far so good.

    tox -e py27

The tests run, but fail because of several ordering differences in the generated XML, e.g.,

            <skipVote>
              <onSuccessful>true</onSuccessful>
    + <onUnstable>true</onUnstable>
              <onFailed>true</onFailed>
    - <onUnstable>true</onUnstable>
              <onNotBuilt>true</onNotBuilt>
            </skipVote>

and

          <hudson.tasks.Ant>
            <buildFile>build.xml</buildFile>
            <antOpts>-ea -Xmx512m</antOpts>
    - <properties>failonerror=True
    - builddir=/tmp/
    + <properties>builddir=/tmp/
    + failonerror=True
      </properties>
            <targets>debug test install</targets>
            <antName>Standard Ant</antName>
          </hudson.tasks.Ant>

and

            <targets>
              <hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
                <metric>TOTAL_COVERAGE</metric>
                <healthy>80</healthy>
    + <unhealthy>0</unhealthy>
                <unstable>0</unstable>
    - <unhealthy>0</unhealthy>
              </hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
              <hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
                <metric>CODE_COVERAGE</metric>
                <healthy>80</healthy>
    + <unhealthy>0</unhealthy>
                <unstable>0</unstable>
    - <unhealthy>0</unhealthy>
              </hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
            </targets>

This happens on OS X, Python 2.7.5.

Revision history for this message
Clark Boylan (cboylan) wrote :

We should probably fix this by loading the desired XML into python and comparing that semantically with the XML generated by JJB. This will avoid issues with simple diff.

Changed in openstack-ci:
status: New → Triaged
importance: Undecided → Medium
Khai Do (zaro0508)
Changed in openstack-ci:
assignee: nobody → Khai Do (zaro0508)
Changed in openstack-ci:
status: Triaged → In Progress
Revision history for this message
Khai Do (zaro0508) wrote :
Changed in openstack-ci:
status: In Progress → Fix Committed
Revision history for this message
Peter Eisentraut (petere) wrote :

Works for me.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to jenkins-job-builder (master)

Reviewed: https://review.openstack.org/107063
Committed: https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/commit/?id=c99cbccb8ea12456c68fa0271239384a098e5df9
Submitter: Jenkins
Branch: master

commit c99cbccb8ea12456c68fa0271239384a098e5df9
Author: Darragh Bailey <email address hidden>
Date: Tue Jul 15 14:41:59 2014 +0100

    Ensure dict orders are deterministic

    Python 3 enables hash randomization by default, additionally tox 1.7
    turns on the same randomization for earlier versions of python by
    default. Need to ensure that order of iteration over the yaml data and
    resulting XML has deterministic order for testing.

    Adapts https://gist.github.com/enaeseth/844388 which ensures data read
    by yaml will have its order retained in a predictable manner across
    multiple python versions.

    Additionally it seems more sensible to ensure that the order of
    generated XML snippets corresponding to the input yaml files are
    consistently in the same order as the entries in the source files.

    Closes-Bug: #1333349
    Change-Id: I6bf6d298a2609cc6ddbbc6b02b7f1a04413a5c89

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.