Merge lp:~mbruzek/charms/precise/newrelic/tests into lp:charms/newrelic

Proposed by Matt Bruzek
Status: Merged
Merged at revision: 6
Proposed branch: lp:~mbruzek/charms/precise/newrelic/tests
Merge into: lp:charms/newrelic
Diff against target: 67 lines (+57/-0)
2 files modified
tests/00-setup (+5/-0)
tests/99-autogen (+52/-0)
To merge this branch: bzr merge lp:~mbruzek/charms/precise/newrelic/tests
Reviewer Review Type Date Requested Status
José Antonio Rey (community) Approve
Review Queue (community) automated testing Approve
Review via email: mp+240980@code.launchpad.net

Commit message

Adding tests for this charm

To post a comment you must log in.
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-10627-results

review: Needs Fixing (automated testing)
7. By Matt Bruzek

Adding newrelic key so tests pass

Revision history for this message
Matt Bruzek (mbruzek) wrote :

After adding the key the bundetester ran successfully on my local machine.

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

The results (PASS) are in and available here: http://reports.vapour.ws/charm-tests/charm-bundle-test-10828-results

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

Hey Matt,

These tests pass with no errors! Thanks for your work on these!

+1 LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'tests'
=== added file 'tests/00-setup'
--- tests/00-setup 1970-01-01 00:00:00 +0000
+++ tests/00-setup 2015-01-05 14:51:02 +0000
@@ -0,0 +1,5 @@
1#!/bin/bash
2
3sudo add-apt-repository ppa:juju/stable -y
4sudo apt-get update
5sudo apt-get install amulet python3-requests -y
06
=== added file 'tests/99-autogen'
--- tests/99-autogen 1970-01-01 00:00:00 +0000
+++ tests/99-autogen 2015-01-05 14:51:02 +0000
@@ -0,0 +1,52 @@
1#!/usr/bin/env python3
2
3import amulet
4import requests
5import unittest
6
7
8class TestDeployment(unittest.TestCase):
9 @classmethod
10 def setUpClass(cls):
11 cls.deployment = amulet.Deployment(series='precise')
12
13 cls.deployment.add('newrelic')
14 cls.deployment.add('ubuntu')
15 cls.deployment.configure('newrelic', {'key': '2e2b4406be1e34fe64b228ca7dc16d4ce555add5'})
16 cls.deployment.relate('newrelic:juju-info', 'ubuntu:juju-info')
17
18 try:
19 cls.deployment.setup(timeout=900)
20 cls.deployment.sentry.wait()
21 except amulet.helpers.TimeoutError:
22 amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time")
23 except:
24 raise
25
26 def test_case(self):
27 # Now you can use self.deployment.sentry.unit[UNIT] to address each of
28 # the units and perform more in-depth steps. You can also reference
29 # the first unit as self.unit.
30 # There are three test statuses that can be triggered with
31 # amulet.raise_status():
32 # - amulet.PASS
33 # - amulet.FAIL
34 # - amulet.SKIP
35 # Each unit has the following methods:
36 # - .info - An array of the information of that unit from Juju
37 # - .file(PATH) - Get the details of a file on that unit
38 # - .file_contents(PATH) - Get plain text output of PATH file from that unit
39 # - .directory(PATH) - Get details of directory
40 # - .directory_contents(PATH) - List files and folders in PATH on that unit
41 # - .relation(relation, service:rel) - Get relation data from return service
42 # add tests here to confirm service is up and working properly
43 # For example, to confirm that it has a functioning HTTP server:
44 # page = requests.get('http://{}'.format(self.unit.info['public-address']))
45 # page.raise_for_status()
46 # More information on writing Amulet tests can be found at:
47 # https://juju.ubuntu.com/docs/tools-amulet.html
48 pass
49
50
51if __name__ == '__main__':
52 unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: