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

Example of Candid tools within Github Actions #76

Closed
3 tasks done
matthewhammer opened this issue Aug 11, 2020 · 8 comments
Closed
3 tasks done

Example of Candid tools within Github Actions #76

matthewhammer opened this issue Aug 11, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@matthewhammer
Copy link
Contributor

matthewhammer commented Aug 11, 2020

Finished by matthewhammer/motoko-bigtest#10


Originally:

I would like to show examples of using the Candid tools within Github Actions:

  • download and install candid tools (e.g., build from source, or get binary from Rust crates cache, or from a GH release?)
  • test script captures a comprehensive log of all relevant canister behavior, as a candid value stored in a file (pipe output of dfx canister call MyCanister getFullLog)
  • test script uses candiff to compare the latest log to an earlier one that is human readable, saved in the repo; any differences are also human readable (thanks to candiff)
@matthewhammer matthewhammer added the enhancement New feature or request label Aug 11, 2020
@matthewhammer
Copy link
Contributor Author

FYI: I also made a similar issue specific to BigTest, in that repo.

@chenyan-dfinity
Copy link
Contributor

For the second item, this works:

didc decode `dfx canister call MyCanister getFullLog --output raw`

@matthewhammer
Copy link
Contributor Author

PR for final item (and assembles all items all together):
matthewhammer/motoko-bigtest#8

@matthewhammer
Copy link
Contributor Author

@chenyan-dfinity FYI there's some kind of mismatch between the parsing logic of didc and candiff
https://github.com/matthewhammer/motoko-bigtest/runs/1021556118#step:10:159

I think it concerns whether they expect enclosing parens around an input / output value, or not. (is it a unary tuple, or a value?)

@matthewhammer
Copy link
Contributor Author

Any advice or ideas for the best resolution?

@chenyan-dfinity
Copy link
Contributor

Yes, candiff is parsing a IDLValue, while didc is parsing IDLArgs (a vector of IDLValue). So pretty printing of IDLArgs always has a parenthesis. If you are comparing output from a method call (from dfx), it make more sense to work on IDLArgs, as method calls always return a sequence of values.

@matthewhammer
Copy link
Contributor Author

Okay, I'll merge this as is, and fix the (superficial) mismatch in a subsequent PR to candiff. Thanks.

@matthewhammer
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants