Skip to content
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

Cargo Tester: Pre-made File Loader Refactoring #4

Open
AndrewF001 opened this issue Apr 11, 2023 · 0 comments
Open

Cargo Tester: Pre-made File Loader Refactoring #4

AndrewF001 opened this issue Apr 11, 2023 · 0 comments
Labels
C-proposal An open suggestion for a feature or improvement to include in ongoing effort help wanted Extra attention is needed

Comments

@AndrewF001
Copy link
Contributor

Proposal

The Tester cargo is intended to make testing easier & standardized. The feature in question is the loading of pre-made P4 files. Current implementation is a built in-house with fs::read_to_string and loads files dynamically from a resource folder based on a file name or array index. The proposed change is to swap to resource_str macro.

Pros

  • Not built in-house, so can rely on it
  • Can load files statically

Cons

  • Files could be large for them to be stored statically
  • CRLF/LF formatting behavior (discussed below)

Other

There is a lack of standard for line endings in LSP 1.7 and Wasm which has created a platform-specific discrepancies between files for whether to use CRLF or LF. Because of this, I believe the testing process should support both to iron out parser bugs!

In the future I would also like to add an extra confirmation stage to the CI/CD that given the same files P4 analyzer can spot compiler errors the same as P4 compiler. This issues shouldn't affect the prospect of this but something to be mindful of.

@AndrewF001 AndrewF001 added enhancement help wanted Extra attention is needed labels Apr 11, 2023
@timjroberts timjroberts added C-proposal An open suggestion for a feature or improvement to include in ongoing effort and removed enhancement labels Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-proposal An open suggestion for a feature or improvement to include in ongoing effort help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants