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

"deno test" failure #2948

Closed
ry opened this issue Sep 14, 2019 · 4 comments · Fixed by #3034
Closed

"deno test" failure #2948

ry opened this issue Sep 14, 2019 · 4 comments · Fixed by #3034
Labels
bug Something isn't working correctly

Comments

@ry
Copy link
Member

ry commented Sep 14, 2019

> ./target/debug/deno test js/version_test.ts
Download https://deno.land/std@06958a4/testing/runner.ts
Compile https://deno.land/std@06958a4/testing/runner.ts
Download https://deno.land/std@06958a4/fs/mod.ts
Download https://deno.land/std@06958a4/testing/mod.ts
Download https://deno.land/std@06958a4/fs/empty_dir.ts
Download https://deno.land/std@06958a4/fs/ensure_dir.ts
Download https://deno.land/std@06958a4/fs/ensure_file.ts
Download https://deno.land/std@06958a4/fs/ensure_link.ts
Download https://deno.land/std@06958a4/fs/ensure_symlink.ts
Download https://deno.land/std@06958a4/fs/exists.ts
Download https://deno.land/std@06958a4/fs/move.ts
Download https://deno.land/std@06958a4/fs/copy.ts
Download https://deno.land/std@06958a4/fs/read_file_str.ts
Download https://deno.land/std@06958a4/fs/write_file_str.ts
Download https://deno.land/std@06958a4/fs/read_json.ts
Download https://deno.land/std@06958a4/fs/write_json.ts
Download https://deno.land/std@06958a4/fs/eol.ts
Download https://deno.land/std@06958a4/fs/utils.ts
Found 4 matching test files.
Compile file:///Users/rld/src/deno/js/version_test.ts
error: Uncaught SyntaxError: Unexpected token ':'
► file:///Users/rld/src/deno/target/debug/.deno_test/gen/file/Users/rld/src/deno/js/version_test.ts.js.map:1:11

1 {"version":3,"file":"version_test.js","sourceRoot":"","sources":["file:///Users/rld/src/deno/js/version_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE9C,IAAI,CAAC,SAAS,OAAO;IACnB,MAAM,OAAO,GAAG,iBAAiB,CAAC;IAClC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC"}
            ^
@ry ry added the bug Something isn't working correctly label Sep 14, 2019
@bartlomieju
Copy link
Member

This issue is related to denoland/std#576 - it looks like your DENO_DIR is set to target/debug/.deno_test. It's in the same directory as you're running test runner. So it indeed walks through the whole directory and version_test.ts.js.map matches the default regex for test file (Regexes have g flag, so .js.map ending is matched).

We definitely need to rethink how test runner discovers files. It'd probably be a good idea to skip directories listed in .gitignore as well and try to partially match directories to avoid expensive walking over big directories as suggested in denoland/std#576

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Sep 14, 2019

@bartlomieju

Regexes have g flag

Hmm, why?

Also, I'm concerned that the default globs can't be used in practice. You'd normally try to run deno test src precisely to avoid things like node_modules and deno_dir, but then you lose the globs and it matches everything in src. I crashed into this my first time trying it. I think any directory arguments should have some kind of default globs applied to them.

@bartlomieju
Copy link
Member

Regexes have g flag

Hmm, why?

TBH I don't remember, I introduced it in denoland/std#574 so it was probably not working properly without it. Upgrades welcome

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Sep 20, 2019

This is fixed by denoland/std#604 (when integrated), in that //js/version_test.ts is the only matched file.

Not sure what you were expecting but no tests would be run anyway since they're declared using the test() in //js/deps/https/deno.land/std whereas deno test here uses https://deno.land/std@06958a4. Nevermind, I see it's in the global context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants