/zeroCI

Primary LanguageVueApache License 2.0Apache-2.0

Zero Continuous Integration

ZeroCI is continuous integration dedicated for python projects that generates test summary into xml file and it is integrated with Github and Telegram.

ZeroCI life cycle

This section is added to talk more about the ZeroCI life cycle and explain how things work internally.

ZeroCI Installation

For installation and running ZeroCI, please check it here

Github Repository Under Test (RUT) configuration

There are 3 main steps to hook the RUT and make it run against ZeroCI:

1- Configure RUT Webhook

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) webhook

2- Add zeroCI.yaml file to the RUT

  • Add a file called zeroCI.yaml to the home of your repository. zeroci location

  • This file contains the project's prerequisites, installation and test scripts:

    • prequisties: requirements needed to be installed before starting project installation. (Note: jsx and docker 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>) zeroci

3- Update ZeroCI config.toml

  • Full name of the repository should be added to config.toml.
  • Restart the server: systemctl restart zero_ci

Getting the results

1- ZeroCI Dashboard

  • 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. server pending
  • When the test finishes, the status will be updated.
  • Press the result ID to view the result details. server done
  • 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) dashboard

2- Github status

  • 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. github pending
  • When the tests run finishes, the status will be updated. github done
  • Please press 'Details' link to view result details.

3- Telegram group chat

  • If you want to get a message with the build status on telegram chat, please provide the telegram required info in config.toml.

    telegram done

  • Please press the Result button for viewing result details.

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. result details

  • For more details about every test, please press on the test name. more details (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.)

zeroci script configuration

This part is important for getting result in this view

Nosetests

--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.

Example:
nosetests-3.4 -v testcase.py --with-xunit --xunit-file=/test.xml --xunit-testsuite-name=Simple_nosetest

For more details about the plugin Xunit

Pytest

--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.

Example:
pytest -v testcase.py --junitxml=/test.xml -o junit_suite_name=Simple_pytest

For more details about the plugin junitxml

Nightly tests

There is an API for adding nightly testsuite, but its page hasn't been added yet.

Roadmap

Using more of jsx tools as soon as there is a stable release.