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

Do not automatically run tests #129

Merged
merged 1 commit into from
Jan 24, 2019
Merged

Do not automatically run tests #129

merged 1 commit into from
Jan 24, 2019

Conversation

ry
Copy link
Member

@ry ry commented Jan 18, 2019

cc @hayd

@ry ry requested a review from piscisaureus January 18, 2019 19:49
@hayd
Copy link
Contributor

hayd commented Jan 18, 2019

I don't like this, you're losing some really nice behavior here. I think a better way forward is:

At the moment it's neat that you can run deno test.ts and deno testing/test.ts etc and both will work as expected. That's a great feature.

@ry
Copy link
Member Author

ry commented Jan 18, 2019

@hayd Try executing file_server.ts on the current master - there's a bug - note what is printed on the last line:

~/src/deno_std> file_server
HTTP server listening on http://0.0.0.0:4500/
running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

This is caused by:
https://github.com/denoland/deno_std/blob/4283c26b8930ca80e5babca3337b5431f16334d0/io/bufio.ts#L8

Having the test runner run automatically is not very explicit and leads to problems like this.

@ry
Copy link
Member Author

ry commented Jan 18, 2019

@hayd I've added a basic testing/main.ts - does this work for you?

@hayd
Copy link
Contributor

hayd commented Jan 18, 2019

whelp, that sure is a bug! Wow.

I was imagining deno testing/main.ts test.ts would be the way to call it (like in #108).

@ry
Copy link
Member Author

ry commented Jan 18, 2019

I was imagining deno testing/main.ts test.ts would be the way to call it (like in #108).

Actually I was thinking something more powerful deno testing/main.ts would do something like find . | egrep "_test.(js|ts)$" and then figure out the list of permissions, and then start a number of deno subprocesses for each set of permissions (like we do in deno's test runner)

@hayd
Copy link
Contributor

hayd commented Jan 18, 2019

The problem I had when doing this, after ESM, was import() no longer works (you want import() each file after the find/grep then runTests).

Also, you can add a --grep arg fairly easily to filter tests by name.

@ry ry force-pushed the no_auto_run_tests branch from 230e65c to 3955701 Compare January 18, 2019 22:06
@ry
Copy link
Member Author

ry commented Jan 18, 2019

@hayd good point. dynamic import coming soon..

@ry ry force-pushed the no_auto_run_tests branch from 6985781 to 16b0bc9 Compare January 24, 2019 15:28
@piscisaureus
Copy link
Member

EDIT oops misunderstood. New comment:

There's a better solution for the issue this is intended tot fix.
Call setTimeout the first time test() is called to register a test.

@piscisaureus
Copy link
Member

Discussed off github: we'll land this now to fix the bug in file_server. We'll add something like runIfMain(imports.meta) to the test harness so running tests from individual test.ts files will still be possible.

@ry ry mentioned this pull request Jan 24, 2019
@ry
Copy link
Member Author

ry commented Jan 24, 2019

Added an issue for this #152

@ry ry merged commit ec1675a into denoland:master Jan 24, 2019
@hayd
Copy link
Contributor

hayd commented Jan 26, 2019

Can I make a PR for:

There's a better solution for the issue this is intended tot fix.
Call setTimeout the first time test() is called to register a test.

?

@hayd
Copy link
Contributor

hayd commented Jan 28, 2019

See #160.

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

Successfully merging this pull request may close these issues.

3 participants