Merge pull request #1382 from jwjacobson/1101.feature
Some checks failed
CI / coverage (macos-14, 3.12) (push) Has been cancelled
CI / coverage (ubuntu-22.04, 3.12) (push) Has been cancelled
CI / coverage (ubuntu-22.04, pypy-3.9) (push) Has been cancelled
CI / coverage (windows-2022, 3.12) (push) Has been cancelled
CI / integration (false, macos-14, 3.11) (push) Has been cancelled
CI / integration (false, ubuntu-20.04, 3.11) (push) Has been cancelled
CI / integration (false, windows-2022, 3.11) (push) Has been cancelled
CI / integration (true, ubuntu-20.04, 3.12) (push) Has been cancelled
CI / packaging (macos-14, 3.9) (push) Has been cancelled
CI / packaging (ubuntu-22.04, 3.9) (push) Has been cancelled
CI / packaging (windows-2022, 3.9) (push) Has been cancelled
CI / finish-coverage-report (push) Has been cancelled

1101.feature Add verbose flag to check command
This commit is contained in:
meejah 2024-12-14 02:01:15 -07:00 committed by GitHub
commit 42fdc4a694
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 2 deletions

View File

@ -3,8 +3,8 @@ repos:
hooks: hooks:
- id: "codechecks" - id: "codechecks"
name: "codechecks" name: "codechecks"
stages: ["push"] stages: ["pre-push"]
language: "system" language: "system"
files: ".py$" files: ".py$"
entry: "tox -e codechecks" entry: "tox -e codechecks"
pass_filenames: true pass_filenames: false

View File

@ -0,0 +1 @@
Adding support for --verbose option

View File

@ -445,6 +445,7 @@ class CheckOptions(FileStoreOptions):
("verify", None, "Verify all hashes, instead of merely querying share presence."), ("verify", None, "Verify all hashes, instead of merely querying share presence."),
("repair", None, "Automatically repair any problems found."), ("repair", None, "Automatically repair any problems found."),
("add-lease", None, "Add/renew lease on all shares."), ("add-lease", None, "Add/renew lease on all shares."),
("verbose", None, "Provide verbose output (unimplemented)."),
] ]
def parseArgs(self, *locations): def parseArgs(self, *locations):
self.locations = list(map(argv_to_unicode, locations)) self.locations = list(map(argv_to_unicode, locations))

View File

@ -151,6 +151,18 @@ class Check(GridTestMixin, CLITestMixin, unittest.TestCase):
self.failIf(" corrupt shares:" in lines, out) self.failIf(" corrupt shares:" in lines, out)
d.addCallback(_check5) d.addCallback(_check5)
# Testing verbose option
d.addCallback(lambda ign: self.do_cli("check", "--verbose", self.uri))
def _check6(args):
(rc, out, err) = args
self.assertEqual(len(err), 0, err)
self.failUnlessReallyEqual(rc, 0)
lines = out.splitlines()
self.failUnless("Summary: Healthy" in lines, out)
self.failUnless(" good-shares: 10 (encoding is 3-of-10)" in lines, out)
d.addCallback(_check1)
return d return d
def test_deep_check(self): def test_deep_check(self):