This repository has been archived by the owner. It is now read-only.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Runnable click and snap v1 tests:
- bin/click-check-bin-path: snappy bin-path tests
- bin/click-check-content-hub: content-hub hook tests
- bin/click-check-desktop: desktop hook tests
- bin/click-check-framework: click framework tests
- bin/click-check-functional: a few functional tests
- bin/click-check-lint: lint tests
- bin/click-check-online-accounts: online accounts tests
- bin/click-check-push-helper: push-helper tests
- bin/click-check-scope: scope tests
- bin/click-check-security: security hook tests
- bin/click-check-systemd: snappy systemd tests
- bin/click-check-url-dispatcher: url-dispatcher hook tests
- bin/click-run-checks: all tests

Runnable snap v2 tests:
- bin/snap-check-lint: lint tests
- bin/snap-run-checks: all tests

This gives an alternate view on bin/click-run-checks:
- bin/click-review

Running tests locally:
$ PYTHONPATH=$PWD ./bin/click-review /path/to/click

Importable tests:
- clickreviews/ lint tests
- clickreviews/ security hook tests
- clickreviews/ desktop hook tests
- ...

In general, add or modify tests and report by using:
 self._add_result(<type>, <name>, <message>)

Where <type> is one of 'info', 'warn', 'error'. <name> is the name of the
test (prefixed by <review_type>_), which is set when creating a ClickReview
object. After all tests are run, if there are any errors, the exit status is
'2', if there are no errors but some warnings, the exit status is '1',
otherwise it is '0.

See click-check-skeleton and for how to create new tests. In
 * create a click-check-<something> and a cr_<something>.py script based off of
   the skeleton. IMPORTANT: the new script must be click-check-<something> so
   other tools that use click-reviewers-tools (eg, ubuntu-sdk) can find them.
 * modify click-check-<something> to use cr_<something>.py
 * add tests to cr_<something>.py. If you name the tests 'check_<sometest>'
   ClickReview.do_checks() will enumerate and run them automatically

(substitute 'sr_' for 'cr_' for snap v2 checks)

To run tests, just execute:
$ ./run-tests                       # all tests
$ ./run-tests   # only security tests

If you are going to develop the tools regularly, you might want to add a bzr
hook to run the testsuite before committing. Eg, add something like this to

  from bzrlib.branch import Branch

  def run_tests_crt(local, master, old_revno, old_revid, new_revno, new_revid,
                    seven, eight):
      #print local, master, old_revno, old_revid, new_revno, new_revid, seven, eight
      if 'click-reviewers-tools' in master.base:
          import subprocess
          print ''
          rc =['./run-tests'])
          if rc != 0:
              import sys

                                  'click-reviewers-tools tests')

Keeping projects in sync
In addition to archive uploads and SRUs, the following should also be updated:
  then keep an eye on them and when ok, ask someone to push to:
  then keep an eye on them and when ok, ask someone to push to:
- the Ubuntu Store (ping beuno or pindonga to pull the changes from trunk)