This file is indexed.

/usr/share/doc/click-reviewers-tools/README is in click-reviewers-tools 0.42.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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/cr_lint.py: lint tests
- clickreviews/cr_security.py: security hook tests
- clickreviews/cr_desktop.py: 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 cr_skeleton.py for how to create new tests. In
short:
 * 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 test_cr_security.py   # 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
~/.bazaar/plugins/hooks/__init__.py:

  #!/usr/bin/python
  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 = subprocess.call(['./run-tests'])
          if rc != 0:
              import sys
              sys.exit(1)

  Branch.hooks.install_named_hook('pre_commit',
                                  run_tests_crt,
                                  'click-reviewers-tools tests')


Keeping projects in sync
------------------------
In addition to archive uploads and SRUs, the following should also be updated:
- https://launchpad.net/~snappy-dev/+archive/ubuntu/tools-proposed
  then keep an eye on them and when ok, ask someone to push to:
  https://launchpad.net/~snappy-dev/+archive/ubuntu/tools
- https://launchpad.net/~ubuntu-sdk-team/+archive/ubuntu/staging
  then keep an eye on them and when ok, ask someone to push to:
  https://launchpad.net/~ubuntu-sdk-team/+archive/ubuntu/ppa
- the Ubuntu Store (ping beuno or pindonga to pull the changes from trunk)