Page MenuHomePhabricator

Make test_runner.py scripts argument accept wildcard
ClosedPublic

Authored by Fabien on Feb 4 2019, 10:11.

Details

Summary

With the scripts being renamed, it could be interesting to allow for
specifying a category of functional tests to run. This diff adds
support for a trailing wildcard in the name given to test_runner.py. For
example, all the abc functional tests can be run with
./test/functional/test_runner.py abc-*

Test Plan

Run all the abc functional tests

./test/functional/test_runner.py abc-*

Check all the tests are run

Run:

./test/functional/test_runner.py interface_* interface_zmq

Check that the interface_zmq test is not run twice

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 4 2019, 12:18
deadalnix requested changes to this revision.Feb 4 2019, 12:20
deadalnix added inline comments.
test/functional/test_runner.py
227 ↗(On Diff #7152)

This will not simply remove extension. It breaks existing semantic, and frankly, for no good reasons.

This revision now requires changes to proceed.Feb 4 2019, 12:20

Back to re.sub() instead of replace()

deadalnix requested changes to this revision.Feb 5 2019, 14:44

This shows all the sign of code that has been banged on until it more or less passes some smoke test.

The '.py$' being removed from various places. The argument passed being kind of regex kind of not. This code has not been designed in any way, it just happen to work in some specific case.

This revision now requires changes to proceed.Feb 5 2019, 14:44

Complete re-design:

  • Focus on the use case: only accept wildcard at the end
  • Avoid side effects by not using regex
Fabien retitled this revision from Make test_runner.py scripts argument accept wildcards to Make test_runner.py scripts argument accept wildcard.Feb 23 2019, 16:14
Fabien edited the summary of this revision. (Show Details)
Fabien edited the test plan for this revision. (Show Details)
deadalnix added inline comments.
test/functional/test_runner.py
234 ↗(On Diff #7448)

fnmatch.translate seems like a good candidate for what you are trying to do here.

This revision is now accepted and ready to land.Feb 25 2019, 23:01
This revision was automatically updated to reflect the committed changes.