From 47165b689fbd790167dcaa9b86544cd7a9e39416 Mon Sep 17 00:00:00 2001 From: Daniel Kostecki Date: Fri, 16 Dec 2022 15:49:17 -0500 Subject: [PATCH] Updates for tagging/commit hash identification: Removing reliance on local UUID from conftest, defaulting to no link when missing tag and hash (tag is still preferred to commit hash) Updating CONTRIBUTING and README to reflect tag instead of UUID for versioning Updating all tests to remove UUID fields from spec and implementation --- CONTRIBUTING.md | 13 ++------ README.md | 8 ++--- sriov/tests/SR_IOV_BondVF/README.md | 1 - .../tests/SR_IOV_BondVF/test_SR_IOV_BondVF.py | 1 - sriov/tests/SR_IOV_BondVF_DPDK/README.md | 1 - .../test_SR_IOV_BondVF_DPDK.py | 1 - sriov/tests/SR_IOV_InterVF/README.md | 1 - .../SR_IOV_InterVF/test_SR_IOV_InterVF.py | 1 - sriov/tests/SR_IOV_InterVF_DPDK/README.md | 1 - .../test_SR_IOV_InterVF_DPDK.py | 1 - sriov/tests/SR_IOV_MTU/README.md | 1 - sriov/tests/SR_IOV_MTU/test_SR_IOV_MTU.py | 1 - .../README.md | 1 - ..._SR_IOV_MultipleVFCreation_withMAC_DPDK.py | 1 - .../README.md | 1 - .../test_SR_IOV_MultipleVFCreation_withMTU.py | 1 - sriov/tests/SR_IOV_Permutation/README.md | 1 - .../test_SR_IOV_Permutation.py | 1 - sriov/tests/SR_IOV_Permutation_DPDK/README.md | 1 - .../test_SR_IOV_Permutation_DPDK.py | 1 - sriov/tests/SR_IOV_QinQ/README.md | 1 - sriov/tests/SR_IOV_QinQ/test_SR_IOV_QinQ.py | 1 - sriov/tests/SR_IOV_Spoof_Mac/README.md | 1 - .../SR_IOV_Spoof_Mac/test_SR_IOV_Spoof_Mac.py | 1 - sriov/tests/SR_IOV_TrustMode/README.md | 1 - .../SR_IOV_TrustMode/test_SR_IOV_TrustMode.py | 1 - sriov/tests/SR_IOV_macAddress/README.md | 1 - .../test_SR_IOV_macAddress.py | 1 - .../SR_IOV_macAddressDuplicate/README.md | 1 - .../test_SR_IOV_macAddressDuplicate.py | 1 - sriov/tests/SR_IOV_macAddress_DPDK/README.md | 1 - .../test_SR_IOV_macAddress_DPDK.py | 1 - sriov/tests/conftest.py | 33 ++++++++++--------- 33 files changed, 22 insertions(+), 62 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9d942e..106fa7f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,15 +78,8 @@ this document, but it's a useful skill and there are [many](https://thoughtbot.c ## Identifying Tests -All SR-IOV tests must be identified via a UUID representing a formal, globally unique identifier for said test. Should the test -specification or reference implementation change, a new UUID is required. This provides traceability and an unambiguous way to +All SR-IOV tests must be identified via either a tag or a commit hash, representing a globally unique identifier for said test. This provides traceability and an unambiguous way to reference specific tests. For this reason, the "common name" a test receives is not considered its formal reference, and may -remain even if a UUID changes. For specifics on use of UUIDs, see the root level `README.md`. +remain even if a test changes. Semantic versioning of tags should be observed to create relevant links to unique tests. For more information, see the root level `README.md`. -The recommended best practice is to use the CLI tool `uuidgen` to generate a UUID, as follows: -``` -$ uuidgen -3df99cbc-ec2f-406c-b344-39ff32b440f0 -``` - -As this identifier is used to identify a specific, unique test definition, the UUID may need to be changed during a pull request. A change to the UUID is required whenever the functionality of a test case changes. This is inclusive of bug fixes, which may lead to differing behavior. A UUID may remain if the difference is purely documentation, and does not change the interpretation of the text. An example of this is a simple spelling or formatting change. Anything more consequential should be considered for a UUID change, implying the test case has changed. This should be a main consideration when reviewing and approving pull requests. Changes which either alter implied functionality or change the reference implementation, but do not receive an updated UUID, will not be acceptable. +As this identifier is used to identify a specific, unique test definition, a change to the tag is required whenever the functionality of a test case changes. This is inclusive of bug fixes, which may lead to differing behavior. A tag may remain if the difference is purely documentation, and does not change the interpretation of the text. An example of this is a simple spelling or formatting change. Anything more consequential should be considered for a tag change, implying the test case version has changed. This should be a main consideration when reviewing and approving pull requests. Changes which either alter implied functionality or change the reference implementation, but do not receive an updated tag, will not be acceptable. diff --git a/README.md b/README.md index a2b0d15..94d1462 100644 --- a/README.md +++ b/README.md @@ -113,12 +113,8 @@ Each test case has its own folder. Under this folder there are two files: `test_ In order for the HTML test report to be generated properly, the test case name line should start with "Test Case Name: ", or what is defined by `tests_name_field` in the config.yaml file. The script will try to match `tests_name_field` to locate the test case name. -To satisfy the requirement of a unique identifier, the `README.md` of any SR-IOV test case must contain a distinct UUID. This will be used to formally reference a specific test specification. In order for the html test report to be generated properly, the UUID line should start with "UUID: ", or what is defined by the `tests_id_field` in the config.yaml file. Additionally, the reference implementation of a test should also be identified with a corresponding UUID, preferably as a comment on the first line. For example: -``` -# UUID: defcb0a3-1d73-45f9-9438-f19c6fba8a8c -... -``` -This will allow for clear identification of when a test specification and reference implementation may diverge. See `CONTRIBUTING.md` for more information on test case identification, and the generation of new UUIDs. +To satisfy the requirement of a unique identifier, semantic versioning should be observed when tagging releases. This will be used to formally reference a specific test specification. In order for the html test report to be generated properly, the tests should be run from the git repo, which will get either the tag or, if not tagged, the specific commit hash for a link. +This will allow for clear identification of when a test specification and reference implementation may diverge. See `CONTRIBUTING.md` for more information on test case identification. ## Common Code diff --git a/sriov/tests/SR_IOV_BondVF/README.md b/sriov/tests/SR_IOV_BondVF/README.md index 43cc18e..ceaf889 100644 --- a/sriov/tests/SR_IOV_BondVF/README.md +++ b/sriov/tests/SR_IOV_BondVF/README.md @@ -1,5 +1,4 @@ ## Test Case Name: SR-IOV.BondVF -# a1df2b99-97af-4290-b55a-2aa777ced821 ### Objective(s): Test and ensure that VFs kernel bond across PFs works as expected. diff --git a/sriov/tests/SR_IOV_BondVF/test_SR_IOV_BondVF.py b/sriov/tests/SR_IOV_BondVF/test_SR_IOV_BondVF.py index 3cd033f..80a0c54 100644 --- a/sriov/tests/SR_IOV_BondVF/test_SR_IOV_BondVF.py +++ b/sriov/tests/SR_IOV_BondVF/test_SR_IOV_BondVF.py @@ -1,4 +1,3 @@ -# UUID: a1df2b99-97af-4290-b55a-2aa777ced821 import pytest from sriov.common.utils import ( create_vfs, diff --git a/sriov/tests/SR_IOV_BondVF_DPDK/README.md b/sriov/tests/SR_IOV_BondVF_DPDK/README.md index c9e6aa4..7da0d6f 100644 --- a/sriov/tests/SR_IOV_BondVF_DPDK/README.md +++ b/sriov/tests/SR_IOV_BondVF_DPDK/README.md @@ -1,5 +1,4 @@ ## Test Case Name: SR-IOV.BondVF.DPDK -# ada901f7-fc3f-40dd-8c13-6c07f00badfe ### Objective(s): Test and ensure that VFs DPDK bond across PFs works as expected. diff --git a/sriov/tests/SR_IOV_BondVF_DPDK/test_SR_IOV_BondVF_DPDK.py b/sriov/tests/SR_IOV_BondVF_DPDK/test_SR_IOV_BondVF_DPDK.py index 51e2cef..2d87512 100644 --- a/sriov/tests/SR_IOV_BondVF_DPDK/test_SR_IOV_BondVF_DPDK.py +++ b/sriov/tests/SR_IOV_BondVF_DPDK/test_SR_IOV_BondVF_DPDK.py @@ -1,4 +1,3 @@ -# UUID: ada901f7-fc3f-40dd-8c13-6c07f00badfe import pytest from time import sleep from sriov.common.utils import ( diff --git a/sriov/tests/SR_IOV_InterVF/README.md b/sriov/tests/SR_IOV_InterVF/README.md index 3a63aa9..ccbf6e4 100644 --- a/sriov/tests/SR_IOV_InterVF/README.md +++ b/sriov/tests/SR_IOV_InterVF/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.InterVF -# 5d23e6c6-7954-48de-ab5a-d8da6b7b45c5 ### Objective(s): Test and ensure that VFs (virtual function) on the same PF can communicate diff --git a/sriov/tests/SR_IOV_InterVF/test_SR_IOV_InterVF.py b/sriov/tests/SR_IOV_InterVF/test_SR_IOV_InterVF.py index 32851f8..edb28dc 100644 --- a/sriov/tests/SR_IOV_InterVF/test_SR_IOV_InterVF.py +++ b/sriov/tests/SR_IOV_InterVF/test_SR_IOV_InterVF.py @@ -1,4 +1,3 @@ -# UUID: 5d23e6c6-7954-48de-ab5a-d8da6b7b45c5 import pytest from sriov.common.utils import create_vfs, execute_and_assert diff --git a/sriov/tests/SR_IOV_InterVF_DPDK/README.md b/sriov/tests/SR_IOV_InterVF_DPDK/README.md index 6da01f7..3a978d0 100644 --- a/sriov/tests/SR_IOV_InterVF_DPDK/README.md +++ b/sriov/tests/SR_IOV_InterVF_DPDK/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.InterVF.DPDK -# da929907-c54a-485d-8cc9-1ece9348d69f ### Objective(s): Test and ensure that VFs (virtual function) bound to DPDK driver can communicate with VF on the same PF. diff --git a/sriov/tests/SR_IOV_InterVF_DPDK/test_SR_IOV_InterVF_DPDK.py b/sriov/tests/SR_IOV_InterVF_DPDK/test_SR_IOV_InterVF_DPDK.py index 1061e1e..223cccd 100644 --- a/sriov/tests/SR_IOV_InterVF_DPDK/test_SR_IOV_InterVF_DPDK.py +++ b/sriov/tests/SR_IOV_InterVF_DPDK/test_SR_IOV_InterVF_DPDK.py @@ -1,4 +1,3 @@ -# UUID: da929907-c54a-485d-8cc9-1ece9348d69f import pytest import time from sriov.common.utils import ( diff --git a/sriov/tests/SR_IOV_MTU/README.md b/sriov/tests/SR_IOV_MTU/README.md index e54241a..7802b54 100644 --- a/sriov/tests/SR_IOV_MTU/README.md +++ b/sriov/tests/SR_IOV_MTU/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.MTU -# UUID: 98e9389d-fc1b-4ea3-b0be-cfa5529dfdbe ### Objective(s): Test and ensure that VF (virtual function) MTU functions as intended. diff --git a/sriov/tests/SR_IOV_MTU/test_SR_IOV_MTU.py b/sriov/tests/SR_IOV_MTU/test_SR_IOV_MTU.py index 3f5f795..8f10d91 100644 --- a/sriov/tests/SR_IOV_MTU/test_SR_IOV_MTU.py +++ b/sriov/tests/SR_IOV_MTU/test_SR_IOV_MTU.py @@ -1,4 +1,3 @@ -# UUID: 98e9389d-fc1b-4ea3-b0be-cfa5529dfdbe import re from sriov.common.utils import ( create_vfs, diff --git a/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/README.md b/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/README.md index e91346b..6ef4883 100644 --- a/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/README.md +++ b/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/README.md @@ -1,5 +1,4 @@ # Test Case Name: SR-IOV.MultipleVFCreation.withMAC.DPDK -# UUID: 935c6576-ca12-4592-8b5d-f5a76560be81 ### Objective(s): A robustness test to ensure that, from a clean start, VFs (virtual functions) provision MAC address functions with DPDK diff --git a/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/test_SR_IOV_MultipleVFCreation_withMAC_DPDK.py b/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/test_SR_IOV_MultipleVFCreation_withMAC_DPDK.py index c5d4816..1d36e51 100644 --- a/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/test_SR_IOV_MultipleVFCreation_withMAC_DPDK.py +++ b/sriov/tests/SR_IOV_MultipleVFCreation_withMAC_DPDK/test_SR_IOV_MultipleVFCreation_withMAC_DPDK.py @@ -1,4 +1,3 @@ -# UUID: 935c6576-ca12-4592-8b5d-f5a76560be81 from sriov.common.utils import ( execute_and_assert, create_vfs, diff --git a/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/README.md b/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/README.md index 526ff90..5398387 100644 --- a/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/README.md +++ b/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/README.md @@ -1,5 +1,4 @@ # Test Case Name: SR-IOV.MultipleVFCreation.withMTU -# UUID: 67f7961c-1967-41fa-a2f1-dc1f73ef37d1 ### Objective(s): A robustness test to ensure that, from a clean start, the maximum number of VFs (virtual functions) can be created and the maximum MTU (maximum transmission unit) configured for each VF diff --git a/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/test_SR_IOV_MultipleVFCreation_withMTU.py b/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/test_SR_IOV_MultipleVFCreation_withMTU.py index 5abcba6..da1f1fa 100644 --- a/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/test_SR_IOV_MultipleVFCreation_withMTU.py +++ b/sriov/tests/SR_IOV_MultipleVFCreation_withMTU/test_SR_IOV_MultipleVFCreation_withMTU.py @@ -1,4 +1,3 @@ -# UUID: 67f7961c-1967-41fa-a2f1-dc1f73ef37d1 from sriov.common.utils import ( execute_and_assert, create_vfs, diff --git a/sriov/tests/SR_IOV_Permutation/README.md b/sriov/tests/SR_IOV_Permutation/README.md index 47d6381..e6c208c 100644 --- a/sriov/tests/SR_IOV_Permutation/README.md +++ b/sriov/tests/SR_IOV_Permutation/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.Permutation -# UUID: dc4d0d06-1544-45f4-87c0-01015b11355a ### Objective(s): Test VFs (virtual function) configuration with different properties combined diff --git a/sriov/tests/SR_IOV_Permutation/test_SR_IOV_Permutation.py b/sriov/tests/SR_IOV_Permutation/test_SR_IOV_Permutation.py index 1351782..63464be 100644 --- a/sriov/tests/SR_IOV_Permutation/test_SR_IOV_Permutation.py +++ b/sriov/tests/SR_IOV_Permutation/test_SR_IOV_Permutation.py @@ -1,4 +1,3 @@ -# UUID: dc4d0d06-1544-45f4-87c0-01015b11355a import pytest from sriov.common.utils import ( create_vfs, diff --git a/sriov/tests/SR_IOV_Permutation_DPDK/README.md b/sriov/tests/SR_IOV_Permutation_DPDK/README.md index 625a6c9..ad92fd5 100644 --- a/sriov/tests/SR_IOV_Permutation_DPDK/README.md +++ b/sriov/tests/SR_IOV_Permutation_DPDK/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.Permutation -# UUID: 52d5e6ca-8a98-4151-9b2e-7a2946073325 ### Objective(s): Test VFs (virtual function) bound to DPDK driver with different properties combined diff --git a/sriov/tests/SR_IOV_Permutation_DPDK/test_SR_IOV_Permutation_DPDK.py b/sriov/tests/SR_IOV_Permutation_DPDK/test_SR_IOV_Permutation_DPDK.py index abfac2f..65ef7d9 100644 --- a/sriov/tests/SR_IOV_Permutation_DPDK/test_SR_IOV_Permutation_DPDK.py +++ b/sriov/tests/SR_IOV_Permutation_DPDK/test_SR_IOV_Permutation_DPDK.py @@ -1,4 +1,3 @@ -# UUID: 52d5e6ca-8a98-4151-9b2e-7a2946073325 import pytest from time import sleep from sriov.common.utils import ( diff --git a/sriov/tests/SR_IOV_QinQ/README.md b/sriov/tests/SR_IOV_QinQ/README.md index 6b436c8..9289740 100644 --- a/sriov/tests/SR_IOV_QinQ/README.md +++ b/sriov/tests/SR_IOV_QinQ/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.QinQ -# UUID: ddcb6e81-8433-4dfb-bea9-0351d20f8ac2 ### Objective(s): Test and ensure that QinQ on VF works with kernel drive. diff --git a/sriov/tests/SR_IOV_QinQ/test_SR_IOV_QinQ.py b/sriov/tests/SR_IOV_QinQ/test_SR_IOV_QinQ.py index b18f06e..f5358f0 100644 --- a/sriov/tests/SR_IOV_QinQ/test_SR_IOV_QinQ.py +++ b/sriov/tests/SR_IOV_QinQ/test_SR_IOV_QinQ.py @@ -1,4 +1,3 @@ -# UUID: ddcb6e81-8433-4dfb-bea9-0351d20f8ac2 from sriov.common.utils import create_vfs, execute_and_assert, start_tmux, stop_tmux diff --git a/sriov/tests/SR_IOV_Spoof_Mac/README.md b/sriov/tests/SR_IOV_Spoof_Mac/README.md index 26bbf3b..bc48748 100644 --- a/sriov/tests/SR_IOV_Spoof_Mac/README.md +++ b/sriov/tests/SR_IOV_Spoof_Mac/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.Spoof.Mac -# UUID: 66627809-09ff-4c41-a732-35b2f6f9528c ### Objective(s): Test and ensure that VF (virtual function) spoof check and custom mac can be set at the same time. diff --git a/sriov/tests/SR_IOV_Spoof_Mac/test_SR_IOV_Spoof_Mac.py b/sriov/tests/SR_IOV_Spoof_Mac/test_SR_IOV_Spoof_Mac.py index e44894e..23f4d2b 100644 --- a/sriov/tests/SR_IOV_Spoof_Mac/test_SR_IOV_Spoof_Mac.py +++ b/sriov/tests/SR_IOV_Spoof_Mac/test_SR_IOV_Spoof_Mac.py @@ -1,4 +1,3 @@ -# UUID: 66627809-09ff-4c41-a732-35b2f6f9528c import pytest from sriov.common.utils import create_vfs, execute_and_assert, start_tmux, stop_tmux diff --git a/sriov/tests/SR_IOV_TrustMode/README.md b/sriov/tests/SR_IOV_TrustMode/README.md index 577d23e..19fad36 100644 --- a/sriov/tests/SR_IOV_TrustMode/README.md +++ b/sriov/tests/SR_IOV_TrustMode/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.TrustMode -# UUID: 28be87c8-0b05-4eac-8ce4-6e5ebe95efc8 ### Objective(s): Test and ensure that VF (virtual function) trust mode functions as intended. diff --git a/sriov/tests/SR_IOV_TrustMode/test_SR_IOV_TrustMode.py b/sriov/tests/SR_IOV_TrustMode/test_SR_IOV_TrustMode.py index ae72371..7d41245 100644 --- a/sriov/tests/SR_IOV_TrustMode/test_SR_IOV_TrustMode.py +++ b/sriov/tests/SR_IOV_TrustMode/test_SR_IOV_TrustMode.py @@ -1,4 +1,3 @@ -# UUID: 28be87c8-0b05-4eac-8ce4-6e5ebe95efc8 from sriov.common.utils import create_vfs, execute_and_assert diff --git a/sriov/tests/SR_IOV_macAddress/README.md b/sriov/tests/SR_IOV_macAddress/README.md index b2e88ce..0b8c501 100644 --- a/sriov/tests/SR_IOV_macAddress/README.md +++ b/sriov/tests/SR_IOV_macAddress/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.macAddress -# UUID: 93ccf4b8-21e6-4148-848b-0f9eefdb20d6 ### Objective(s): Test and ensure that VF (virtual function) MAC address functions as intended. diff --git a/sriov/tests/SR_IOV_macAddress/test_SR_IOV_macAddress.py b/sriov/tests/SR_IOV_macAddress/test_SR_IOV_macAddress.py index 52f1697..82cfddd 100644 --- a/sriov/tests/SR_IOV_macAddress/test_SR_IOV_macAddress.py +++ b/sriov/tests/SR_IOV_macAddress/test_SR_IOV_macAddress.py @@ -1,4 +1,3 @@ -# UUID: 93ccf4b8-21e6-4148-848b-0f9eefdb20d6 from sriov.common.utils import ( create_vfs, execute_and_assert, diff --git a/sriov/tests/SR_IOV_macAddressDuplicate/README.md b/sriov/tests/SR_IOV_macAddressDuplicate/README.md index a5a9608..e933035 100644 --- a/sriov/tests/SR_IOV_macAddressDuplicate/README.md +++ b/sriov/tests/SR_IOV_macAddressDuplicate/README.md @@ -1,6 +1,5 @@ ## Test Case Name: SR-IOV.macAddressDuplicate -# UUID: 67e90840-5f2f-4423-a80d-828e99d43e55 ### Objective(s): Test and ensure that duplicate mac address across VFs on the same PF is permitted. diff --git a/sriov/tests/SR_IOV_macAddressDuplicate/test_SR_IOV_macAddressDuplicate.py b/sriov/tests/SR_IOV_macAddressDuplicate/test_SR_IOV_macAddressDuplicate.py index 781743f..be76c4f 100644 --- a/sriov/tests/SR_IOV_macAddressDuplicate/test_SR_IOV_macAddressDuplicate.py +++ b/sriov/tests/SR_IOV_macAddressDuplicate/test_SR_IOV_macAddressDuplicate.py @@ -1,4 +1,3 @@ -# UUID: 67e90840-5f2f-4423-a80d-828e99d43e55 from sriov.common.utils import create_vfs, execute_and_assert, verify_vf_address diff --git a/sriov/tests/SR_IOV_macAddress_DPDK/README.md b/sriov/tests/SR_IOV_macAddress_DPDK/README.md index 49d4e89..f520d3d 100644 --- a/sriov/tests/SR_IOV_macAddress_DPDK/README.md +++ b/sriov/tests/SR_IOV_macAddress_DPDK/README.md @@ -1,5 +1,4 @@ ## Test Case Name: SR-IOV.macAddress.DPDK -# UUID: d786bfca-219c-4b9f-ad9b-59fa1bc8cbba ### Objective(s): Test and ensure that VF (virtual function) MAC address functions as intended when bound to the DPDK driver. diff --git a/sriov/tests/SR_IOV_macAddress_DPDK/test_SR_IOV_macAddress_DPDK.py b/sriov/tests/SR_IOV_macAddress_DPDK/test_SR_IOV_macAddress_DPDK.py index 19a42ec..a81abab 100644 --- a/sriov/tests/SR_IOV_macAddress_DPDK/test_SR_IOV_macAddress_DPDK.py +++ b/sriov/tests/SR_IOV_macAddress_DPDK/test_SR_IOV_macAddress_DPDK.py @@ -1,4 +1,3 @@ -# UUID: d786bfca-219c-4b9f-ad9b-59fa1bc8cbba from sriov.common.utils import ( create_vfs, get_pci_address, diff --git a/sriov/tests/conftest.py b/sriov/tests/conftest.py index 503db41..2435447 100644 --- a/sriov/tests/conftest.py +++ b/sriov/tests/conftest.py @@ -170,26 +170,28 @@ def _report_extras(extra, request, settings, monkeypatch) -> None: with open(settings.config["tests_doc_file"]) as f: lines = f.readlines() - case_id = parse_file_for_field( - request.module.__file__, settings.config["tests_id_field"] - ) case_name = parse_file_for_field( settings.config["tests_doc_file"], settings.config["tests_name_field"] ) if case_name != "": - repo = git.Repo(search_parent_directories=True) - sha = repo.head.commit + sha = '' git_tag = '' - for tag in repo.tags: - if tag.commit == sha: - git_tag = tag - break - + try: + repo = git.Repo(search_parent_directories=True) + sha = repo.head.commit + # This will assume that there is one tag per commit. + for tag in repo.tags: + if tag.commit == sha: + git_tag = tag + break + except Exception: + pass + test_dir = os.path.dirname(request.module.__file__).split(os.sep)[-1] if git_tag: link = ( - settings.config["github_tests_path"].replace("main", git_tag) + settings.config["github_tests_path"].replace("main", str(git_tag)) + "/" + test_dir + "/" @@ -204,14 +206,13 @@ def _report_extras(extra, request, settings, monkeypatch) -> None: + settings.config["tests_doc_file"] ) else: - link = "Not Found" + case_name = "No tag or commit hash: No Link to" + link = "#" + extra.append( extras.html( - '

Local Test Case ID: ' - + case_id - + '

' - + '

Link to the test specification: ' + case_name