Merge lp:~pedronis/ubuntu-push/be-nice into lp:ubuntu-push/automatic

Proposed by Samuele Pedroni
Status: Merged
Approved by: Samuele Pedroni
Approved revision: 103
Merged at revision: 100
Proposed branch: lp:~pedronis/ubuntu-push/be-nice
Merge into: lp:ubuntu-push/automatic
Diff against target: 169 lines (+42/-18)
8 files modified
.bzrignore (+1/-0)
Makefile (+21/-6)
README (+11/-3)
client/client_test.go (+1/-1)
client/session/session_test.go (+1/-1)
sampleconfigs/dev.json (+3/-3)
server/acceptance/suites/helpers.go (+2/-2)
server/acceptance/suites/suite.go (+2/-2)
To merge this branch: bzr merge lp:~pedronis/ubuntu-push/be-nice
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+213512@code.launchpad.net

Commit message

update README, Makefile with more targets, move sample dev config to sampleconfigs

Description of the change

update README, Makefile with more targets, move sample dev config to sampleconfigs

To post a comment you must log in.
lp:~pedronis/ubuntu-push/be-nice updated
101. By Samuele Pedroni

newline

102. By Samuele Pedroni

api port => 8080

Revision history for this message
John Lenton (chipaca) :
review: Approve
lp:~pedronis/ubuntu-push/be-nice updated
103. By Samuele Pedroni

final tweaks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2014-03-28 14:20:23 +0000
3+++ .bzrignore 2014-03-31 17:58:02 +0000
4@@ -12,3 +12,4 @@
5 debian/*.EX
6 debian/*.substvars
7 ubuntu-push-client
8+push-server-dev
9
10=== modified file 'Makefile'
11--- Makefile 2014-03-12 13:23:26 +0000
12+++ Makefile 2014-03-31 17:58:02 +0000
13@@ -12,6 +12,8 @@
14 GODEPS += launchpad.net/go-xdg/v0
15 GODEPS += code.google.com/p/gosqlite/sqlite3
16
17+TOTEST = $(shell env GOPATH=$(GOPATH) go list $(PROJECT)/...|grep -v acceptance|grep -v http13client )
18+
19 bootstrap:
20 mkdir -p $(GOPATH)/bin
21 mkdir -p $(GOPATH)/pkg
22@@ -21,17 +23,29 @@
23 go install $(GODEPS)
24
25 check:
26- go test $(TESTFLAGS) $(PROJECT)/...
27+ go test $(TESTFLAGS) $(TOTEST)
28
29 check-race:
30- go test $(TESTFLAGS) -race $(PROJECT)/...
31+ go test $(TESTFLAGS) -race $(TOTEST)
32+
33+acceptance:
34+ cd server/acceptance; ./acceptance.sh
35+
36+build-client:
37+ go build ubuntu-push-client.go
38+
39+build-server-dev:
40+ go build -o push-server-dev launchpad.net/ubuntu-push/server/dev
41+
42+run-server-dev:
43+ go run server/dev/*.go sampleconfigs/dev.json
44
45 coverage-summary:
46- go test $(TESTFLAGS) -a -cover $(PROJECT)/...
47+ go test $(TESTFLAGS) -a -cover $(TOTEST)
48
49 coverage-html:
50 mkdir -p coverhtml
51- for pkg in $$(go list $(PROJECT)/...|grep -v acceptance ); do \
52+ for pkg in $(TOTEST); do \
53 relname="$${pkg#$(PROJECT)/}" ; \
54 mkdir -p coverhtml/$$(dirname $${relname}) ; \
55 go test $(TESTFLAGS) -a -coverprofile=coverhtml/$${relname}.out $$pkg ; \
56@@ -52,5 +66,6 @@
57 # requires graphviz installed
58 dot -Tsvg $< > $@
59
60-.PHONY: bootstrap check check-race format check-format coverage-summary \
61- coverage-html protocol-diagrams
62+.PHONY: bootstrap check check-race format check-format \
63+ acceptance build-client build server-dev run-server-dev \
64+ coverage-summary coverage-html protocol-diagrams
65
66=== modified file 'README'
67--- README 2014-02-21 16:17:28 +0000
68+++ README 2014-03-31 17:58:02 +0000
69@@ -15,8 +15,7 @@
70 make check
71
72 To produce coverage reports you need Go 1.2 (default on Trusty) and
73-the cover tool (the latter can be obtained atm with something like:
74-sudo GOPATH=<go-workspace> go get code.google.com/p/go.tools/cmd/cover ),
75+the cover tool (in the golang-go.tools package),
76 then run:
77
78 make coverage-summary
79@@ -31,4 +30,13 @@
80
81 To run the acceptance tests, change to the acceptance subdir and run:
82
83- ./acceptance.sh
84+ make acceptance
85+
86+There are build targets to build the client:
87+
88+ make build-client
89+
90+building ubuntu-push-client, and to run the development server:
91+
92+ make run-server-dev
93+
94
95=== modified file 'client/client_test.go'
96--- client/client_test.go 2014-03-31 14:08:43 +0000
97+++ client/client_test.go 2014-03-31 17:58:02 +0000
98@@ -88,7 +88,7 @@
99 }
100
101 func (cs *clientSuite) writeTestConfig(overrides map[string]interface{}) {
102- pem_file := helpers.SourceRelative("../server/acceptance/config/testing.cert")
103+ pem_file := helpers.SourceRelative("../server/acceptance/ssl/testing.cert")
104 cfgMap := map[string]interface{}{
105 "connect_timeout": "7ms",
106 "exchange_timeout": "10ms",
107
108=== modified file 'client/session/session_test.go'
109--- client/session/session_test.go 2014-03-31 13:54:48 +0000
110+++ client/session/session_test.go 2014-03-31 17:58:02 +0000
111@@ -225,7 +225,7 @@
112 c.Check(sess.getHost, NotNil)
113 }
114
115-var certfile string = helpers.SourceRelative("../../server/acceptance/config/testing.cert")
116+var certfile string = helpers.SourceRelative("../../server/acceptance/ssl/testing.cert")
117 var pem, _ = ioutil.ReadFile(certfile)
118
119 func (cs *clientSessionSuite) TestNewSessionPEMWorks(c *C) {
120
121=== added directory 'sampleconfigs'
122=== renamed file 'server/acceptance/config/config.json' => 'sampleconfigs/dev.json'
123--- server/acceptance/config/config.json 2014-01-17 17:20:34 +0000
124+++ sampleconfigs/dev.json 2014-03-31 17:58:02 +0000
125@@ -4,9 +4,9 @@
126 "broker_queue_size": 10000,
127 "session_queue_size": 10,
128 "addr": "127.0.0.1:9090",
129- "key_pem_file": "testing.key",
130- "cert_pem_file": "testing.cert",
131- "http_addr": "127.0.0.1:8888",
132+ "key_pem_file": "../server/acceptance/ssl/testing.key",
133+ "cert_pem_file": "../server/acceptance/ssl/testing.cert",
134+ "http_addr": "127.0.0.1:8080",
135 "http_read_timeout": "5s",
136 "http_write_timeout": "5s"
137 }
138
139=== renamed directory 'server/acceptance/config' => 'server/acceptance/ssl'
140=== modified file 'server/acceptance/suites/helpers.go'
141--- server/acceptance/suites/helpers.go 2014-03-25 19:08:00 +0000
142+++ server/acceptance/suites/helpers.go 2014-03-31 17:58:02 +0000
143@@ -48,8 +48,8 @@
144 "session_queue_size": 10,
145 "broker_queue_size": 100,
146 "addr": addr,
147- "key_pem_file": helpers.SourceRelative("../config/testing.key"),
148- "cert_pem_file": helpers.SourceRelative("../config/testing.cert"),
149+ "key_pem_file": helpers.SourceRelative("../ssl/testing.key"),
150+ "cert_pem_file": helpers.SourceRelative("../ssl/testing.cert"),
151 })
152 }
153
154
155=== modified file 'server/acceptance/suites/suite.go'
156--- server/acceptance/suites/suite.go 2014-03-25 19:08:00 +0000
157+++ server/acceptance/suites/suite.go 2014-03-31 17:58:02 +0000
158@@ -128,9 +128,9 @@
159 }
160
161 func testClientSession(addr string, deviceId string, reportPings bool) *acceptance.ClientSession {
162- certPEMBlock, err := ioutil.ReadFile(helpers.SourceRelative("../config/testing.cert"))
163+ certPEMBlock, err := ioutil.ReadFile(helpers.SourceRelative("../ssl/testing.cert"))
164 if err != nil {
165- panic(fmt.Sprintf("could not read config/testing.cert: %v", err))
166+ panic(fmt.Sprintf("could not read ssl/testing.cert: %v", err))
167 }
168 return &acceptance.ClientSession{
169 ExchangeTimeout: 100 * time.Millisecond,

Subscribers

People subscribed via source and target branches