Merge lp:~elopio/snappy/test_go_list into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 580
Merged at revision: 583
Proposed branch: lp:~elopio/snappy/test_go_list
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 61 lines (+48/-4)
2 files modified
_integration-tests/tests/08_test_versions_has_framework (+0/-4)
_integration-tests/tests/latest/list_test.go (+48/-0)
To merge this branch: bzr merge lp:~elopio/snappy/test_go_list
Reviewer Review Type Date Requested Status
Federico Gimenez (community) Approve
Review via email: mp+264794@code.launchpad.net

Commit message

Translated the list integration test to go.

To post a comment you must log in.
Revision history for this message
Federico Gimenez (fgimenez) wrote :

Looks good, thanks!

As a side note, this same functionality is covered in other tests, do you think that this one is worth by itself?

review: Approve
Revision history for this message
Leo Arias (elopio) wrote :

What other test calls snappy list?
We use it go get the current ubuntu-core version, but we are not really checking anything in there.

Revision history for this message
Federico Gimenez (fgimenez) wrote :

Yes, we use the ubuntu-core version in the failover tests and the update test. Anyway, as you point out we are not checking the output as in this test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file '_integration-tests/tests/08_test_versions_has_framework'
2--- _integration-tests/tests/08_test_versions_has_framework 2015-06-15 15:36:29 +0000
3+++ _integration-tests/tests/08_test_versions_has_framework 1970-01-01 00:00:00 +0000
4@@ -1,4 +0,0 @@
5-test() {
6- T="$framework[[:space:]]+[0-9]{4}-[0-9]{2}-[0-9]{2}[[:space:]]+[0-9]+\.[0-9]+"
7- test_regexp "$T" $SNAPPY list
8-}
9
10=== added file '_integration-tests/tests/latest/list_test.go'
11--- _integration-tests/tests/latest/list_test.go 1970-01-01 00:00:00 +0000
12+++ _integration-tests/tests/latest/list_test.go 2015-07-15 06:07:42 +0000
13@@ -0,0 +1,48 @@
14+// -*- Mode: Go; indent-tabs-mode: t -*-
15+
16+/*
17+ * Copyright (C) 2015 Canonical Ltd
18+ *
19+ * This program is free software: you can redistribute it and/or modify
20+ * it under the terms of the GNU General Public License version 3 as
21+ * published by the Free Software Foundation.
22+ *
23+ * This program is distributed in the hope that it will be useful,
24+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
25+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26+ * GNU General Public License for more details.
27+ *
28+ * You should have received a copy of the GNU General Public License
29+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
30+ *
31+ */
32+
33+package latest
34+
35+import (
36+ . "../common"
37+
38+ . "gopkg.in/check.v1"
39+)
40+
41+var _ = Suite(&listSuite{})
42+
43+type listSuite struct {
44+ SnappySuite
45+}
46+
47+func (s *listSuite) TestListMustPrintAppVersion(c *C) {
48+ InstallSnap(c, "hello-world")
49+ s.AddCleanup(func() {
50+ RemoveSnap(c, "hello-world")
51+ })
52+
53+ listOutput := ExecCommand(c, "snappy", "list")
54+ expected := "(?ms)" +
55+ "Name +Date +Version +Developer *\n" +
56+ ".*" +
57+ "^hello-world +.* (\\d+)(\\.\\d+)* +.* +.* *\n" +
58+ ".*"
59+
60+ c.Assert(listOutput, Matches, expected)
61+}

Subscribers

People subscribed via source and target branches