Merge lp:~marcoceppi/charms/precise/thinkup/tests into lp:~charmers/charms/precise/thinkup/trunk

Proposed by Marco Ceppi
Status: Merged
Merged at revision: 24
Proposed branch: lp:~marcoceppi/charms/precise/thinkup/tests
Merge into: lp:~charmers/charms/precise/thinkup/trunk
Diff against target: 134 lines (+88/-0) (has conflicts)
5 files modified
README.md (+26/-0)
config.yaml (+3/-0)
metadata.yaml (+1/-0)
tests/00-setup (+5/-0)
tests/99-autogen (+53/-0)
Conflict adding file README.md.  Moved existing file to README.md.moved.
To merge this branch: bzr merge lp:~marcoceppi/charms/precise/thinkup/tests
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
José Antonio Rey (community) charmers Needs Fixing
Antonio Rosales (community) community Approve
Review Queue (community) automated testing Needs Fixing
Cory Johns (community) Needs Fixing
Review via email: mp+240894@code.launchpad.net

Commit message

Tests for charm

To post a comment you must log in.
Revision history for this message
Cory Johns (johnsca) wrote :

`charm proof` failed due to missing README, missing "tags" field from metadata, and missing "default" in config options.

I also got an SSL error during the install hook which caused the 99-autogen test to fail, but it seems likely that this is temporary and caused by a third-party issue.

review: Needs Fixing
Revision history for this message
Cory Johns (johnsca) wrote :

Fixed charm proof issues in https://code.launchpad.net/~johnsca/charms/precise/thinkup/charm-proof/+merge/243469 with a super-boilerplate README

Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-10644-results

review: Needs Fixing (automated testing)
23. By Marco Ceppi

[johnsca] Boilerplate README and fixed charm proof warnings

Revision history for this message
Antonio Rosales (arosales) wrote :

As this merge proposal only add charm tests and does not touch charm code I would like to suggest to accept this merge proposal even though the charm is failing the tests for the following reasons:

1. A test is still valid even if the results aren't positive.
2. Having charm tests provides the first step to helping the charm author and community fix the charm. Specifically by providing a reproducible failure.
3. The tests are seed (basic) tests that an interested person can build off of.
4. As fixes are made to this charm automating charm testing will be able to run additional tests in addition to charm proof.
5. Having basic tests, as demonstrated here, helps ensure the charm is in a working (deployable) state given this charm is a recommended charm. A test failure can prompt a bug the charm author can take action on. The charm author may not have been aware of the bug had the charm not had even basic deployment tests.

In this case the test does deploy a valid thinkup environment, however the install hook fails. A good point to note here is the seed tests help identify this error. We would have not known of the failure with out the tests. Thus, although the charm is failing charm testing, the test itself is valid.

Thus, for the above reason I would suggest to accept this merge to add in tests.

+1 LGTM

review: Approve (community)
Revision history for this message
Antonio Rosales (arosales) wrote :

There is a current bug open for the install hook failure:
https://bugs.launchpad.net/charms/+source/thinkup/+bug/1367491

Revision history for this message
José Antonio Rey (jose) wrote :

I am not able to merge this until the conflicts are resolved.

review: Needs Fixing (charmers)
Revision history for this message
Charles Butler (lazypower) wrote :

Resolved the README.md conflict and pushed this.

