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

Revamped bump up jsoo and alcotest and dune #13777

Closed
wants to merge 20 commits into from

Conversation

dannywillems
Copy link
Member

@dannywillems dannywillems commented Jul 28, 2023

TL;DR: in draft because of this comment in snarkyjs. On hold atm.

Bumping up js_of_ocaml to 5.4.0, dune to 3.9.2 and alcotest to 1.7.0. Cherry-pick a commit from #13790 for consistency.

Since alcotest.1.5.0, alcotest-js is available.
A better integration of node has been made in dune >= 3.8.0 (I don't remember exactly the version).
And upgrading js_of_ocaml to revive #12978

It will be useful for crypto team to write tests running in JS and in native, see #13537.
If a library has alcotest tests, we can activate "for free" the jsoo tests by adding (modes native js) in the tests definition. For instance, it is activated for base58_check in this commit. It will run automatically a new executable. It is executed in a node environment (dune uses the `node' executable available in the path). If needed, for instance to load wasm first, the node binary can be overwritten with:

(env
 (_
  ; wrapping node
  (binaries
   (%{workspace_root}/test/node_wrapper.exe as node))))

where node_wrapper is an OCaml program.

Related snarkyjs and snarkyjs-bindings PR: o1-labs/o1js#1056 and o1-labs/o1js-bindings#102.

Current state:

  • waiting for new CI on develop - git merge when it is done.
  • Update new docker images.
  • digestif must be updated to 1.1.4, see https://github.com/mirage/digestif/releases/tag/v1.1.4. Updating implies a change in pickles/ro.ml
  • Change ledger from a class to an object. Failing tests on node because maybe top level evaluation.
 finished build
Running basic integration tests
/workspace_root/src/lib/snarkyjs/src/bindings/ocaml/overrides.js:34
    if (err instanceof Error) throw err;
                              ^


TypeError: Cannot read properties of undefined (reading 'apply')
    at Function.Class.<computed> (/home/runner/work/snarkyjs/snarkyjs/src/bindings/js/proxy.js:20:52)
    at Module.LocalBlockchain (/home/runner/work/snarkyjs/snarkyjs/src/lib/mina.ts:385:25)
    at file:///home/runner/work/snarkyjs/snarkyjs/src/examples/zkapps/hello_world/run.tmp.js:96:18

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them
  • Closes #0000

@dannywillems dannywillems requested a review from a team as a code owner July 28, 2023 14:09
Run
```
opam install alcotest.1.7.0 dune.3.9.1 js_of_ocaml.5.4.0
opam switch export opam.export
```
@dannywillems dannywillems force-pushed the dannywillems/revamped-bump-up-jsoo branch from 1bc9853 to 9e13ccc Compare July 28, 2023 14:11
@dannywillems
Copy link
Member Author

!ci-build-me

@dannywillems dannywillems requested a review from a team as a code owner July 28, 2023 15:21
@dannywillems
Copy link
Member Author

!ci-build-me

@dannywillems dannywillems requested a review from a team as a code owner July 28, 2023 16:47
scripts/testone.sh Outdated Show resolved Hide resolved
src/lib/mina_metrics/prometheus_metrics/mina_metrics.ml Outdated Show resolved Hide resolved
src/lib/pickles/tests/test_ro.ml Outdated Show resolved Hide resolved
src/lib/pickles/tests/test_ro.ml Show resolved Hide resolved
@dannywillems
Copy link
Member Author

!ci-build-me

Co-authored-by: Richard Bonichon <richard.bonichon@o1labs.org>
@dannywillems
Copy link
Member Author

!ci-bulid-me

@dannywillems
Copy link
Member Author

!ci-build-me

@dannywillems dannywillems marked this pull request as draft July 31, 2023 14:26
@dannywillems dannywillems force-pushed the dannywillems/revamped-bump-up-jsoo branch from c6d7277 to 3ffe6b3 Compare July 31, 2023 18:17
@dannywillems
Copy link
Member Author

!ci-build-me

@dannywillems
Copy link
Member Author

!ci-build-me

@dannywillems
Copy link
Member Author

!ci-build-me

@dannywillems
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member

Closing as stale. This PR is referenced in #14829, so that it can be used as a starting point if / when work resumes on this.

@mrmr1993 mrmr1993 closed this Jan 11, 2024
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