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

tools/test.py should be able to get a full path to a test to manually run it #9684

Closed
MylesBorins opened this issue Nov 18, 2016 · 7 comments
Labels
test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.

Comments

@MylesBorins
Copy link
Contributor

MylesBorins commented Nov 18, 2016

Currently if you want to manually run a test you have to remove test/ from the beginning of the path and not include the js prefix.

For example the following commands will not work

$ python tools/test.py test/parallel/test-cluster-worker-init.js
$ python tools/test.py test/parallel/test-cluster-worker-init
$ python tools/test.py parallel/test-cluster-worker-init.js

but the following will

$ python tools/test.py parallel/test-cluster-worker-init

I find this counter intuitive and would like the ability to pass the full path to a test

/cc @nodejs/build @jbergstroem do you oppose to this being done?

@MylesBorins MylesBorins added good first issue Issues that are suitable for first-time contributors. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Nov 18, 2016
@bnoordhuis
Copy link
Member

Personally I'm fine with that as long as the current syntax (including wildcards like parallel/test-cluster-*) keeps working.

@MylesBorins
Copy link
Contributor Author

MylesBorins commented Nov 19, 2016

I was imagining it could likely be a regex/replace for test/ and .js

Example implemented with sed

$ echo "test/parallel/test-cluster-worker-init.js" | sed 's+test/++; s/.js//'
parallel/test-cluster-worker-init

@reconbot
Copy link
Contributor

@addaleax
Copy link
Member

addaleax commented Nov 19, 2016

@reconbot It works, so I guess there’s nothing speaking against opening a PR and seeing where it goes? (You’ll want to add a tools: prefix to your commit subject line, btw; EDIT: and a Fixes: https://github.com/nodejs/node/issues/9684 line, too? :))

@reconbot
Copy link
Contributor

I found the handy contributors guide link when opening the PR. I think I got it right

@jbergstroem
Copy link
Member

I'm with @bnoordhuis; would accept such a PR.

@reconbot
Copy link
Contributor

@addaleax thanks for the subsection btw, it wasn't clear to me what that should be

@addaleax addaleax removed the good first issue Issues that are suitable for first-time contributors. label Nov 19, 2016
reconbot added a commit to reconbot/node that referenced this issue Nov 20, 2016
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

Fixes: nodejs#9684
MylesBorins pushed a commit that referenced this issue Nov 26, 2016
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
MylesBorins pushed a commit that referenced this issue Nov 26, 2016
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
MylesBorins pushed a commit that referenced this issue Nov 26, 2016
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

No branches or pull requests

5 participants