tools: allow test.py to use full paths of tests #9694

Closed
wants to merge 1 commit into
from

Projects

None yet

9 participants

@reconbot
Contributor
reconbot commented Nov 19, 2016 edited
Checklist
  • commit message follows commit guidelines
  • ran test suite, no new tests
Affected core subsystem(s)

Fixes: #9684
tools/test.py can now take paths like

$ 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
Description of change

Slices off the test/ and the .js on input files. Wildcards like parallel/test-cluster-* will still work as will defaults.

@MylesBorins

LGTM if CI is green

@gibfahn

Looking forward to no more No tests to run because you copied the .js as well. Also tab-complete for tests is great.

@reconbot
Contributor

@TheAlphaNerd freebsd failed but I can't figure out what failed, I see "no failures"

screen shot 2016-11-19 at 10 35 51 am

@MylesBorins
Member
MylesBorins commented Nov 19, 2016 edited

failure looks infra related /cc @nodejs/build

fixes #9684

@addaleax

LGTM

@jbergstroem
Member

@TheAlphaNerd what you meant to say was "the failure looks @jbergstroem-related". Should be fixed now.

@MylesBorins
Member

@jbergstroem you are a hero! Thank you for all the hard infra work you do.

@jbergstroem
Member

@TheAlphaNerd thanks! if only the work wasn't so tied to fixing my other work :)

tools/test.py
@@ -1461,6 +1461,13 @@ def SplitPath(s):
stripped = [ c.strip() for c in s.split('/') ]
return [ Pattern(s) for s in stripped if len(s) > 0 ]
+def NormalizePath(path):
+ # strip the extra path information of the specified test
+ if path[:5] == 'test/':
@thefourtheye
thefourtheye Nov 20, 2016 Contributor

Use startswith and endswith.

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

@thefourtheye updated to use startswith and endswith.

@thefourtheye

Nice. LGTM. Thanks :)

@MylesBorins
Member

landed in 951ba0d

@MylesBorins MylesBorins added a commit that referenced this pull request 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 pull request 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 pull request 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 pull request 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
@reconbot reconbot deleted the reconbot:testpy-paths branch Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment