Merge lp:~cjohnston/uci-engine/ts-amulet-settle into lp:uci-engine

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 509
Merged at revision: 509
Proposed branch: lp:~cjohnston/uci-engine/ts-amulet-settle
Merge into: lp:uci-engine
Diff against target: 58 lines (+13/-3)
2 files modified
tests/deployers.py (+2/-2)
tests/test_ticket_system.py (+11/-1)
To merge this branch: bzr merge lp:~cjohnston/uci-engine/ts-amulet-settle
Reviewer Review Type Date Requested Status
Vincent Ladeuil (community) Approve
Chris Johnston (community) Needs Resubmitting
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+219754@code.launchpad.net

Commit message

Add more deployment padding for the ticket_system amulet tests

Description of the change

Currently the ticket system amulet tests are failing almost 100% of the time because the tests are being run prior to the deployment having time to settle. If we add a get_ip_and_port for the ts-django instance, it reduces the frequency of the failures, as get_ip_and_port will wait for the ts-django port to become available. Also adds a note to the failing test that it is flaky.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:489
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/637/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/637/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andy Doan (doanac) wrote :

Could we just put a single call to "get_ip_and_port('ts-django')" in the
setUp method?

489. By Chris Johnston

[r=Francis Ginther, PS Jenkins bot] Add missing import checks to tests/run.py from Chris Johnston

490. By Andy Doan

[r=Francis Ginther, PS Jenkins bot] bsbuilder: better throttling of the status updates

We are flooding the log with the same status message over
and over. This helps throttle this back a bit so that we
still see updates and can tell things aren't stuck, but also
not flood out log files. I added this in a generic way
to amqp_utils so that other people can choose to join in
if they ever find the need. from Andy Doan

491. By Chris Johnston

[r=Andy Doan, PS Jenkins bot] Remove deps like python-django from needing to be installed in order to create a ticket. 1319911 from Chris Johnston

Revision history for this message
Vincent Ladeuil (vila) wrote :

+1 on Andy's suggestion, no need to duplicate the call and it will be clearer in the setUp().

Oh there is no setup yet ! Don't forget to call the base class setup there then:

def setUp(self):
    super(TicketSystemTest, self.).setUp()
    # We need to ensure that both webui-apache and ts-django are up and running while we wait
    # for a fix for http://pad.lv/1319077
    self.get_ip_and_port('ts-django')
    self.get_ip_and_port('webui-apache')

or something similar (untested).

Thanks for your patience and work there.

review: Needs Fixing
492. By Vincent Ladeuil

[r=PS Jenkins bot, Celso Providelo] Silent scripts. from Vincent Ladeuil

493. By Celso Providelo

[r=PS Jenkins bot, Vincent Ladeuil] Extending Gatekeeper SourcePackageUpload validation to cope with re-raised dput exceptions. from Celso Providelo

494. By Andy Doan

[r=Paul Larson, PS Jenkins bot] django charm: add relationship support for rabbitmq

This lets you add a relation between rabbitmq and django like we
do in our rabbitmq-worker charm. This allows the ticket system to use rabbit from Andy Doan

495. By Vincent Ladeuil

[r=Evan Dandrea, PS Jenkins bot] Fix the tests that didn't catch the broken call nor the broken assumptions about rabbit behavior. Also fix the broken basic_publish() call. 1320000 from Vincent Ladeuil

496. By Andy Doan

[r=Celso Providelo, PS Jenkins bot] lander/ticket-system: convert to rabbit

This changes the lander/ticket relationship so that the ticket
system simply sends amqp messages that the lander can handle. This
is the first step in allowing us to scale to multiple landers. from Andy Doan

497. By Andy Doan

[r=Chris Johnston, PS Jenkins bot] remove incorrect comment about ticket-states

this comment is incorrect and just leads to confusion from Andy Doan

498. By Andy Doan

[r=Chris Johnston, PS Jenkins bot] ticket-system: make test_style automatically ignore migrations

Its a pain to remember adding your migration to this file. This
discovers them for you.
  from Andy Doan

499. By Andy Doan

[r=Vincent Ladeuil, PS Jenkins bot] webui: allow view ticket progress live

This is a super simplistic start, but allows you to follow the progress of a ticket landing in real time. from Andy Doan

500. By Vincent Ladeuil

[r=PS Jenkins bot, Andy Doan] Uprgade to ucitests 0.1.3 and remove the corresponding upstreamed code. from Vincent Ladeuil

501. By Ursula Junque

