Skip to content

Feat add parser#382

Merged
pepoviola merged 41 commits intomainfrom
feat-add-parser
Oct 5, 2022
Merged

Feat add parser#382
pepoviola merged 41 commits intomainfrom
feat-add-parser

Conversation

@pepoviola
Copy link
Copy Markdown
Collaborator

@pepoviola pepoviola commented Sep 13, 2022

Add a pest based grammar parser, integrated through wasm by the module zombienet-dsl-parser-wrapper. In order to ingrate the new parser I made a couple of changes of the internal interfaces:

  • cli -> now reads the dsl file and run the nunjucks replacements and parse it to the new TestDefinition interface.
  • test-runner:
    • now takes the config base path, the test name and the TestDefinition as parameters
    • Assertions and commands now lives in a separate files and the testFn is generated from an internal registry of funcion generations.
  • types.d -> Several types we added.

Also, the parser crate includes a cli that take the dsl file as input and parse it to the json representation. We can explore use it in the vscode extension to validate the dsl since produce a nice output thanks to pest :)

./target/release/zombienet-parser-cli tests/0001-dispute-valid-block.zndsl
Error parsing file:   --> 10:28
   |
10 | alice: reports node_roles  4
   |                            ^---
   |
   = expected comparison

Thanks!

@pepoviola pepoviola requested a review from wirednkod September 13, 2022 17:16
@pepoviola pepoviola mentioned this pull request Sep 21, 2022
Copy link
Copy Markdown
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice, a few small~ish nits, mostly around unwrap and a few too many integer types, other than that - hell yeah 🔥

@pepoviola pepoviola changed the title [DRAFT] Feat add parser Feat add parser Sep 29, 2022
@wirednkod
Copy link
Copy Markdown
Contributor

wirednkod commented Sep 30, 2022

Sorry for the huge amount of suggestions. They are more of "shortcuts" and minor corrections than rather anything huge that would block the PR. (Also I think you need to run lint)

pepoviola and others added 11 commits September 30, 2022 06:48
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
@pepoviola pepoviola requested review from drahnr and wirednkod and removed request for drahnr October 3, 2022 12:02
pepoviola and others added 2 commits October 5, 2022 11:19
Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
@pepoviola pepoviola merged commit 757318f into main Oct 5, 2022
@pepoviola pepoviola deleted the feat-add-parser branch October 5, 2022 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants