Dear Josh and Rotund,
Sorry for late reply, since I was surveyed for what concrete feature I want to implement.
According to some ticket, such as
#6712 #17365 #13873, some developer want to define their own test suite instead of let test runner discover and construct one, and therefore the
#tagging-tests was implemented, but if we need to change the test suite, we need to add or edit tag in many place in the test script, therefore, I came up a new feature is that provide a way to let developer define their frequently used tests as test suite in a file.
Although it already exists ``tag`` for developer to categorize tests, within this feature developer could have a more convenient way to define the test suite for their project to let their user easier to run test without need to memorize which tags or test modules needs to specified in command line, because it already defined in test suite file.
The test suite file may be written in JSON format or YAML fomat(I don't know which one is better)
eg:
There are two apps in this project, ``mysite`` and ``polls``.
The structure of the project may be
├── db.sqlite3
├── manage.py
├── mysite
├── test_suite.json
│ ├── __init__.py
│ ├── settings.py
│ ├── tests.py
│ ├── urls.py
│ └── wsgi.py
└── polls
├── admin.py
├── apps.py
├── __init__.py
├── migrations
│ └── __init__.py
├── models.py
├── tests.py
├── urls.py
└── views.py
The content in test_suite.json is
{
"Fast test": {
"mysite":{
"tag": ["fast", "quick"]
"tests": ["urls", "views"]
},
"polls":{
"exclude tag": ["low", "detail"]
"tests": ["template","login"]
}
},
"Detail test": {
"mysite":{
"tests": "all"
},
"polls":{
"tests": "all"
}
}
}
The usage of running these suite is simply use
./manage.py run test --suite="Fast test"
The ``mysite`` and ``poll`` are the app names in a project, tests field in test suite file may be module, TestCase class or even single test in TestCase. As for the ``tag`` and ``exclude tag`` which uses the tag decorator in original tag system.
This feature seems to have many behaviors similar to original tag, but I think this test suite feature will make developer easier to define their suite without add or edit many tags in script.
Sincerely
Billy Su
Rotund於 2018年3月17日星期六 UTC+8上午4時38分16秒寫道: