-
Notifications
You must be signed in to change notification settings - Fork 66
Fix learn-ocaml-client regression after PR #320 #397
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
Fix learn-ocaml-client regression after PR #320 #397
Conversation
dd202a7
to
b9109ac
Compare
* Adapt ./tests/runtests.sh so it recognizes USE_CLIENT_IMAGE=true * Update .github/workflows/build-and-test.yml accordingly so learn-ocaml-client runs against each ${{ matrix.server_image }}
This ensures learn-ocaml-client.master is still able to query a server version learn-ocaml.0.12. Minimal working example: cd .../learn-ocaml docker run --name=locaml -d -it -p 8080:8080 -v "$PWD/demo-repository:/repository" ocamlsf/learn-ocaml:0.12 TOKEN=$(docker logs locaml | grep -e 'Initial teacher token created:' | sed -e 's/^.*: //') # then git checkout 42d8127 opam install . --deps-only --locked -y opam install -y opam-installer.$(opam config var opam-version) eval $(opam env) make make opaminstall learn-ocaml-client init -s http://localhost:8080 -t "$TOKEN" touch demo.ml learn-ocaml-client grade demo.ml Output before the fix: Fatal error: exception Json_encoding.Cannot_destruct(_) Called from unknown location Called from unknown location Called from unknown location Called from unknown location Called from unknown location Called from unknown location Called from unknown location
ebbfc3c
to
c00a3ab
Compare
This PR is now ready, but before merging I'd like to have some confirmation by @yurug that the fix-commit cd9291e does not have unforeseen side-effects, on existing exercises you may have prepared, and that would specifically rely on the Summary of the PR
(Note that the GHA logs are not archived indefinitely, hence the copy-and-paste in the above snippets.) |
The last-but-one CI run failed because it seems the token is not yet created at the time the server listens to the TCP port… I've pushed a slightly different way to get this token but I believe it might still fail. FTR:
so @yurug, wouldn't you mind if I rather write this shouldn't be fragile (as unrelated to the build time of the repo): this extra second should just be required to account for the difference time |
Fine for me! |
Thanks @yurug, actually Now the code related to your initial comment reads: if ! wait_for_it "http://localhost:8080/version" "$build_timeout" sleep 1s # ... I thoroughly improved the bash script along the way, and did several tests locally: everything looks fine… so let's wait for the CI :) |
* The standard wait_for_it.sh script was not enough: very quickly, the server acknowledges wait_for_it.sh but "curl http://localhost:8080/version" fails with: curl: (56) Recv failure: Connection reset by peer
d62aa2c
to
674c2f2
Compare
674c2f2
to
8e06dd7
Compare
OK so if this very last CI run is OK ✔️, you'll be able to merge this PR anytime this Thursday, @yurug :) |
Thank you @erikmd! |
Hi @yurug, small remark: it happens there are 3 PR merging strategies in GitHub ( But
While So, maybe for upcoming PRs we should only use |
OK. We indeed need to follow one merging strategy. |
With @LouisAyroles and @Fixiss, we noticed that there were some (unexpected) incompatibility between learn-ocaml-client (say, from master) and the latest release of learn-ocaml (0.12).
Here a minimal working example to reproduce the bug:
then we were getting:
Thanks to git bisect and further explorations, it appears the issue was just introduced in PR #320.
This new PR attempts to fix this issue (very important to have some smooth experience with learn-ocaml-client and learn-ocaml.el), and I'll proceed in a TDD-like manner (extended the GHA CI test-suite within this PR).