Skip to content

feat: candid subtype check, during deserialization (tests)#3153

Closed
crusso wants to merge 2 commits intoclaudio/candid-sub-deserfrom
claudio/candid-sub-deser-test
Closed

feat: candid subtype check, during deserialization (tests)#3153
crusso wants to merge 2 commits intoclaudio/candid-sub-deserfrom
claudio/candid-sub-deser-test

Conversation

@crusso
Copy link
Copy Markdown
Contributor

@crusso crusso commented Mar 14, 2022

builds on #3151
bumps candid dependency to see which tests are failing, if any.

@crusso crusso changed the base branch from master to claudio/candid-sub-deser March 14, 2022 14:58
@nomeata
Copy link
Copy Markdown
Contributor

nomeata commented Mar 14, 2022

NB: I don't think the candid test suite has been updated to dfinity/candid#311, which I believe you are implementing.

Maybe open a PR against candid so that you can fix the test suite as you go?

Let me know if you need help running the test suite locally for faster iteration.

@crusso
Copy link
Copy Markdown
Contributor Author

crusso commented Mar 15, 2022

NB: I don't think the candid test suite has been updated to dfinity/candid#311, which I believe you are implementing.

Yeah, @chenyan-dfinity warned me but suggested I try bumping anyway.

Maybe open a PR against candid so that you can fix the test suite as you go?

Yeah, makes sense. But I need to do some more plumbing first (like the failing, not trapping) and other fixes. I think I'll use a global type table for all types involved in subtype checks, and then construct a fresh cache for each outer call to deserialize, shared between inner calls to sub type checks (to speed up the check for e.g. vectors of functions)

Let me know if you need help running the test suite locally for faster iteration.

I'm doing nix-build -A tests.candid? Is there another way?

@nomeata
Copy link
Copy Markdown
Contributor

nomeata commented Mar 15, 2022

I'm doing nix-build -A tests.candid? Is there another way?

Yes! nix-build is usually only what you want on CI, or maybe for final checks. For incremental development it’s probably too slow.

Just run

candid-tests -i ../path/to/candid/tests

in the nix shell and

  • if you make changes to motoko, run make -C src moc
  • if you make changes to the tests directory, candid-tests will pick them up

You can use candid-tests -p "too long" or run just a few tests, for quick iteration

This way you don’t have to recompile more than needed as you develop, and only need to git commit at the end.

@crusso crusso mentioned this pull request Apr 6, 2022
8 tasks
@crusso crusso closed this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants