-
Notifications
You must be signed in to change notification settings - Fork 33
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 Inspect Request Failure in xeus-cpp-lite #258
Fix Inspect Request Failure in xeus-cpp-lite #258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's perfect and exactly what was required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a way to test this change. Can you figure out how to write a test that runs as part of our ci?
Hi, So let me open an issue and start discussing more with @kr-2003 there. (Won't expect something through this PR just yet considering @kr-2003 is a xeus-cpp newbie 😬 ) I think I have couple approaches in mind (one directly inspired by Tharun's work running UI tests for the native notebook). Coming to this PR. The So yeah nothing apart from the size of the xcpp.data file would be changing here. |
Here's the issue #259 |
Is there any chance to run this notebook as part of the CI the way we do this for the non-wasm version? |
I think this is the closest/fastest approach to get that #259 (comment) Let's move this in and we can try it out ? Tharun's work might have potential too.(I shall be meeting him soon to discuss more) |
Let's spend a day in investigating if what Tharun has done applies here. If we can't solve it in a day or two we can move forward by squashing both commits into one. |
Perfect. Shall meet him tomorrow and discuss more ( I am just thinking if this might involve compiling papermill and nbformat against emscripten as this is what he made use of ) |
https://github.com/kr-2003/xeus-cpp/actions/runs/13543087790/ These are the runs for testing xeus-cpp-lite in ubuntu 24.04 and macos 15. They are passing without having any issue. |
For now, its testing for simple |
Does it break if there is an error? |
Hey @kr-2003 thanks for this. I shall review your branch by tomorrow and then we can possibly take this in. Technically we shouldn't be having all the ui-test code here and it should be placed somewhere mainstream and we just import the framework. I think a jupyterlite repo should be made (maybe jupyterlite/ui-tests or something). I shall talk to a jupyterlite maintainer about this. That being said, untill something like that is in place, we don't really have any quick way to just check things on a lite notebook yet ..... so possibly we'll just go ahead with the approach above (if Tharun and I can't find a better one) For starters, we just need like 2-3 simple tests i would assumer (1 execute request test ... hello world should do I suppose, 1 inspect request). Kernel info request might be a bonus just to verify that only the cpp20 kernel is supported through xeus-cpp-lite for now ! |
Yes, if there is an error, then the screenshot will be different than the expected screenshots. Therefore, it will mark those test cases as failed. Even the slightest difference of pixels are not tolerable by playwright. |
@anutosh491 |
arghhh that sucks. I was interested in introducing something for the main requests that work : |
We need something that compares the expected value to the cell's current execution value and if they differ the test fails. We already have similar infrastructure for the non-wasm builds. |
Even if we have something like this, it won't compare the |
The temporary solution here can be: We can set |
Hmmm, I think we can. We can extract out the json and just compare the links being directed too if we really want to. Something like this xeus-cpp/test/test_interpreter.cpp Line 107 in f054951
But that's not what the discussion is here, I think. Taking a step back and trying to look at this from a hawk-eye view (just because I haven't had the time to dive deeper), this is what we have
execute a cell -> capture a screenshot through some framework -> compare with stored screenshot Nothing really wrong (and we would go with this if we don't find better options) but yeah a bit cumbersome to maintain
I) Store the expected json otputs somewhere For example a cell would look like this
Just keeping track of |
But yeah that being said, I think getting the inspect request to work with lite is great. I was just telling Sylvain about this yesterday and he was really happy about it (cause no other Jupyterlite kernel like python-pydodie, xeus-python-lite, xeus-r-lite etc can execute an inspect_request) So yeah I would not stall this PR for too long. Shouldn't we keep track of all ideation for the UI tests here #259 (which is why I had opened the issue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anutosh491, convinced me offline to move forward with this pull request given it has no tests this one time. We should open an issue to remind us we to add tests at our earlier convenience.
@anutosh491 convinced me offline to move forward with this pull request given it has no tests this one time. We should open an issue to remind us we to add tests at our earlier convenience.
Description
This PR resolves the issue where
?std::vector
and similar inspect requests were failing in xeus-cpp-lite when built with WebAssembly (WASM) options. The inspect request was unable to locate the tag files correctly.Fixes #229
Changes
--preload-file
correctly includes the required tag files by addingin
target-link-options
while building forEMSCRIPTEN
./notebooks/xeus-cpp-lite-demo.ipynb
.Screenshot
Type of change
Please tick all options which are relevant.