Thanks for your work everyone.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'README.md'
2--- README.md 1970-01-01 00:00:00 +0000
3+++ README.md 2014-12-18 01:41:31 +0000
4@@ -0,0 +1,26 @@
5+# Overview
6+
7+ThinkUp is a free, installable web application that gives you insights into your
8+activity on social networks, including Twitter, Facebook, Foursquare, and
9+Google+. Find out more at http://thinkup.com.
10+
11+# Usage
12+
13+You can deploy the charm using the following:
14+
15+ juju deploy servicename
16+ juju deploy haproxy
17+ juju deploy mysql
18+ juju add-relation thinkup:website haproxy:reverseproxy
19+ juju add-relation thinkup:db mysql:db
20+ juju expose haproxy
21+
22+Then browse to the public-address for the haproxy service which can be retrieved
23+via:
24+
25+ juju status haproxy
26+
27+## Upstream Project Name
28+
29+- https://www.thinkup.com/
30+- https://github.com/ginatrapani/ThinkUp
31
32=== renamed file 'README.md' => 'README.md.moved'
33=== modified file 'config.yaml'
34--- config.yaml 2014-10-23 14:55:39 +0000
35+++ config.yaml 2014-12-18 01:41:31 +0000
36@@ -7,14 +7,17 @@
37 default: ""
38 type: string
39 description: The full name of the administrator
40+ default: ''
41 email:
42 default: ""
43 type: string
44 description: The email address of the administrator (used for login and cannot be changed after initial value has been set)
45+ default: ''
46 password:
47 default: ""
48 type: string
49 description: The password of the administrator
50+ default: ''
51 timezone:
52 default: UTC
53 type: string
54
55=== modified file 'metadata.yaml'
56--- metadata.yaml 2014-10-23 14:55:39 +0000
57+++ metadata.yaml 2014-12-18 01:41:31 +0000
58@@ -1,6 +1,7 @@
59 name: thinkup
60 summary: social network aggregator
61 maintainer: Nathan Osman <admin@quickmediasolutions.com>
62+tags: ["applications"]
63 description: |
64 ThinkUp is a free, open source web application that captures all your
65 activity on social networks.
66
67=== added directory 'tests'
68=== added file 'tests/00-setup'
69--- tests/00-setup 1970-01-01 00:00:00 +0000
70+++ tests/00-setup 2014-12-18 01:41:31 +0000
71@@ -0,0 +1,5 @@
72+#!/bin/bash
73+
74+sudo add-apt-repository ppa:juju/stable -y
75+sudo apt-get update
76+sudo apt-get install amulet python3-requests -y
77
78=== added file 'tests/99-autogen'
79--- tests/99-autogen 1970-01-01 00:00:00 +0000
80+++ tests/99-autogen 2014-12-18 01:41:31 +0000
81@@ -0,0 +1,53 @@
82+#!/usr/bin/env python3
83+
84+import amulet
85+import requests
86+import unittest
87+
88+
89+class TestDeployment(unittest.TestCase):
90+ @classmethod
91+ def setUpClass(cls):
92+ cls.deployment = amulet.Deployment(series='precise')
93+
94+ cls.deployment.add('thinkup')
95+ cls.deployment.add('haproxy')
96+ cls.deployment.add('mysql')
97+ cls.deployment.relate('thinkup:website', 'haproxy:reverseproxy')
98+ cls.deployment.relate('thinkup:db', 'mysql:db')
99+
100+ try:
101+ cls.deployment.setup(timeout=900)
102+ cls.deployment.sentry.wait()
103+ except amulet.helpers.TimeoutError:
104+ amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time")
105+ except:
106+ raise
107+
108+ def test_case(self):
109+ # Now you can use self.deployment.sentry.unit[UNIT] to address each of
110+ # the units and perform more in-depth steps. You can also reference
111+ # the first unit as self.unit.
112+ # There are three test statuses that can be triggered with
113+ # amulet.raise_status():
114+ # - amulet.PASS
115+ # - amulet.FAIL
116+ # - amulet.SKIP
117+ # Each unit has the following methods:
118+ # - .info - An array of the information of that unit from Juju
119+ # - .file(PATH) - Get the details of a file on that unit
120+ # - .file_contents(PATH) - Get plain text output of PATH file from that unit
121+ # - .directory(PATH) - Get details of directory
122+ # - .directory_contents(PATH) - List files and folders in PATH on that unit
123+ # - .relation(relation, service:rel) - Get relation data from return service
124+ # add tests here to confirm service is up and working properly
125+ # For example, to confirm that it has a functioning HTTP server:
126+ # page = requests.get('http://{}'.format(self.unit.info['public-address']))
127+ # page.raise_for_status()
128+ # More information on writing Amulet tests can be found at:
129+ # https://juju.ubuntu.com/docs/tools-amulet.html
130+ pass
131+
132+
133+if __name__ == '__main__':
134+ unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: