Merge lp:~elopio/snappy-tests-job/ip into lp:~fgimenez/snappy-tests-job/trunk

Proposed by Leo Arias
Status: Merged
Merged at revision: 56
Proposed branch: lp:~elopio/snappy-tests-job/ip
Merge into: lp:~fgimenez/snappy-tests-job/trunk
Diff against target: 49 lines (+17/-12)
1 file modified
snappy-tests-job/main.go (+17/-12)
To merge this branch: bzr merge lp:~elopio/snappy-tests-job/ip
Reviewer Review Type Date Requested Status
Federico Gimenez continuous-integration Approve
Review via email: mp+267900@code.launchpad.net

Commit message

Added an ip flag to use an already provisioned testbed.

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

PASSED: Continuous integration, rev:57
http://10.55.60.183:8080/job/snappy-rolling-ci/21/
Executed test runs:

Click here to trigger a rebuild:
http://10.55.60.183:8080/job/snappy-rolling-ci/21/rebuild

review: Approve (continuous-integration)
Revision history for this message
Federico Gimenez (fgimenez) wrote :

I agree with my alter-ego, thanks! :)

Btw, I had to change the allowed_users field in the jlp.config to snappy-dev (taken from the snappy-jenkins config) for the trigger to work, it was fixed to my user.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy-tests-job/main.go'
2--- snappy-tests-job/main.go 2015-08-11 10:32:38 +0000
3+++ snappy-tests-job/main.go 2015-08-13 05:36:45 +0000
4@@ -44,6 +44,8 @@
5 var (
6 useSnappyFromBranch = flag.Bool("snappy-from-branch", false,
7 "If this flag is used, snappy will be compiled from this branch, copied to the testbed and used for the tests. Otherwise, the snappy installed with the image will be used.")
8+ ip = flag.String("ip", "",
9+ "IP of the testbed. If no IP is passed, a cloud instance will be started for the test.")
10 cloudProvider = flag.String("cloud", defaultCloudProvider,
11 "Cloud provider to use, defaults to "+defaultCloudProvider)
12 flavor = flag.String("flavor", defaultFlavor,
13@@ -70,21 +72,24 @@
14 }
15 defer os.RemoveAll(sourcePath)
16
17- cloudClient := cloud.NewCloudClient(*cloudProvider, *flavor, utilHandler)
18- ip, err := cloudClient.CreateInstance(*release, *channel)
19- defer cloudClient.KillInstance()
20-
21- if err != nil {
22- log.Panicf("Error creating image for release %s and channel %s, %s", *release, *channel, err)
23+ ipString := *ip
24+ if ipString == "" {
25+ cloudClient := cloud.NewCloudClient(*cloudProvider, *flavor, utilHandler)
26+ ipString, err = cloudClient.CreateInstance(*release, *channel)
27+ defer cloudClient.KillInstance()
28+
29+ if err != nil {
30+ log.Panicf("Error creating image for release %s and channel %s, %s", *release, *channel, err)
31+ }
32+
33+ // give time for the instance to finish booting
34+ // TODO: check with a ticker if the instance is available
35+ log.Print("Waiting for instance to finish booting...")
36+ time.Sleep(3 * time.Minute)
37 }
38
39- // give time for the instance to finish booting
40- // TODO: check with a ticker if the instance is available
41- log.Print("Waiting for instance to finish booting...")
42- time.Sleep(3 * time.Minute)
43-
44 testRunner := runner.NewBasicRunnerHandler(utilHandler)
45- if err := testRunner.RunTests(sourcePath, *commandTpl, ip, *useSnappyFromBranch); err != nil {
46+ if err := testRunner.RunTests(sourcePath, *commandTpl, ipString, *useSnappyFromBranch); err != nil {
47 log.Panic("Error from test runner")
48 }
49 }

Subscribers

People subscribed via source and target branches

to all changes: