Merge lp:~mbruzek/charms/precise/solr-jetty/add-tests into lp:~charmers/charms/precise/solr-jetty/trunk

Proposed by Matt Bruzek
Status: Merged
Merged at revision: 19
Proposed branch: lp:~mbruzek/charms/precise/solr-jetty/add-tests
Merge into: lp:~charmers/charms/precise/solr-jetty/trunk
Diff against target: 109 lines (+64/-0)
4 files modified
config.yaml (+4/-0)
metadata.yaml (+2/-0)
tests/00-setup (+5/-0)
tests/99-autogen (+53/-0)
To merge this branch: bzr merge lp:~mbruzek/charms/precise/solr-jetty/add-tests
Reviewer Review Type Date Requested Status
José Antonio Rey (community) Approve
Review Queue (community) automated testing Needs Fixing
Review via email: mp+244367@code.launchpad.net

Description of the change

Adding tests and fixing charm proof for solr-jetty charm.

To post a comment you must log in.
Revision history for this message
Matt Bruzek (mbruzek) wrote :

It does not appear that the solr-jetty charm deploys successfully any longer. I opened a separate bug against that here: https://bugs.launchpad.net/charms/+source/solr-jetty/+bug/1401319

We still may want to check in these changes so solr-jetty passes charm proof and has a deployment test that we can later refer to.

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-10687-results

review: Needs Fixing (automated testing)
Revision history for this message
José Antonio Rey (jose) wrote :

A bug has already been filed for the install hook failure, and tests work as expected.

+1 LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2013-07-16 23:47:53 +0000
3+++ config.yaml 2014-12-10 23:52:05 +0000
4@@ -2,19 +2,23 @@
5 # Solr configuration
6 schema:
7 type: string
8+ default:
9 description: |
10 Solr XML schema (base64 encoded).
11 # Jetty configuration
12 java-max-heap-mb:
13 type: int
14+ default:
15 description: |
16 Java options Max heap size (-Xmx)
17 java-min-heap-mb:
18 type: int
19+ default:
20 description: |
21 Java options min heap size (-Xms)
22 acceptors:
23 type: int
24+ default:
25 description: |
26 The number of threads dedicated to accepting incoming connections.
27 instance_type:
28
29=== modified file 'metadata.yaml'
30--- metadata.yaml 2013-04-22 18:39:37 +0000
31+++ metadata.yaml 2014-12-10 23:52:05 +0000
32@@ -7,6 +7,8 @@
33 search, caching, replication, and a web administration interface. It
34 runs in a Java servlet container such as Tomcat. This package
35 provides the Jetty integration files for Solr.
36+tags:
37+ - application_development
38 provides:
39 website:
40 interface: http
41
42=== added directory 'tests'
43=== added file 'tests/00-setup'
44--- tests/00-setup 1970-01-01 00:00:00 +0000
45+++ tests/00-setup 2014-12-10 23:52:05 +0000
46@@ -0,0 +1,5 @@
47+#!/bin/bash
48+
49+sudo add-apt-repository ppa:juju/stable -y
50+sudo apt-get update
51+sudo apt-get install amulet python3-requests -y
52
53=== added file 'tests/99-autogen'
54--- tests/99-autogen 1970-01-01 00:00:00 +0000
55+++ tests/99-autogen 2014-12-10 23:52:05 +0000
56@@ -0,0 +1,53 @@
57+#!/usr/bin/env python3
58+
59+import amulet
60+import requests
61+import unittest
62+
63+
64+seconds = 900
65+
66+class TestDeployment(unittest.TestCase):
67+ @classmethod
68+ def setUpClass(self):
69+ self.deployment = amulet.Deployment(series='precise')
70+
71+ self.deployment.add('solr-jetty')
72+ self.deployment.expose('solr-jetty')
73+
74+ try:
75+ self.deployment.setup(timeout=seconds)
76+ self.deployment.sentry.wait()
77+ except amulet.helpers.TimeoutError:
78+ message = "The environment was not set up in %d seconds." % seconds
79+ amulet.raise_status(amulet.SKIP, msg=message)
80+ except:
81+ raise
82+
83+ def test_case(self):
84+ # Now you can use self.deployment.sentry.unit[UNIT] to address each of
85+ # the units and perform more in-depth steps. You can also reference
86+ # the first unit as self.unit.
87+ # There are three test statuses that can be triggered with
88+ # amulet.raise_status():
89+ # - amulet.PASS
90+ # - amulet.FAIL
91+ # - amulet.SKIP
92+ # Each unit has the following methods:
93+ # - .info - An array of the information of that unit from Juju
94+ # - .file(PATH) - Get the details of a file on that unit
95+ # - .file_contents(PATH) - Get plain text output of PATH file from that unit
96+ # - .directory(PATH) - Get details of directory
97+ # - .directory_contents(PATH) - List files and folders in PATH on that unit
98+ # - .relation(relation, service:rel) - Get relation data from return service
99+ # add tests here to confirm service is up and working properly
100+ # For example, to confirm that it has a functioning HTTP server:
101+ # page = requests.get('http://{}'.format(self.unit.info['public-address']))
102+ # page.raise_for_status()
103+ # More information on writing Amulet tests can be found at:
104+ # https://juju.ubuntu.com/docs/tools-amulet.html
105+ pass
106+
107+
108+if __name__ == '__main__':
109+ unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: