Skip to content

[pytest] Adds test metadata to pytest xml report#1734

Merged
daall merged 1 commit intosonic-net:masterfrom
daall:test_report_metadata
Jun 8, 2020
Merged

[pytest] Adds test metadata to pytest xml report#1734
daall merged 1 commit intosonic-net:masterfrom
daall:test_report_metadata

Conversation

@daall
Copy link
Contributor

@daall daall commented Jun 3, 2020

  • Adds DUT data to test report
  • Adds testbed info to test report

Signed-off-by: Danny Allen daall@microsoft.com

NOTE: Depends on #1732

Description of PR

Summary: Adds data about the test device and testbed setup to the XML test report.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

The default JUnit test report only includes the results of the individual test cases, so unless you can associate the test report with a specific test run using an external system like Jenkins there's a lot of missing context in the test report.

We also hope to use this data to make it possible to filter/query from a set of test results based on attributes like the SKU being tested, OS version, etc.

How did you do it?

I took advantage of the built-in record_testsuite_property API in pytest to annotate the test report with this extra data.

How did you verify/test it?

I ran a few test cases with the --junit-xml flag turned on and checked that the XML had the extra attributes included.

Documentation

- Adds DUT data to test report
- Adds testbed info to test report

Signed-off-by: Danny Allen <daall@microsoft.com>
@daall daall marked this pull request as ready for review June 8, 2020 15:40
@daall
Copy link
Contributor Author

daall commented Jun 8, 2020

retest this please

@svc-acs
Copy link
Collaborator

svc-acs commented Jun 8, 2020

Build triggered for merge commit.

@svc-acs
Copy link
Collaborator

svc-acs commented Jun 8, 2020

Build started for merge commit.

@daall daall merged commit 88fe739 into sonic-net:master Jun 8, 2020
@daall daall deleted the test_report_metadata branch June 8, 2020 18:57
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
8b149a3 Load the  database global_db only once for show cli  (sonic-net#1712)
cd0e560 [config][interface][speed] Fixed the config interface speed in multiasic issue (sonic-net#1739)
b595ba6 [fast-reboot] revert the change of disabling counter polling before fast-reboot (sonic-net#1744)
8518820 [minigraph] Donot enable PFC watchdog for MgmtTsToR (sonic-net#1734)
2213774 [CLI][show][bgp] Fix the show ip bgp network command (sonic-net#1733)
3526507 [configlet] Python3 compatible syntax for extracting a key from the dict (sonic-net#1721)
5b56b97 [sonic_installer] don't print errors when installing an image not supporting app ext (sonic-net#1719)
a581955 [LLDP] Fix lldpshow script to enable display multiple MAC addresses on the same remote physical interface (sonic-net#1657)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants