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

Projects

None yet

5 participants

@MylesBorins
Member
MylesBorins commented Nov 18, 2016 edited

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?

@bnoordhuis
Member

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

@MylesBorins
Member
MylesBorins commented Nov 19, 2016 edited

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
@addaleax
Member
addaleax commented Nov 19, 2016 edited

@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
Contributor

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

@jbergstroem
Member

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

@reconbot
Contributor

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

@reconbot reconbot added a commit to reconbot/node that referenced this issue Nov 20, 2016
@reconbot reconbot tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

Fixes: nodejs#9684
ddcbcf1
@MylesBorins MylesBorins added a commit that closed this issue Nov 26, 2016
@reconbot @MylesBorins reconbot + MylesBorins tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
951ba0d
@MylesBorins MylesBorins added a commit that referenced this issue Nov 26, 2016
@reconbot @MylesBorins reconbot + MylesBorins tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
561b149
@MylesBorins MylesBorins added a commit that referenced this issue Nov 26, 2016
@reconbot @MylesBorins reconbot + MylesBorins tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
bd7c1e7
@MylesBorins MylesBorins added a commit that referenced this issue Nov 26, 2016
@reconbot @MylesBorins reconbot + MylesBorins tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix

PR-URL: #9694
Fixes: #9684
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
b1bd1c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment