Page MenuHomePhabricator

Make test_runner.py scripts argument accept wildcard
ClosedPublic

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

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCd0ca5336f4cb: Make test_runner.py scripts argument accept wildcard
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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Feb 4 2019, 10:11
Herald added a reviewer: Restricted Project. · View Herald TranscriptFeb 4 2019, 10:11
Herald added a subscriber: schancel. · View Herald Transcript
deadalnix accepted this revision.Feb 4 2019, 12:18
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
Fabien updated this revision to Diff 7185.Feb 5 2019, 09:24

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
Fabien updated this revision to Diff 7448.Feb 23 2019, 16:12

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 accepted this revision.Feb 25 2019, 23:01
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.