stratum / fabric-tna

The SD-Fabric data plane
https://docs.sd-fabric.org/
31 stars 15 forks source link

[SDFAB-1148] Support canonical byte string in PTF tests #511

Closed Yi-Tseng closed 2 years ago

Yi-Tseng commented 2 years ago

This PR changed the way we generate P4Runtime messages, we always canonicalized the value when we are setting values to the actual P4Runtime message in order to comply with the P4Runtime spec.

codecov[bot] commented 2 years ago

Codecov Report

Merging #511 (fb66685) into main (0152337) will not change coverage. The diff coverage is n/a.

:exclamation: Current head fb66685 differs from pull request most recent head faa4bc5. Consider uploading reports for the commit faa4bc5 to get more accurate results

@@            Coverage Diff            @@
##               main     #511   +/-   ##
=========================================
  Coverage     69.96%   69.96%           
  Complexity      740      740           
=========================================
  Files            63       63           
  Lines          4801     4801           
  Branches        530      530           
=========================================
  Hits           3359     3359           
  Misses         1164     1164           
  Partials        278      278           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0152337...faa4bc5. Read the comment docs.

Yi-Tseng commented 2 years ago

Can we also remove the bitwidth parameter from stringify? That should be useless now, right?

There is a case we still need is that we need to make sure the ternary match value size is the same as the mask size. But I believe that we can just add zeros before we check it

https://github.com/stratum/fabric-tna/blob/main/ptf/tests/common/base_test.py#L618