16573: address a few more review comments.
authorWard Vandewege <ward@curii.com>
Mon, 13 Jul 2020 13:25:11 +0000 (09:25 -0400)
committerWard Vandewege <ward@curii.com>
Mon, 13 Jul 2020 13:25:11 +0000 (09:25 -0400)
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

lib/deduplicationreport/report.go
lib/deduplicationreport/report_test.go

index 663e734274b3cbafe1ebe55be9706983270e5b67..8bb3fc4e57bc75a2a337a4e29c048c4056aa1e38 100644 (file)
@@ -81,7 +81,7 @@ Options:
        inputs = deDuplicate(inputs)
 
        if len(inputs) < 1 {
-               logger.Errorf("Error: no collections provided\n")
+               logger.Errorf("Error: no collections provided")
                flags.Usage()
                return 2, inputs
        }
@@ -115,7 +115,7 @@ func report(prog string, args []string, loader *config.Loader, logger *logrus.Lo
        // Arvados Client setup
        arv, err := arvadosclient.MakeArvadosClient()
        if err != nil {
-               logger.Errorf("Error creating Arvados object: %s\n", err)
+               logger.Errorf("Error creating Arvados object: %s", err)
                exitcode = 1
                return
        }
@@ -142,7 +142,7 @@ func report(prog string, args []string, loader *config.Loader, logger *logrus.Lo
                        uuid = input
                }
                if !strings.Contains(uuid, "-4zz18-") {
-                       logger.Errorf("Error: uuid must refer to collection object\n")
+                       logger.Errorf("Error: uuid must refer to collection object")
                        exitcode = 1
                        return
                }
@@ -157,14 +157,14 @@ func report(prog string, args []string, loader *config.Loader, logger *logrus.Lo
                        var collection arvados.Collection
                        err = arv.Get("collections", uuid, nil, &collection)
                        if err != nil {
-                               logger.Errorf("Error: unable to retrieve collection: %s\n", err)
+                               logger.Errorf("Error: unable to retrieve collection: %s", err)
                                exitcode = 1
                                return
                        }
                        blocks[uuid] = make(map[string]int)
                        blocks[uuid] = blockList(collection)
                        if pdh != "" && collection.PortableDataHash != pdh {
-                               logger.Errorf("Error: the collection with UUID %s has PDH %s, but a different PDH was provided in the arguments: %s\n", uuid, collection.PortableDataHash, pdh)
+                               logger.Errorf("Error: the collection with UUID %s has PDH %s, but a different PDH was provided in the arguments: %s", uuid, collection.PortableDataHash, pdh)
                                exitcode = 1
                                return
                        }
index dc760f78ad77cd1b4856c6c01ccb1bbd0ae7b188..a4ed46606c5908d1638b05801904ff407e9b0589 100644 (file)
@@ -40,7 +40,6 @@ func (*Suite) TestTwoIdenticalUUIDs(c *check.C) {
        // Run dedupreport with 2 identical uuids
        exitcode := Command.RunCommand("deduplicationreport.test", []string{arvadostest.FooCollection, arvadostest.FooCollection}, &bytes.Buffer{}, &stdout, &stderr)
        c.Check(exitcode, check.Equals, 0)
-       //c.Check(stdout.String(), check.Equals, "")
        c.Check(stdout.String(), check.Matches, "(?ms).*Collections:[[:space:]]+1.*")
        c.Check(stdout.String(), check.Matches, "(?ms).*Nominal size of stored data:[[:space:]]+3 bytes \\(3 B\\).*")
        c.Check(stdout.String(), check.Matches, "(?ms).*Actual size of stored data:[[:space:]]+3 bytes \\(3 B\\).*")