Merge lp:~kyrofa/unity-scope-snappy/improve_debs into lp:~unity-api-team/unity-scope-snappy/trunk

Proposed by Kyle Fazzari on 2015-07-13
Status: Merged
Approved by: Kyle Fazzari on 2015-07-21
Approved revision: 38
Merged at revision: 29
Proposed branch: lp:~kyrofa/unity-scope-snappy/improve_debs
Merge into: lp:~unity-api-team/unity-scope-snappy/trunk
Diff against target: 664 lines (+206/-149)
23 files modified
.bzr-builddeb/default.conf (+2/-0)
Makefile (+63/-0)
README (+10/-5)
data/com.canonical.applications.WebdmPackageManager.service.in (+3/-0)
debian/changelog (+7/-3)
debian/control (+15/-1)
debian/copyright (+19/-51)
debian/rules (+15/-5)
debian/source/format (+0/-1)
debian/unity-scope-snappy-daemon.install (+4/-0)
debian/unity-scope-snappy.install (+5/-0)
internal/github.com/godbus/dbus/conn.go (+19/-10)
internal/github.com/godbus/dbus/export.go (+2/-20)
package-management-daemon/main.go (+3/-3)
store/main.go (+3/-3)
store/scope/scope.go (+3/-3)
store/snappy-store.ini (+2/-1)
test/store/test_departments.py (+2/-2)
test/store/test_surface.py (+3/-3)
test_all.sh (+0/-17)
test_coverage.sh (+25/-15)
test_integration.sh (+0/-5)
webdm/client.go (+1/-1)
To merge this branch: bzr merge lp:~kyrofa/unity-scope-snappy/improve_debs
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-07-16
dobey (community) 2015-07-15 Approve on 2015-07-15
Xavi Garcia 2015-07-13 Pending
Unity API Team 2015-07-13 Pending
Review via email: mp+264640@code.launchpad.net

Commit Message

Split the DBus daemon and scope into two separate .debs.

Description of the Change

Split the DBus daemon and scope into two separate .debs.

The scope is multiarch, the daemon is not. The daemon is setup to run via DBus activation.

Note that this MR also includes a patch applied to the vendored godbus, required for the dbus activation. The patch is awaiting upstream approval.

To post a comment you must log in.
dobey (dobey) wrote :

I don't like the ini/service file creation being the way they are, and I think the fact that it works is probably a bug in process-cpp. But otherwise looks ok.

review: Approve
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
Approved revid is not set in launchpad. This is most likely a launchpad issue and re-approve should fix it. There is also a chance (although a very small one) this is a permission problem of the ps-jenkins bot.
http://jenkins.qa.ubuntu.com/job/unity-scope-snappy-autolanding/20/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-snappy-wily-amd64-autolanding/20
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-snappy-wily-armhf-autolanding/20
        deb: http://jenkins.qa.ubuntu.com/job/unity-scope-snappy-wily-armhf-autolanding/20/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-snappy-wily-i386-autolanding/20

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.bzr-builddeb'
2=== added file '.bzr-builddeb/default.conf'
3--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
4+++ .bzr-builddeb/default.conf 2015-07-21 17:40:10 +0000
5@@ -0,0 +1,2 @@
6+[BUILDDEB]
7+split = True
8
9=== added file 'Makefile'
10--- Makefile 1970-01-01 00:00:00 +0000
11+++ Makefile 2015-07-21 17:40:10 +0000
12@@ -0,0 +1,63 @@
13+# Go parameters
14+GOCMD=go
15+GOINSTALL=$(GOCMD) install
16+GOTEST=$(GOCMD) test
17+GOFMT=gofmt -w
18+
19+TOP_PACKAGE := launchpad.net/unity-scope-snappy
20+EXECUTABLES := store package-management-daemon
21+PACKAGES_TO_TEST := package-management-daemon/daemon \
22+ store/actions \
23+ store/packages \
24+ store/packages/fakes \
25+ store/previews \
26+ store/previews/humanize \
27+ store/previews/fakes \
28+ store/previews/packages \
29+ store/previews/packages/templates \
30+ store/utilities \
31+ webdm
32+
33+ALL_LIST = $(EXECUTABLES) $(PACKAGES_TO_TEST)
34+
35+ABSOLUTE_PACKAGES_TO_TEST = $(foreach item, $(PACKAGES_TO_TEST), $(TOP_PACKAGE)/$(item))
36+
37+INSTALL_LIST = $(foreach item, $(EXECUTABLES), $(item)_install)
38+TEST_LIST = $(foreach item, $(PACKAGES_TO_TEST), $(item)_test)
39+FMT_LIST = $(foreach item, $(ALL_LIST), $(item)_fmt)
40+
41+.PHONY: $(INSTALL_LIST) $(TEST_LIST) $(FMT_LIST)
42+
43+all: install
44+install: $(INSTALL_LIST)
45+check: test
46+test: go_tests integration_tests
47+go_tests: $(TEST_LIST)
48+fmt: $(FMT_LIST)
49+
50+.PHONY: coverage
51+coverage:
52+ ./test_coverage.sh $(ABSOLUTE_PACKAGES_TO_TEST)
53+
54+.PHONY: coverage.html
55+coverage.html:
56+ ./test_coverage.sh -t html $(ABSOLUTE_PACKAGES_TO_TEST)
57+
58+.PHONY: coverage.xml
59+coverage.xml:
60+ ./test_coverage.sh -t xml $(ABSOLUTE_PACKAGES_TO_TEST)
61+
62+.PHONY: integration_tests
63+integration_tests: install
64+ python3 -m unittest discover -s test
65+
66+$(BUILD_LIST): %_build: %_fmt
67+ $(GOBUILD) $(TOP_PACKAGE)/$*
68+$(CLEAN_LIST): %_clean:
69+ $(GOCLEAN) $(TOP_PACKAGE)/$*
70+$(INSTALL_LIST): %_install:
71+ $(GOINSTALL) $(TOP_PACKAGE)/$*
72+$(TEST_LIST): %_test:
73+ $(GOTEST) $(TOP_PACKAGE)/$*
74+$(FMT_LIST): %_fmt:
75+ $(GOFMT) ./$*
76
77=== modified file 'README'
78--- README 2015-07-08 14:22:02 +0000
79+++ README 2015-07-21 17:40:10 +0000
80@@ -24,24 +24,29 @@
81
82 Setup up your GOPATH and then install the Snappy Scope:
83
84- $ go get launchpad.net/unity-scope-snappy
85+ $ go get launchpad.net/unity-scope-snappy/store
86+
87+
88+Also install the package management dbus daemon:
89+
90+ $ go get launchpad.net/unity-scope-snappy/package-management-daemon
91
92
93 Now run the package management dbus daemon (required for installing/uninstalling
94 packages):
95
96- $ $GOPATH/bin/progress-daemon
97+ $ $GOPATH/bin/package-management-daemon
98
99
100 Finally, run the scope itself:
101
102- $ unity-scope-tool $GOPATH/src/launchpad.net/unity-scope-snappy/scope.ini
103+ $ unity-scope-tool $GOPATH/src/launchpad.net/unity-scope-snappy/store/snappy-store.ini
104
105 Note that the information shown in the scope is retrieved from WebDM. By default
106-the scope will use "http://webdm.local:4200", but you can change that with the
107+the scope will use "http://localhost:4200", but you can change that with the
108 WEBDM_URL environment variable:
109
110- $ WEBDM_URL=http://address:port unity-scope-tool $GOPATH/src/launchpad.net/unity-scope-snappy/scope.ini
111+ $ WEBDM_URL=http://address:port unity-scope-tool $GOPATH/src/launchpad.net/unity-scope-snappy/store/snappy-store.ini
112
113
114 External Dependencies
115
116=== added directory 'data'
117=== added file 'data/com.canonical.applications.WebdmPackageManager.service.in'
118--- data/com.canonical.applications.WebdmPackageManager.service.in 1970-01-01 00:00:00 +0000
119+++ data/com.canonical.applications.WebdmPackageManager.service.in 2015-07-21 17:40:10 +0000
120@@ -0,0 +1,3 @@
121+[D-BUS Service]
122+Name=com.canonical.applications.WebdmPackageManager
123+Exec=/usr/lib/@DEB_HOST_MULTIARCH@/unity-scope-snappy/package-management-daemon
124
125=== added file 'data/snappy-store.png'
126Binary files data/snappy-store.png 1970-01-01 00:00:00 +0000 and data/snappy-store.png 2015-07-21 17:40:10 +0000 differ
127=== modified file 'debian/changelog'
128--- debian/changelog 2015-06-01 18:54:10 +0000
129+++ debian/changelog 2015-07-21 17:40:10 +0000
130@@ -1,6 +1,10 @@
131-unity-scope-snappy (0.1) UNRELEASED; urgency=medium
132+unity-scope-snappy (0.1.0-0ubuntu1) UNRELEASED; urgency=medium
133
134 [ Kyle Fazzari ]
135- * Initial release
136+ * Initial release:
137+ - DBus daemon for installing/uninstalling packages via the WebDM API and
138+ providing feedback.
139+ - Scope can install/uninstall packages via DBus daemon and display progress.
140+ - Scope shows all preview details provided by WebDM.
141
142- -- Kyle Fazzari <kyle@canonical.com> Thu, 21 May 2015 10:05:52 -0400
143+ -- Kyle Fazzari <kyle@canonical.com> Thu, 16 Jul 2015 09:26:39 -0400
144
145=== modified file 'debian/control'
146--- debian/control 2015-07-06 19:26:07 +0000
147+++ debian/control 2015-07-21 17:40:10 +0000
148@@ -4,6 +4,7 @@
149 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
150 Build-Depends: dbus-test-runner,
151 debhelper (>= 9),
152+ dh-exec (>=0.3),
153 dh-golang,
154 golang-go,
155 golang-go.tools,
156@@ -19,11 +20,24 @@
157
158 Package: unity-scope-snappy
159 Architecture: any
160+Multi-Arch: same
161 Depends: ${misc:Depends},
162 ${shlibs:Depends},
163+ unity-scope-snappy-daemon (= ${binary:Version}),
164 Built-Using: ${misc:Built-Using}
165-Description: Install and launch snap packages
166+Description: Install and launch snap packages.
167 This scope gets the list of available snap packages from the Ubuntu Store, and
168 lets the user see the details of each application or scope before installing.
169 The details include screenshots, rating and reviews. It can also be used to
170 launch installed applications.
171+
172+Package: unity-scope-snappy-daemon
173+Architecture: any
174+Multi-Arch: foreign
175+Depends: ${misc:Depends},
176+ ${shlibs:Depends},
177+Built-Using: ${misc:Built-Using}
178+Description: Manage the installation and uninstallation of snaps via DBus.
179+ This DBus service exposes an interface to install and uninstall snap packages,
180+ providing feedback signals during the operation that can be used to determine
181+ progress.
182
183=== modified file 'debian/copyright'
184--- debian/copyright 2015-06-12 17:47:42 +0000
185+++ debian/copyright 2015-07-21 17:40:10 +0000
186@@ -21,65 +21,14 @@
187 Files: internal/github.com/AlekSi/gocov-xml/*
188 Copyright: 2013 Alexey Palazhchenko
189 License: MIT
190- Permission is hereby granted, free of charge, to any person obtaining a copy of
191- this software and associated documentation files (the "Software"), to deal in
192- the Software without restriction, including without limitation the rights to
193- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
194- of the Software, and to permit persons to whom the Software is furnished to do
195- so, subject to the following conditions:
196- .
197- The above copyright notice and this permission notice shall be included in all
198- copies or substantial portions of the Software.
199- .
200- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
201- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
202- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
203- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
204- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
205- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
206- SOFTWARE.
207
208 Files: internal/github.com/axw/gocov/*
209 Copyright: 2012 The Gocov Authors
210 License: MIT
211- Permission is hereby granted, free of charge, to any person obtaining a copy of
212- this software and associated documentation files (the "Software"), to deal in
213- the Software without restriction, including without limitation the rights to
214- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
215- of the Software, and to permit persons to whom the Software is furnished to do
216- so, subject to the following conditions:
217- .
218- The above copyright notice and this permission notice shall be included in all
219- copies or substantial portions of the Software.
220- .
221- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
222- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
223- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
224- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
225- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
226- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
227- SOFTWARE.
228
229 Files: internal/github.com/dustin/go-humanize/*
230 Copyright: 2005-2008 Dustin Sallings <dustin@spy.net>
231 License: MIT
232- Permission is hereby granted, free of charge, to any person obtaining a copy of
233- this software and associated documentation files (the "Software"), to deal in
234- the Software without restriction, including without limitation the rights to
235- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
236- of the Software, and to permit persons to whom the Software is furnished to do
237- so, subject to the following conditions:
238- .
239- The above copyright notice and this permission notice shall be included in all
240- copies or substantial portions of the Software.
241- .
242- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
243- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
244- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
245- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
246- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
247- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
248- SOFTWARE.
249
250 Files: internal/github.com/godbus/dbus/*
251 Copyright: 2013 Georg Reinke
252@@ -148,3 +97,22 @@
253 .
254 The full text of the LGPL v3 is distributed in
255 /usr/share/common-licenses/LGPL-3 on Debian systems.
256+
257+License: MIT
258+ Permission is hereby granted, free of charge, to any person obtaining a copy of
259+ this software and associated documentation files (the "Software"), to deal in
260+ the Software without restriction, including without limitation the rights to
261+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
262+ of the Software, and to permit persons to whom the Software is furnished to do
263+ so, subject to the following conditions:
264+ .
265+ The above copyright notice and this permission notice shall be included in all
266+ copies or substantial portions of the Software.
267+ .
268+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
269+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
270+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
271+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
272+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
273+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
274+ SOFTWARE.
275
276=== modified file 'debian/rules' (properties changed: -x to +x)
277--- debian/rules 2015-07-08 15:24:58 +0000
278+++ debian/rules 2015-07-21 17:40:10 +0000
279@@ -7,12 +7,22 @@
280
281 # Setup the paths so we can run gocov and gocov-xml.
282 export GOPATH := $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
283-export PATH := ${GOPATH}/bin:${PATH}
284+export PATH := $(GOPATH)/bin:$(PATH)
285+
286+STORE_FILE_PATH := /usr/lib/$(DEB_HOST_MULTIARCH)/unity-scopes/snappy-store/store
287
288 %:
289 dh $@ --buildsystem=golang --with=golang
290
291-# Run the tests and also produce a Cobertura-compatible
292-# coverage report.
293-override_dh_auto_test:
294- dbus-test-runner -m 600 -t $(CURDIR)/test_all.sh -p xml
295\ No newline at end of file
296+# Run the tests and produce a Cobertura-compatible coverage report.
297+override_dh_auto_test: debian/snappy-store.ini debian/com.canonical.applications.WebdmPackageManager.service
298+ dbus-test-runner -m 600 -t make -p integration_tests
299+ dbus-test-runner -m 600 -t make -p coverage.xml
300+
301+# Rewrite any *.in files to be compatible with multiarch.
302+debian/%: data/%.in
303+ sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
304+
305+# Rewrite the scope.ini file to point to the multiarch location.
306+debian/snappy-store.ini: store/snappy-store.ini
307+ sed 's|ScopeRunner.*|ScopeRunner = $(STORE_FILE_PATH) --runtime %R --scope %S|g' $< > $@
308
309=== added directory 'debian/source'
310=== removed directory 'debian/source'
311=== added file 'debian/source/format'
312--- debian/source/format 1970-01-01 00:00:00 +0000
313+++ debian/source/format 2015-07-21 17:40:10 +0000
314@@ -0,0 +1,1 @@
315+3.0 (quilt)
316
317=== removed file 'debian/source/format'
318--- debian/source/format 2015-06-01 18:54:10 +0000
319+++ debian/source/format 1970-01-01 00:00:00 +0000
320@@ -1,1 +0,0 @@
321-3.0 (native)
322
323=== added file 'debian/unity-scope-snappy-daemon.install'
324--- debian/unity-scope-snappy-daemon.install 1970-01-01 00:00:00 +0000
325+++ debian/unity-scope-snappy-daemon.install 2015-07-21 17:40:10 +0000
326@@ -0,0 +1,4 @@
327+#!/usr/bin/dh-exec
328+
329+usr/bin/package-management-daemon usr/lib/${DEB_HOST_MULTIARCH}/unity-scope-snappy/
330+debian/com.canonical.applications.WebdmPackageManager.service usr/share/dbus-1/services/
331
332=== added file 'debian/unity-scope-snappy.install'
333--- debian/unity-scope-snappy.install 1970-01-01 00:00:00 +0000
334+++ debian/unity-scope-snappy.install 2015-07-21 17:40:10 +0000
335@@ -0,0 +1,5 @@
336+#!/usr/bin/dh-exec
337+
338+usr/bin/store usr/lib/${DEB_HOST_MULTIARCH}/unity-scopes/snappy-store/
339+debian/snappy-store.ini usr/lib/${DEB_HOST_MULTIARCH}/unity-scopes/snappy-store/
340+data/snappy-store.png usr/share/unity/scopes/snappy-store/
341
342=== modified file 'internal/github.com/godbus/dbus/conn.go'
343--- internal/github.com/godbus/dbus/conn.go 2015-06-12 17:47:42 +0000
344+++ internal/github.com/godbus/dbus/conn.go 2015-07-21 17:40:10 +0000
345@@ -303,18 +303,27 @@
346 // as per http://dbus.freedesktop.org/doc/dbus-specification.html ,
347 // sender is optional for signals.
348 sender, _ := msg.Headers[FieldSender].value.(string)
349- if iface == "org.freedesktop.DBus" && member == "NameLost" &&
350- sender == "org.freedesktop.DBus" {
351-
352- name, _ := msg.Body[0].(string)
353- conn.namesLck.Lock()
354- for i, v := range conn.names {
355- if v == name {
356- copy(conn.names[i:], conn.names[i+1:])
357- conn.names = conn.names[:len(conn.names)-1]
358+ if iface == "org.freedesktop.DBus" && sender == "org.freedesktop.DBus" {
359+ if member == "NameLost" {
360+ // If we lost the name on the bus, remove it from our
361+ // tracking list.
362+ name, _ := msg.Body[0].(string)
363+ conn.namesLck.Lock()
364+ for i, v := range conn.names {
365+ if v == name {
366+ conn.names = append(conn.names[:i],
367+ conn.names[i+1:]...)
368+ }
369 }
370+ conn.namesLck.Unlock()
371+ } else if member == "NameAcquired" {
372+ // If we acquired the name on the bus, add it to our
373+ // tracking list.
374+ name, _ := msg.Body[0].(string)
375+ conn.namesLck.Lock()
376+ conn.names = append(conn.names, name)
377+ conn.namesLck.Unlock()
378 }
379- conn.namesLck.Unlock()
380 }
381 signal := &Signal{
382 Sender: sender,
383
384=== modified file 'internal/github.com/godbus/dbus/export.go'
385--- internal/github.com/godbus/dbus/export.go 2015-06-12 17:47:42 +0000
386+++ internal/github.com/godbus/dbus/export.go 2015-07-21 17:40:10 +0000
387@@ -235,41 +235,23 @@
388 return nil
389 }
390
391-// ReleaseName calls org.freedesktop.DBus.ReleaseName. You should use only this
392-// method to release a name (see below).
393+// ReleaseName calls org.freedesktop.DBus.ReleaseName and awaits a response.
394 func (conn *Conn) ReleaseName(name string) (ReleaseNameReply, error) {
395 var r uint32
396 err := conn.busObj.Call("org.freedesktop.DBus.ReleaseName", 0, name).Store(&r)
397 if err != nil {
398 return 0, err
399 }
400- if r == uint32(ReleaseNameReplyReleased) {
401- conn.namesLck.Lock()
402- for i, v := range conn.names {
403- if v == name {
404- copy(conn.names[i:], conn.names[i+1:])
405- conn.names = conn.names[:len(conn.names)-1]
406- }
407- }
408- conn.namesLck.Unlock()
409- }
410 return ReleaseNameReply(r), nil
411 }
412
413-// RequestName calls org.freedesktop.DBus.RequestName. You should use only this
414-// method to request a name because package dbus needs to keep track of all
415-// names that the connection has.
416+// RequestName calls org.freedesktop.DBus.RequestName and awaits a response.
417 func (conn *Conn) RequestName(name string, flags RequestNameFlags) (RequestNameReply, error) {
418 var r uint32
419 err := conn.busObj.Call("org.freedesktop.DBus.RequestName", 0, name, flags).Store(&r)
420 if err != nil {
421 return 0, err
422 }
423- if r == uint32(RequestNameReplyPrimaryOwner) {
424- conn.namesLck.Lock()
425- conn.names = append(conn.names, name)
426- conn.namesLck.Unlock()
427- }
428 return RequestNameReply(r), nil
429 }
430
431
432=== renamed directory 'progress-daemon' => 'package-management-daemon'
433=== modified file 'package-management-daemon/main.go'
434--- progress-daemon/main.go 2015-07-02 18:46:10 +0000
435+++ package-management-daemon/main.go 2015-07-21 17:40:10 +0000
436@@ -2,11 +2,11 @@
437
438 import (
439 "flag"
440+ "launchpad.net/unity-scope-snappy/package-management-daemon/daemon"
441+ "log"
442 "os"
443 "os/signal"
444 "syscall"
445- "launchpad.net/unity-scope-snappy/progress-daemon/daemon"
446- "log"
447 )
448
449 // main is the entry point of the daemon
450@@ -29,7 +29,7 @@
451
452 err = daemon.Run()
453 if err != nil {
454- log.Printf("progress-daemon: Error running daemon: %s", err)
455+ log.Printf("package-management-daemon: Error running daemon: %s", err)
456 }
457
458 <-signals // Block here so the daemon can run, exiting if a signal comes in.
459
460=== renamed file 'main.go' => 'store/main.go'
461--- main.go 2015-06-26 17:22:58 +0000
462+++ store/main.go 2015-07-21 17:40:10 +0000
463@@ -1,10 +1,10 @@
464 package main
465
466 import (
467- "os"
468 "launchpad.net/unity-scope-snappy/internal/launchpad.net/go-unityscopes/v2"
469- "launchpad.net/unity-scope-snappy/store"
470+ "launchpad.net/unity-scope-snappy/store/scope"
471 "log"
472+ "os"
473 )
474
475 // main is the entry point of the scope.
476@@ -12,7 +12,7 @@
477 // Supported environment variables:
478 // - WEBDM_URL: address[:port] on which WebDM is listening
479 func main() {
480- scope, err := store.NewScope(os.Getenv("WEBDM_URL"))
481+ scope, err := scope.New(os.Getenv("WEBDM_URL"))
482 if err != nil {
483 log.Printf("unity-scope-snappy: Unable to create scope: %s", err)
484 return
485
486=== added directory 'store/scope'
487=== renamed file 'store/scope.go' => 'store/scope/scope.go'
488--- store/scope.go 2015-06-30 19:31:01 +0000
489+++ store/scope/scope.go 2015-07-21 17:40:10 +0000
490@@ -1,4 +1,4 @@
491-package store
492+package scope
493
494 import (
495 "fmt"
496@@ -33,7 +33,7 @@
497 dbusClient *packages.DbusManagerClient
498 }
499
500-// NewScope creates a new Scope using a specific WebDM API URL.
501+// New creates a new Scope using a specific WebDM API URL.
502 //
503 // Parameters:
504 // webdmApiUrl: URL where WebDM is listening.
505@@ -41,7 +41,7 @@
506 // Returns:
507 // - Pointer to scope (nil if error).
508 // - Error (nil if none).
509-func NewScope(webdmApiUrl string) (*Scope, error) {
510+func New(webdmApiUrl string) (*Scope, error) {
511 scope := new(Scope)
512 var err error
513 scope.webdmClient, err = webdm.NewClient(webdmApiUrl)
514
515=== renamed file 'scope.ini' => 'store/snappy-store.ini'
516--- scope.ini 2015-06-23 15:22:15 +0000
517+++ store/snappy-store.ini 2015-07-21 17:40:10 +0000
518@@ -2,4 +2,5 @@
519 DisplayName = Snappy Scope
520 Description = A scope for the snappy store
521 Author = Canonical
522-ScopeRunner = $GOPATH/bin/unity-scope-snappy --runtime %R --scope %S
523+Icon = /usr/share/unity/scopes/snappy-store/snappy-store.png
524+ScopeRunner = $GOPATH/bin/store --runtime %R --scope %S
525
526=== modified file 'test/store/test_departments.py'
527--- test/store/test_departments.py 2015-07-06 19:51:54 +0000
528+++ test/store/test_departments.py 2015-07-21 17:40:10 +0000
529@@ -29,10 +29,10 @@
530 os.environ["WEBDM_URL"] = server.url
531
532 self.harness = ScopeHarness.new_from_scope_list(Parameters([
533- "{}/../../scope.ini".format(os.path.dirname(os.path.realpath(__file__)))
534+ "{}/../../store/snappy-store.ini".format(os.path.dirname(os.path.realpath(__file__)))
535 ]))
536 self.view = self.harness.results_view
537- self.view.active_scope = "scope"
538+ self.view.active_scope = "snappy-store"
539 self.view.search_query = ""
540
541 def testStoreDepartment(self):
542
543=== modified file 'test/store/test_surface.py'
544--- test/store/test_surface.py 2015-07-06 19:26:07 +0000
545+++ test/store/test_surface.py 2015-07-21 17:40:10 +0000
546@@ -32,16 +32,16 @@
547 os.environ["WEBDM_URL"] = server.url
548
549 self.harness = ScopeHarness.new_from_scope_list(Parameters([
550- "{}/../../scope.ini".format(os.path.dirname(os.path.realpath(__file__)))
551+ "{}/../../store/snappy-store.ini".format(os.path.dirname(os.path.realpath(__file__)))
552 ]))
553 self.view = self.harness.results_view
554- self.view.active_scope = "scope"
555+ self.view.active_scope = "snappy-store"
556 self.view.search_query = ""
557
558 def testScopeProperties(self):
559 """Test the scope properties from the .ini file"""
560
561- self.assertEqual(self.view.scope_id, "scope")
562+ self.assertEqual(self.view.scope_id, "snappy-store")
563 self.assertEqual(self.view.display_name, "Snappy Scope")
564 self.assertEqual(self.view.description, "A scope for the snappy store")
565
566
567=== removed file 'test_all.sh'
568--- test_all.sh 2015-07-06 19:26:07 +0000
569+++ test_all.sh 1970-01-01 00:00:00 +0000
570@@ -1,17 +0,0 @@
571-#!/bin/bash
572-
573-directory=$(dirname $0)
574-
575-# Run golang tests
576-"$directory/test_coverage.sh" $@
577-returnValue=$?
578-if [ $returnValue -ne 0 ]; then
579- exit $returnValue # Tests failed, so this script should also fail
580-fi
581-
582-# Run Python integration tests
583-"$directory/test_integration.sh"
584-returnValue=$?
585-if [ $returnValue -ne 0 ]; then
586- exit $returnValue # Tests failed, so this script should also fail
587-fi
588
589=== modified file 'test_coverage.sh'
590--- test_coverage.sh 2015-06-30 18:32:04 +0000
591+++ test_coverage.sh 2015-07-21 17:40:10 +0000
592@@ -39,24 +39,34 @@
593 done
594 }
595
596+coverage_type=""
597+
598+while getopts ":t:" opt; do
599+ case $opt in
600+ t)
601+ coverage_type=$OPTARG
602+ ;;
603+ \?)
604+ echo "Invalid option: -$OPTARG" >&2
605+ ;;
606+ :)
607+ echo "Option -$OPTARG requires an argument." >&2
608+ exit 1
609+ ;;
610+ esac
611+done
612+
613+shift $((OPTIND-1))
614+
615 # Setup final coverage file
616 echo "mode: set" > $coverage_final
617
618-get_coverages $coverage_final \
619- "launchpad.net/unity-scope-snappy/progress-daemon/daemon" \
620- "launchpad.net/unity-scope-snappy/store/actions" \
621- "launchpad.net/unity-scope-snappy/store/packages" \
622- "launchpad.net/unity-scope-snappy/store/packages/fakes" \
623- "launchpad.net/unity-scope-snappy/store/previews" \
624- "launchpad.net/unity-scope-snappy/store/previews/humanize" \
625- "launchpad.net/unity-scope-snappy/store/previews/fakes" \
626- "launchpad.net/unity-scope-snappy/store/previews/packages" \
627- "launchpad.net/unity-scope-snappy/store/previews/packages/templates" \
628- "launchpad.net/unity-scope-snappy/store/utilities" \
629- "launchpad.net/unity-scope-snappy/webdm"
630-
631-if [ "$1" == "xml" ]; then
632+get_coverages $coverage_final $@
633+
634+echo "Cov type: $coverage_type"
635+
636+if [ "$coverage_type" == "xml" ]; then
637 gocov convert $coverage_final | gocov-xml > coverage.xml
638-elif [ "$1" == "html" ]; then
639+elif [ "$coverage_type" == "html" ]; then
640 go tool cover -html=$coverage_final
641 fi
642
643=== removed file 'test_integration.sh'
644--- test_integration.sh 2015-07-06 19:26:07 +0000
645+++ test_integration.sh 1970-01-01 00:00:00 +0000
646@@ -1,5 +0,0 @@
647-#!/bin/bash
648-
649-directory=$(dirname $0)
650-
651-python3 -m unittest discover -s $directory/test
652
653=== modified file 'webdm/client.go'
654--- webdm/client.go 2015-06-15 18:29:14 +0000
655+++ webdm/client.go 2015-07-21 17:40:10 +0000
656@@ -10,7 +10,7 @@
657
658 const (
659 // Where webdm is listening
660- DefaultApiUrl = "http://webdm.local:4200"
661+ DefaultApiUrl = "http://localhost:4200"
662
663 // User-agent to use when communicating with webdm API
664 defaultUserAgent = "unity-scope-snappy"

Subscribers

People subscribed via source and target branches