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

Failing tests when ECMA scripting enabled #361

Open
aelmahmoudy opened this issue Jan 9, 2025 · 23 comments
Open

Failing tests when ECMA scripting enabled #361

aelmahmoudy opened this issue Jan 9, 2025 · 23 comments

Comments

@aelmahmoudy
Copy link
Contributor

The following 85 tests failed when I build with ECMA scripting enabled:

 19/103 customEvent.html
 20/103 doctype.publicId.html
 21/103 doctype.systemId.html
 22/103 document.anchors.html
 23/103 document.baseURI.html
 24/103 document.body.childNodes.html
 25/103 document.body.children.html
 26/103 document.body.id.html
 27/103 document.characterSet.html
 28/103 document.currentScript.html
 29/103 document.doctype.html
 30/103 document.documentElement.html
 31/103 document.documentURI.html
 32/103 document.domain.html
 33/103 document.getElementsByClassName.html
 34/103 document.getElementsByClassName_2.html
 35/103 document.getElementsByTagName.html
 36/103 document.images.html
 37/103 document.links.html
 38/103 document.location.href.html
 39/103 document.new.html
 40/103 document.querySelectorAll.html
 41/103 document.querySelector.html
 42/103 domparser.html
 43/103 element.appendChild.html
 44/103 element.attributes.html
 45/103 element.checked.html
 46/103 element.childElementCount.html
 47/103 element.classList.html
 48/103 element.className.html
 49/103 element.cloneNode.html
 50/103 element.closest.html
 51/103 element.contains.html
 52/103 element.dataset.html
 53/103 element.dir.html
 54/103 element.eventListener.html
 55/103 element.firstChild.html
 56/103 element.firstElementChild.html
 57/103 element.getAttribute.html
 58/103 element.getAttributeNode.html
 59/103 element.getElementsByTagName.html
 60/103 element.hasAttribute.html
 61/103 element.hasAttributes.html
 62/103 element.hasChildNodes.html
 63/103 element.href.html
 64/103 element.id.html
 65/103 element.innerHTML.html
 66/103 element.insertBefore.html
 67/103 element.isEqualNode.html
 68/103 element.isSameNode.html
 69/103 element.lang.html
 70/103 element.lastChild.html
 71/103 element.lastElementChild.html
 72/103 element.matches.html
 73/103 element.nextElementSibling.html
 74/103 element.nextSibling.html
 75/103 element.nodeName.html
 76/103 element.nodeType.html
 77/103 element.nodeValue.html
 78/103 element.outerHTML.html
 79/103 element.parentElement.html
 80/103 element.parentNode.html
 81/103 element.previousElementSibling.html
 82/103 element.previousSibling.html
 83/103 element.querySelectorAll.html
 84/103 element.querySelector.html
 85/103 element.remove.html
 86/103 element.setAttribute.html
 87/103 element.textContent.html
 88/103 eventListener.html
 89/103 fetch.html
 90/103 fragment.appendChild.html
 91/103 fragment.firstChild.html
 92/103 fragment.getElementsByTagName.html
 93/103 fragment.hasChildNodes.html
 94/103 fragment.new.html
 95/103 image.new.html
 96/103 keyboardEvent.html
 97/103 navigator.appCodeName.html
 98/103 node.nodeType.html
 99/103 nodelist.forEach.html
100/103 style.backgroundClip.html
101/103 window.setTimeout.html
102/103 URL.html
103/103 URLSearchParams.html

For a few tests, the stderr says Segmentation fault (core dumped), for most of the tests, stderr says -eval:1: unknown option

Full build log: https://salsa.debian.org/aelmahmoudy/elinks/-/jobs/6891196/raw

@rkd77
Copy link
Owner

rkd77 commented Jan 9, 2025

Sorry, it is broken. ecmascript tests require either spidermonkey=true or quickjs=true or mujs=true .
I did not anticipate case that someone wants sm-scripting=true with spidermonkey=false (default).
In 1f2929f possibility to set sm-scripting=true without spidermonkey=true cause error.

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 9, 2025 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 9, 2025 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 9, 2025 via email

@rkd77
Copy link
Owner

rkd77 commented Jan 10, 2025

I don't know. In container with debian trixie, I cloned repos mentioned in logs, built and installed required packages.
dpkg-buildpackage and tests passed, so how to reproduce it?

@rkd77
Copy link
Owner

rkd77 commented Jan 10, 2025

From branch debian/javascript.

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 10, 2025 via email

@rkd77
Copy link
Owner

rkd77 commented Jan 11, 2025

elinks.log.gz
../b.sh:

#!/bin/bash
dpkg-query --list
git reset --hard
rm -rf .pc
rm -f src/js/fetch.h
dpkg-buildpackage

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 11, 2025 via email

@rkd77
Copy link
Owner

rkd77 commented Jan 11, 2025

I cannot see difference.

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 12, 2025 via email

@rkd77
Copy link
Owner

rkd77 commented Jan 13, 2025

@aelmahmoudy, if you copy and paste command to direcory with tests test/js/assert, then error messages ought to be more verbose. Eg.:
cd test/js/assert

UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=135 /builds/aelmahmoudy/elinks/debian/output/source_dir/obj-x86_64-linux-gnu/src/elinks --test 1 --eval 'set ecmascript.enable = 1' --eval 'set ecmascript.allow_xhr_file = 1' --eval 'set ecmascript.enable_console_log = 1' --eval 'set ui.sessions.fork_on_start = 0' --no-connect 1 doctype.publicId.html

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 13, 2025 via email

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 13, 2025

I ran env on the builder before running the tests it showed that TERM=unknown

@rkd77
Copy link
Owner

rkd77 commented Jan 13, 2025

I guess elinks requires a terminal. I'll make these tests optional, another bool option to the meson.

rkd77 added a commit that referenced this issue Jan 13, 2025
Default enabled, but requires also Dtest=true
Not every test environment has access to terminal.
AFAIK, elinks needs terminal, js tests depend on elinks binary.
@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 13, 2025

I set TERM=dumb and the tests passed ! Maybe that would be better than disabling the JS tests

@aelmahmoudy
Copy link
Contributor Author

By the way, I tried running this test interactively, by opening doctype.publicId.html, yet clicking the button does nothing

@rkd77
Copy link
Owner

rkd77 commented Jan 13, 2025

I copied content from other files, but did not pay attention to it. Only assertions are meaningful there.

@aelmahmoudy
Copy link
Contributor Author

I see. I tried elinks with one of either MuJS & QuickJS. I tried on sites like GitHub, but I don't see a difference in experience, there are still "Harmless buttons" for example.

@aelmahmoudy
Copy link
Contributor Author

aelmahmoudy commented Jan 14, 2025

3 tests fail with MuJS engine:

=================================== 88/103 ===================================
test:         document.getElementsByClassName_2.html
start time:   05:22:30
duration:     30.04s
result:       exit status 2
command:      MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 TERM=dumb MALLOC_PERTURB_=15 /builds/aelmahmoudy/elinks/debian/output/source_dir/obj-x86_64-linux-gnu/src/elinks --test 1 --eval 'set ecmascript.enable = 1' --eval 'set ecmascript.allow_xhr_file = 1' --eval 'set ecmascript.enable_console_log = 1' --eval 'set ui.sessions.fork_on_start = 0' --no-connect 1 document.getElementsByClassName_2.html
----------------------------------- stderr -----------------------------------
SyntaxError: [string]:4: unexpected token in expression: '.'
==============================================================================
================================== 102/103 ===================================
test:         fetch.html
start time:   05:22:34
duration:     30.02s
result:       exit status 2
command:      MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 TERM=dumb MALLOC_PERTURB_=183 /builds/aelmahmoudy/elinks/debian/output/source_dir/obj-x86_64-linux-gnu/src/elinks --test 1 --eval 'set ecmascript.enable = 1' --eval 'set ecmascript.allow_xhr_file = 1' --eval 'set ecmascript.enable_console_log = 1' --eval 'set ui.sessions.fork_on_start = 0' --no-connect 1 fetch.html
----------------------------------- stderr -----------------------------------
SyntaxError: [string]:1: unexpected token: 'function' (expected ';')
==============================================================================

================================== 103/103 ===================================
test:         URLSearchParams.html
start time:   05:23:01
duration:     30.04s
result:       exit status 2
command:      MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=8 TERM=dumb /builds/aelmahmoudy/elinks/debian/output/source_dir/obj-x86_64-linux-gnu/src/elinks --test 1 --eval 'set ecmascript.enable = 1' --eval 'set ecmascript.allow_xhr_file = 1' --eval 'set ecmascript.enable_console_log = 1' --eval 'set ui.sessions.fork_on_start = 0' --no-connect 1 URLSearchParams.html
----------------------------------- stderr -----------------------------------
URLSearchParams.html
ReferenceError: 'URLSearchParams' is not defined
==============================================================================


Summary of Failures:

 88/103 document.getElementsByClassName_2.html TIMEOUT        30.04s   exit status 2
102/103 fetch.html                             TIMEOUT        30.02s   exit status 2
103/103 URLSearchParams.html                   TIMEOUT        30.04s   exit status 2

Ok:                 95
Expected Fail:      5
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            3

Full build log: https://salsa.debian.org/aelmahmoudy/elinks/-/jobs/6917043/raw

I didn't pull xxd for that build, since MuJS support didn't require it, could this be the reason ?

@rkd77
Copy link
Owner

rkd77 commented Jan 14, 2025

No, mujs is for fans of MuJS. I don't know how to implement these features: (Associative arrays, Promise and ...).

@aelmahmoudy
Copy link
Contributor Author

Btw, commit 4b979b4 fixed the failing JS tests issue (not the MuJS specific ones)

@rkd77
Copy link
Owner

rkd77 commented Jan 14, 2025

MuJS is waiting for someone to fix it. For now, do not package MuJS flavor.
Not too many sites are "usable" with elinks's js implementation, but a year ago was the same, so no big regression.

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

No branches or pull requests

2 participants