You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A few test cases fail if the project directory is located in a deep place #16305
The following two test cases fail if they are located in a deeply nested place.
integration::run::queue_microtask_error_handled
integration::run::report_error_handled
Output:
OUTPUT
1
{
cancelable: true,
message: "Uncaught Error: foo",
filename: "file:///Users/yusuktan/Repos/github.com/magurotuna/deno/cli/tests/testdata/run/report_error_handled....",
lineno: 18,
colno: 13,
error: Error: foo
at file:///Users/yusuktan/Repos/github.com/magurotuna/deno/cli/tests/testdata/run/report_error_handled.ts:18:13
}
onerror() called Error: foo
at file:///Users/yusuktan/Repos/github.com/magurotuna/deno/cli/tests/testdata/run/report_error_handled.ts:18:13
2
OUTPUT
EXPECTED
1
{
cancelable: true,
message: "Uncaught Error: foo",
filename: "[WILDCARD]/report_error_handled.ts",
lineno: 18,
colno: 13,
error: Error: foo
at [WILDCARD]/report_error_handled.ts:18:13
}
onerror() called Error: foo
at [WILDCARD]/report_error_handled.ts:18:13
2
EXPECTED
Seems like the "filename" field is different between the expected and actual one. The actual output shows the "omitted" file path (notice that the string ends with the ellipsis), probably because I put the project in a deep place.
This test failure doesn't cause any problem on CI, but it would be even better if we could successfully run it regardless of each individual's setup.
@magurotuna
Hi Tanaka san (I wanted to call you your surname because I'm also Japanese 🙇 ), can I work on this? I'm new to Deno and thought this is a good one for my first issue to contribute.
By the way, I searched a bit but I couldn't see the reason why filepath has ellipsis... It seems the filepath has ellipsis after 101st character in your case. Therefore, I tried to find something related to this rule but I don't know yet.
@shogohida
Hi 👋 Yes, please do!
I haven't delve into it yet, but my guess is that elipsis comes from the implementation of console.log().
Here's one of the test cases that fail.
where we use console.log to print the event information.
The point is that we don't test console.log implementation here, so it's totally fine to use another way to print it. Or you could cut the beginning part of the filename in a heauristic fashion so that it won't get truncated.
Activity
shogohida commentedon Oct 26, 2022
@magurotuna
Hi Tanaka san (I wanted to call you your surname because I'm also Japanese 🙇 ), can I work on this? I'm new to Deno and thought this is a good one for my first issue to contribute.
By the way, I searched a bit but I couldn't see the reason why filepath has ellipsis... It seems the filepath has ellipsis after 101st character in your case. Therefore, I tried to find something related to this rule but I don't know yet.
Please let me know if you have any clue!
magurotuna commentedon Oct 28, 2022
@shogohida
Hi 👋 Yes, please do!
I haven't delve into it yet, but my guess is that elipsis comes from the implementation of
console.log().Here's one of the test cases that fail.
deno/cli/tests/integration/run_tests.rs
Lines 2849 to 2852 in a4d4acd
This means that the input for this case is this:
deno/cli/tests/testdata/run/queue_microtask_error_handled.ts
Lines 1 to 11 in a4d4acd
where we use
console.logto print the event information.The point is that we don't test
console.logimplementation here, so it's totally fine to use another way to print it. Or you could cut the beginning part of thefilenamein a heauristic fashion so that it won't get truncated.shogohida commentedon Oct 30, 2022
@magurotuna
Thanks for your advice! I noticed filename of event_listener_error_handled and set_timeout_error_handled has slice method after reading your comment.
I made a pull request to add slice to queue_microtask_error_handled and report_error_handled!
#16482
fix(test): add slice method to filename to make them portable (#16482)