Merge ~chad.smith/cloud-init:tests/cii-summary-fallback-to-traceback into cloud-init:master

Proposed by Chad Smith
Status: Merged
Approved by: Dan Watkins
Approved revision: f14a6d926eb8fc5ee39831ebc63cf034dc723ea0
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~chad.smith/cloud-init:tests/cii-summary-fallback-to-traceback
Merge into: cloud-init:master
Diff against target: 22 lines (+7/-2)
1 file modified
tests/cloud_tests/verify.py (+7/-2)
Reviewer Review Type Date Requested Status
Dan Watkins Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+356427@code.launchpad.net

Commit message

tests: integration test failure summary to use traceback if empty error

When integration tests verification fails, the object returned
contains has 'error' and 'traceback' keys. Each key can contain empty
strings. If the simplified 'error' message is empty, fallback and use
the more verbose full 'traceback' text in the failure summary.

To post a comment you must log in.
Revision history for this message
Chad Smith (chad.smith) wrote :

Will hold on committing this until cosmic freeze is over.

Basically it changes the following output

    test failures:
    * tests.cloud_tests.testcases.modules.apt_configure_sources_key.TestAptconfigureSourcesKey.test_instance_data_json_kvm

----- CHANGED TO-----

    test failures:
    * tests.cloud_tests.testcases.modules.apt_configure_sources_key.TestAptconfigureSourcesKey.test_instance_data_json_kvm
Traceback (most recent call last):
  File "/var/lib/jenkins/slaves/torkoal/workspace/cloud-init-integration-nocloud-kvm-c/cloud-init/tests/cloud_tests/testcases/base.py", line 265, in test_instance_data_json_kvm
    self.assertEqual('config-disk (/dev/vda)', v1_data['subplatform'])
AssertionError: 'config-disk (/dev/vda)' != 'config-disk (/dev/vdb)'
- config-disk (/dev/vda)
? ^
+ config-disk (/dev/vdb)
?

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:f9d86009ec65a42cb8c61aae02f79f3cd8b5363a
https://jenkins.ubuntu.com/server/job/cloud-init-ci/391/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/391/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

@Chad. the first commit is in.
So rebase on mater, and push for c-i.

can you give an example of the end result of this chagne?

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:f14a6d926eb8fc5ee39831ebc63cf034dc723ea0
https://jenkins.ubuntu.com/server/job/cloud-init-ci/507/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/507/rebuild

review: Approve (continuous-integration)
Revision history for this message
Dan Watkins (oddbloke) :
review: Approve

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/cloud_tests/verify.py b/tests/cloud_tests/verify.py
2index 9911ecf..7018f4d 100644
3--- a/tests/cloud_tests/verify.py
4+++ b/tests/cloud_tests/verify.py
5@@ -61,12 +61,17 @@ def format_test_failures(test_result):
6 if not test_result['failures']:
7 return ''
8 failure_hdr = ' test failures:'
9- failure_fmt = ' * {module}.{class}.{function}\n {error}'
10+ failure_fmt = ' * {module}.{class}.{function}\n '
11 output = []
12 for failure in test_result['failures']:
13 if not output:
14 output = [failure_hdr]
15- output.append(failure_fmt.format(**failure))
16+ msg = failure_fmt.format(**failure)
17+ if failure.get('error'):
18+ msg += failure['error']
19+ else:
20+ msg += failure.get('traceback', '')
21+ output.append(msg)
22 return '\n'.join(output)
23
24

Subscribers

People subscribed via source and target branches