New issue
Advanced search Search tips

Issue 617187 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

infra[_internal] test.py: bring back globs for limiting test selection

Project Member Reported by tandrii@chromium.org, Jun 3 2016

Issue description

It used to be possible to limit almost arbitrarily which tests to run from O(1k) we have in infra. Recent changes in issue 606878 broke my workflow.

My workflow:
  Every time I flush buffer from my editor 
    the tests are run automatically [1]

  I don't want to wait 5-10 seconds (worse on a laptop)
  till all infra or CQ tests finish running.

  So, I used to limit tests to be run to just those I'm currently fixing.
  In such a case, however, coverage is not important,
  so I couldn't care less about failure to load coverage.rc [2]


[1] inode events on linux are awesome. Ping me if you want to ready-made support tooling.

[2] ./test.py test infra.libs
Running infra.libs...
Traceback (most recent call last):
  File "ENV/bin/expect_tests", line 29, in <module>
    expect_tests.main()
  File "infra/ENV/local/lib/python2.7/site-packages/expect_tests/main.py", line
170, in main
    coveragerc=opts.coveragerc)
  File "infra/ENV/local/lib/python2.7/site-packages/expect_tests/cover.py", line
98, in __init__
    self.cov = coverage.coverage(**self.opts)
  File "infra/ENV/local/lib/python2.7/site-packages/coverage/control.py", line
140, in __init__
    "Couldn't read '%s' as a config file" % config_file
coverage.misc.CoverageException: Couldn't read 'infra/infra.libs/.coveragerc' as
a config file
Tests failed in modules:
  infra.libs

 
Cc: sergeybe...@chromium.org
A possible fix is to check if the .coveragerc file exists at 

https://cs.chromium.org/chromium/infra/test.py?q=test.py&sq=package:chromium&l=124

and if not, add '--no-coverage' to the flags. This would fix your specific workflow, and would also stop the annoying "missing coverage" messages when not all files in a module are tested.
 Issue 617775  has been merged into this issue.

Comment 3 by no...@chromium.org, Jun 6 2016

Labels: Pri-1
> #1
this is not a fix, but a workaround that someone has to search for

also --no-coverage does not work for me:

infra $ (master)  ./test.py test --no-coverage infra/libs/git2
Running infra...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running infra_libs...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine_module...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/annotation-parser...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/bugdroid...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/chrome_infra_console...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/chrome_infra_console_loadtest...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/chrome_infra_packages...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/chrome_infra_stats...
usage: expect_tests [-h] {debug,test,train,list} ...
expect_tests: error: unrecognized arguments: infra/libs/git2
Running appengine/chromium_bugs...
usage: expect_tests [-h] {debug,test,train,list} ...

Comment 4 by no...@chromium.org, Jun 6 2016

In  issue 617775  sergeyberezine wrote:

I'm aware, and it was a design decision at the time. Missing coverage was more important than the ability to select subsets of tests. That feature was also broken in other subtle ways even before my change. Merging with an existing issue with a proposed temporary resolution.

---

This is a broken design. If I do `fetch infra` and run ./test.py it suggests 

 Run one given test in the infra package:
    ./test.py test infra/libs/git2/test:*testCommitBogus

and if I do

./test.py test infra/libs/git2/test:*testCommitBogus

it fails. Please fix it.

Comment 5 by no...@chromium.org, Jun 7 2016

Looks like argument parsing is broken
  ./test.py test appengine/cr-buildbucket/swarming/ 
works
  ./test.py test --verbose appengine/cr-buildbucket/swarming/ 
doesn't.
This could not be a part of solution design.

Please fix it.
Cc: -sergeybe...@chromium.org
Owner: sergeybe...@chromium.org
Status: Assigned (was: Untriaged)
Components: Infra>Client>Infra
Components: -Infra
Labels: Type-Bug
Cc: sergeybe...@chromium.org
Labels: -Pri-1 Pri-3
Owner: ----
Status: Available (was: Assigned)
I'm not actually working on this. Lowering priority, it's not really that urgent.

A proper fix would be to refactor expect_tests so it's a proper library, and the arguments are parsed in test.py. The amount of work at this point doesn't seem worth the benefit though.
Project Member

Comment 11 by sheriffbot@chromium.org, Aug 25 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment