Open dipendughosh opened 1 year ago
Recently while working, found out that all the testcases in https://github.com/sonic-net/sonic-mgmt/tree/master/tests/drop_packets are not being detected by pytest. This is also seen in 202305 branch. Although the testcases are getting detected in 202205 branch.
On further debugging found that there are a few testcases defined in the script https://github.com/sonic-net/sonic-mgmt/blob/master/tests/drop_packets/drop_packets.py. Since this filename does not start with "test_" as per the pytest filename recomendation the tescases in this script are being skipped.
The reason why these are not skipped in 202205 branch is, "from .drop_packets import *" on line number 16 of the testscript https://github.com/sonic-net/sonic-mgmt/blob/202205/tests/drop_packets/test_drop_counters.py.
But in master branch and 202305 branch "from .drop_packets import *" in testscript "test_drop_counters.py" is replaced by specific module/attribute import from drop_packets.py and the testcases are being skipped.
Can someone please take a look at this?
@wangxin @theasianpianist please take a look. thanks.
Recently while working, found out that all the testcases in https://github.com/sonic-net/sonic-mgmt/tree/master/tests/drop_packets are not being detected by pytest. This is also seen in 202305 branch. Although the testcases are getting detected in 202205 branch.
On further debugging found that there are a few testcases defined in the script https://github.com/sonic-net/sonic-mgmt/blob/master/tests/drop_packets/drop_packets.py. Since this filename does not start with "test_" as per the pytest filename recomendation the tescases in this script are being skipped.
The reason why these are not skipped in 202205 branch is, "from .drop_packets import *" on line number 16 of the testscript https://github.com/sonic-net/sonic-mgmt/blob/202205/tests/drop_packets/test_drop_counters.py.
But in master branch and 202305 branch "from .drop_packets import *" in testscript "test_drop_counters.py" is replaced by specific module/attribute import from drop_packets.py and the testcases are being skipped.
Can someone please take a look at this?