Unit test history report server
- Create a database
- Install package
pip install -e git+https://github.com/KarrLab/test_history_server.git#egg=test_history_server -t /path/to/web-server/test_history_server
- Edit site and database configuration in
/path/to/web-server/test_history_server/test_history_server/site/settings.py
- Setup database
cd /path/to/web-server/test_history_server/test_history_server/site
python manage.py makemigrations core
python manage.py migrate
- Edit server configuration in
/path/to/web-server/test_history_server/test_history_server/site/wsgi.py
To browse test histories, open the URL specified by BASE_URL
in /path/to/web-server/test_history_server/test_history_server/site/settings.py
.
The following example illustrates how to add test reports to the database:
import requests
r = requests.post('<settings.BASE_URL>/rest/submit_report',
data={
'token': <test_server_token>,
'repo_name': <repo_name>,
'repo_owner': <repo_owner>,
'repo_branch': <repo_branch>,
'repo_revision': <repo_revision>,
'build_num': <build_num>,
'report_name': <extra textual label for individual reports within build, such as to indicate results from different versions of Python>,
},
files={
'report': </path/to/junit-style-XML-test-report.xml>,
})
r_json = r.json()
if not r_json['success']:
raise BuildHelperError('Error uploading report to test history server: {}'.format(r_json['message']))
Please see the API documentation.
- Endpoint:
<settings.BASE_URL>/rest/submit_report
- Method: POST
- Arguments:
token
(string): secret token used to authenticate with serverrepo_owner
(string): user or organization which owns the GitHub repositoryrepo_name
(string): the name of the GitHub repositoryrepo_branch
(string): the name of the branch of the repository that was testedrepo_revision
(string): the SHA1 key of the revision that was testedbuild_num
(integer): the build number that was testedreport_name
(string, optional): textual label for individual reports within build, such as to indicate results from different versions of Pythonreport
(file): JUnit-style XML test report
The build utilities are released under the MIT license.
This package was developed by Jonathan Karr at the Icahn School of Medicine at Mount Sinai in New York, USA.
Please contact the Jonathan Karr with any questions or comments.