[r=Andy Doan, PS Jenkins bot, Celso Providelo] This branch adds the publisher skeleton to our tree, also adds PUBLISHER_QUEUE type to amqp_utils.py from Ursula Junque

502. By Andy Doan

[r=PS Jenkins bot, Ursula Junque, Chris Johnston] ticket-system: fix series choices for tickets

Things have been working by dumb luck because we were creating tickets
via the REST api with a series in all lowercase (ie "saucy").

I was playing with editing tickets from the django admin panel and
discovered we saved the series as SAUCY. This breaks the bsbuilder's
interaction with the LP api which expectes a series to be all lowercase.

I fixed that, removed the obsolete quantal series and included trusty. from Andy Doan

503. By Andy Doan

[r=Francis Ginther, PS Jenkins bot] ticket-system: allow updating of just status or workflow-step

This fixes a bug and annoyance in the ticket system.

bug - you can't just update the status or workflow-step. They have
to both be provided

annoyance - we return status and workflow step back as words like
"in progress", but our write-api requires the inputs to be numerical.

This fixes both issues so that you can now just update a ticket's status
to something like 'failed'.
  from Andy Doan

504. By Evan

[r=PS Jenkins bot, Paul Larson] Put the right data into the lp_creds.txt file. from Evan Dandrea

505. By Celso Providelo

[r=PS Jenkins bot] Updating restish charm according to IS guidelines. from Celso Providelo

506. By Celso Providelo

[r=PS Jenkins bot, Evan Dandrea] Updating our charms to cope with prodstack guidelines from Celso Providelo

507. By Chris Johnston

[r=PS Jenkins bot, Andy Doan] Add restish charm to local charms in deploy.py from Chris Johnston

508. By Chris Johnston

Add more deployment padding for the ticket_system amulet tests

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:509
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/699/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/699/rebuild

review: Approve (continuous-integration)
509. By Chris Johnston

Move checks to setUp

Revision history for this message
Chris Johnston (cjohnston) wrote :

Addressed comments

review: Needs Resubmitting
Revision history for this message
Vincent Ladeuil (vila) wrote :

Progress !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/deployers.py'
2--- tests/deployers.py 2014-05-13 15:54:55 +0000
3+++ tests/deployers.py 2014-05-26 12:52:06 +0000
4@@ -71,7 +71,7 @@
5 self.deployer.load(script)
6 self.addCleanup(self.deployer.tearDown)
7 self.deployer.setUp(self.timeout)
8- self.status = self.deployer.status()
9+ self.status = self.deployer.status()
10
11 def fixup_includes(self, script, base_dir):
12 # amulet can only process "include-base64" option if the file is under
13@@ -103,7 +103,7 @@
14 break
15 except KeyError:
16 tries += 1
17- log.warn("open-ports not found waiting...")
18+ log.warn("open-ports not found for %s, waiting..." % service)
19 time.sleep(5)
20
21 def assert_job_running(self, upstart_job, service, unit=0):
22
23=== modified file 'tests/test_ticket_system.py'
24--- tests/test_ticket_system.py 2014-05-07 18:18:29 +0000
25+++ tests/test_ticket_system.py 2014-05-26 12:52:06 +0000
26@@ -27,6 +27,13 @@
27
28 deployer_cfg = 'ticket-system.yaml'
29
30+ def setUp(self):
31+ super(TicketSystemTest, self).setUp()
32+ # Adding get_ip_and_port('ts-django') in order to allow the deployment
33+ # further time to settle before running the tests.
34+ # http://pad.lv/1319077
35+ self.get_ip_and_port('ts-django')
36+
37 def get_server_status_and_content(self, url):
38 final_url = url.format(self.get_ip_and_port('webui-apache')[0])
39
40@@ -51,6 +58,7 @@
41
42 def test_ticket_sys_api(self):
43 url = 'http://{}/api/v1/ticket'
44+ self.get_ip_and_port('ts-django')
45 resp, content = self.get_server_status_and_content(url)
46
47 self.assertEqual('200', resp['status'])
48@@ -63,7 +71,9 @@
49 "added_binaries": "binary-1,binary-2",
50 "removed_binaries": "binary-3,binary-4"}
51 resp, content = self.create_ticket(ticket_content)
52- self.assertEqual('201', resp['status'])
53+ self.assertEqual('201', resp['status'], 'This is a known flaky test. '
54+ 'In order to fix it we need to fix '
55+ 'http://pad.lv/1319077')
56
57 def test_prohibit_delete(self):
58 ticket_content = {'owner': "dont_delete@example.com",

Subscribers

People subscribed via source and target branches