ZeroCI is continuous integration dedicated for python projects that generates test summary into xml file and it is integrated with Github and Telegram.
This section is added to talk more about the ZeroCI life cycle and explain how things work internally.
For installation and running ZeroCI, please check it here
There are 3 main steps to hook the RUT and make it run against ZeroCI:
Go to the repository's setting to configure the webhook:
- Add payload URL with providing the server ip and make sure it ends with
/trigger
. - Content type should be
application/json
. - Select when the webhook will trigger the server. (Note:
Just the push event
is the only supported option for now)
-
Add a file called
zeroCI.yaml
to the home of your repository. -
This file contains the project's prerequisites, installation and test scripts:
prequisties
: requirements needed to be installed before starting project installation. (Note:jsx
anddocker
only supported)install
: list of bash commands required to install the project.script
: list of bash commands needed to run the tests (more details).
(Note: RUT location will be in
/opt/code/github/<organization's name>/<repository's name>
)
3- Update ZeroCI config.toml
- Full name of the repository should be added to config.toml.
- Restart the server:
systemctl restart zero_ci
- Go to server ip that has been already added in
config.toml
- Once a commit has been pushed, it will be found with a pending status.
- When the test finishes, the status will be updated.
- Press the result ID to view the result details.
- Please browse to ZeroCI dashboard to view repos cards in which each card contains info about current repo, last build status, etc. (Note: The only current used branch is
development
)
- Once a commit has been pushed to RUT, if you go to the repository commits, you will find a yellow message indicating that some checks haven't been compeleted yet.
- When the tests run finishes, the status will be updated.
- Please press 'Details' link to view result details.
-
If you want to get a message with the build status on telegram chat, please provide the telegram required info in
config.toml
. -
Please press the
Result
button for viewing result details.
-
Black formatting result will appear at the beginning.
-
Then you can see the run results related to the tests added under
script
field in ZeroCI.yaml. -
For more details about every test, please press on the test name. (Note: if the test run didn't generate junit test summary into xml file, the result will appear in log format as running in shell.)
This part is important for getting result in this view
--with-xunit
: to enable the plugin to generate junit test summary into xml file.
--xunit-file
: specify the output file name, in this case MUST be /test.xml
.
--xunit-testsuite-name
: name of testsuite that will appear in the result.
nosetests-3.4 -v testcase.py --with-xunit --xunit-file=/test.xml --xunit-testsuite-name=Simple_nosetest
For more details about the plugin Xunit
--junitxml
: to enable the plugin and specify the output file name, in this case MUST be /test.xml
.
-o junit_suite_name
: name of testsuite that will appear in the result.
pytest -v testcase.py --junitxml=/test.xml -o junit_suite_name=Simple_pytest
For more details about the plugin junitxml
There is an API for adding nightly testsuite, but its page hasn't been added yet.
Using more of jsx tools as soon as there is a stable release.