-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass FrontEndPolicy to unit tests #4433
Conversation
4163985
to
faa5e59
Compare
test/gtest/p4runtime.cpp
Outdated
@@ -72,12 +72,22 @@ class ParseAnnotations : public P4::ParseAnnotations { | |||
: P4::ParseAnnotations("FrontendTest", true, {PARSE("my_anno", StringLiteral)}) {} | |||
}; | |||
|
|||
struct AnnoFEP : P4::FrontEndPolicy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct AnnoFEP : P4::FrontEndPolicy { | |
struct AnnotationParsingPolicy : P4::FrontEndPolicy { |
I didn't see any breakage fwiw but this may affect the Tofino tests. |
It was also really easy with the old setting to accidentally test with side effects ordering disabled which I think is a mistake as presumably most of the backends will want it enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Pass FrontEndPolicy to unit tests * Move now misplaced TODO
Breaking change (dev/test): Side-effects ordering is enabled in frontend tests (by #4406).
I've accidentally enabled side-effects ordering in all frontend tests throughout the code base in #4406 😢. I am sorry about this.
Arguably this could be a good thing (that is the indented use of the frotnend), but it could be surprising to downstream projects. Also, as the policy itself was not exposed, it was not possible to change this behaviour in downstream tests. This PR mitigates the second problem, it exposes frontend policy in tests so that tools can set it in any way they desire. The side-effects ordering is still enabled by default, which I think is a more reasonable default (it is the default used in frontend after all).
I don't see a way of ensuring downstream action on this without needlessly breaking interface of the tests that don't depend on either side effects ordering or annotation parsing. Therefore I just intend to ping people who I guess could be working on downstream projects here.