Merge lp:~bigdata-dev/charms/trusty/apache-spark/trunk into lp:charms/trusty/apache-spark

Proposed by Cory Johns
Status: Merged
Merged at revision: 36
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-spark/trunk
Merge into: lp:charms/trusty/apache-spark
Diff against target: 226 lines (+26/-143)
7 files modified
README.md (+1/-1)
resources.yaml (+1/-1)
tests/00-setup (+0/-8)
tests/01-basic-deployment.py (+24/-0)
tests/100-deploy-spark-hdfs-yarn (+0/-51)
tests/remote/test_dist_config.py (+0/-72)
tests/tests.yaml (+0/-10)
To merge this branch: bzr merge lp:~bigdata-dev/charms/trusty/apache-spark/trunk
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+273430@code.launchpad.net

Description of the change

Remove trivial test in favor of bundle tests.

To post a comment you must log in.
50. By Cory Johns

Re-added trivial test

51. By Cory Johns

Update mailing list

52. By Cory Johns

Moved spark ppc64le binary to S3

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

LGTM, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2015-09-08 21:06:26 +0000
3+++ README.md 2015-10-07 17:47:05 +0000
4@@ -131,7 +131,7 @@
5
6 ## Contact Information
7
8-- <bigdata-dev@lists.launchpad.net>
9+- <bigdata@lists.ubuntu.com>
10
11
12 ## Help
13
14=== modified file 'resources.yaml'
15--- resources.yaml 2015-09-16 21:25:04 +0000
16+++ resources.yaml 2015-10-07 17:47:05 +0000
17@@ -7,7 +7,7 @@
18 pypi: jujubigdata>=4.0.0,<5.0.0
19 optional_resources:
20 spark-ppc64le:
21- url: https://git.launchpad.net/bigdata-data/plain/apache/ppc64le/spark-1.3.1-bin-2.4.0.tgz?id=45f439740a08b93ae72bc48a7103ebf58dbfa60b
22+ url: https://s3.amazonaws.com/jujubigdata/apache/ppc64le/spark-1.3.1-bin-2.4.0-204fc10.tgz
23 hash: 204fc101f3c336692feeb1401225407c575a90d42af5d7ab83937b59c42a6af9
24 hash_type: sha256
25 spark-x86_64:
26
27=== added directory 'tests'
28=== removed directory 'tests'
29=== removed file 'tests/00-setup'
30--- tests/00-setup 2015-09-16 20:20:56 +0000
31+++ tests/00-setup 1970-01-01 00:00:00 +0000
32@@ -1,8 +0,0 @@
33-#!/bin/bash
34-
35-if ! dpkg -s amulet &> /dev/null; then
36- echo Installing Amulet...
37- sudo add-apt-repository -y ppa:juju/stable
38- sudo apt-get update
39- sudo apt-get -y install amulet
40-fi
41
42=== added file 'tests/01-basic-deployment.py'
43--- tests/01-basic-deployment.py 1970-01-01 00:00:00 +0000
44+++ tests/01-basic-deployment.py 2015-10-07 17:47:05 +0000
45@@ -0,0 +1,24 @@
46+#!/usr/bin/env python3
47+
48+import unittest
49+import amulet
50+
51+
52+class TestDeploy(unittest.TestCase):
53+ """
54+ Trivial deployment test for Apache Spark.
55+
56+ This charm cannot do anything useful by itself, so integration testing
57+ is done in the bundle.
58+ """
59+
60+ def test_deploy(self):
61+ self.d = amulet.Deployment(series='trusty')
62+ self.d.add('spark', 'apache-spark')
63+ self.d.setup(timeout=900)
64+ self.d.sentry.wait(timeout=1800)
65+ self.unit = self.d.sentry['spark'][0]
66+
67+
68+if __name__ == '__main__':
69+ unittest.main()
70
71=== removed file 'tests/100-deploy-spark-hdfs-yarn'
72--- tests/100-deploy-spark-hdfs-yarn 2015-09-16 21:25:04 +0000
73+++ tests/100-deploy-spark-hdfs-yarn 1970-01-01 00:00:00 +0000
74@@ -1,51 +0,0 @@
75-#!/usr/bin/env python3
76-
77-import unittest
78-import amulet
79-
80-
81-class TestDeploy(unittest.TestCase):
82- """
83- Deployment test for Apache Spark using HDFS as shared storage and YARN as
84- cluster job manager.
85- """
86-
87- @classmethod
88- def setUpClass(cls):
89- cls.d = amulet.Deployment(series='trusty')
90- # Deploy a hadoop cluster
91- cls.d.add('yarn-master', charm='cs:trusty/apache-hadoop-yarn-master')
92- cls.d.add('hdfs-master', charm='cs:trusty/apache-hadoop-hdfs-master')
93- cls.d.add('compute-slave', charm='cs:trusty/apache-hadoop-compute-slave', units=3)
94- cls.d.add('plugin', charm='cs:trusty/apache-hadoop-plugin')
95- cls.d.relate('yarn-master:namenode', 'hdfs-master:namenode')
96- cls.d.relate('compute-slave:nodemanager', 'yarn-master:nodemanager')
97- cls.d.relate('compute-slave:datanode', 'hdfs-master:datanode')
98- cls.d.relate('plugin:resourcemanager', 'yarn-master:resourcemanager')
99- cls.d.relate('plugin:namenode', 'hdfs-master:namenode')
100-
101- # Add Spark Service
102- cls.d.add('spark', charm='cs:trusty/apache-spark')
103- cls.d.relate('spark:hadoop-plugin', 'plugin:hadoop-plugin')
104-
105- cls.d.setup(timeout=3600)
106- cls.d.sentry.wait(timeout=3600)
107- cls.unit = cls.d.sentry.unit['spark/0']
108-
109-###########################################################################
110-# Validate that the Spark HistoryServer is running
111-###########################################################################
112- def test_jvm_status(self):
113- o, c = self.unit.run("pgrep -a java | grep HistoryServer")
114- assert c == 0, "Spark HistoryServer not running"
115-
116-###########################################################################
117-# Validate Spark commandline operation - run SparkPi
118-###########################################################################
119- def test_spark_job(self):
120- o, c = self.unit.run("su ubuntu -c '/home/ubuntu/sparkpi.sh'")
121- assert c == 0, "SparkPi test failed: %s" % o
122-
123-
124-if __name__ == '__main__':
125- unittest.main()
126
127=== removed directory 'tests/remote'
128=== removed file 'tests/remote/test_dist_config.py'
129--- tests/remote/test_dist_config.py 2015-08-21 21:52:04 +0000
130+++ tests/remote/test_dist_config.py 1970-01-01 00:00:00 +0000
131@@ -1,72 +0,0 @@
132-#!/usr/bin/env python
133-
134-import grp
135-import os
136-import pwd
137-import unittest
138-
139-import jujubigdata
140-
141-
142-class TestDistConfig(unittest.TestCase):
143- """
144- Test that the ``dist.yaml`` settings were applied properly, such as users, groups, and dirs.
145-
146- This is done as a remote test on the deployed unit rather than a regular
147- test under ``tests/`` because filling in the ``dist.yaml`` requires Juju
148- context (e.g., config).
149- """
150- @classmethod
151- def setUpClass(cls):
152- config = None
153- config_dir = os.environ['JUJU_CHARM_DIR']
154- config_file = 'dist.yaml'
155- if os.path.isfile(os.path.join(config_dir, config_file)):
156- config = os.path.join(config_dir, config_file)
157- if not config:
158- raise IOError('Could not find {} in {}'.format(config_file, config_dir))
159- reqs = ['vendor', 'hadoop_version', 'packages', 'groups', 'users',
160- 'dirs', 'ports']
161- cls.dist_config = jujubigdata.utils.DistConfig(config, reqs)
162-
163- def test_groups(self):
164- for name in self.dist_config.groups:
165- try:
166- grp.getgrnam(name)
167- except KeyError:
168- self.fail('Group {} is missing'.format(name))
169-
170- def test_users(self):
171- for username, details in self.dist_config.users.items():
172- try:
173- user = pwd.getpwnam(username)
174- except KeyError:
175- self.fail('User {} is missing'.format(username))
176- for groupname in details['groups']:
177- try:
178- group = grp.getgrnam(groupname)
179- except KeyError:
180- self.fail('Group {} referenced by user {} does not exist'.format(
181- groupname, username))
182- if group.gr_gid != user.pw_gid:
183- self.assertIn(username, group.gr_mem, 'User {} not in group {}'.format(
184- username, groupname))
185-
186- def test_dirs(self):
187- for name, details in self.dist_config.dirs.items():
188- dirpath = self.dist_config.path(name)
189- self.assertTrue(dirpath.isdir(), 'Dir {} is missing'.format(name))
190- stat = dirpath.stat()
191- owner = pwd.getpwuid(stat.st_uid).pw_name
192- group = grp.getgrgid(stat.st_gid).gr_name
193- perms = stat.st_mode & ~0o40000
194- self.assertEqual(owner, details.get('owner', 'root'),
195- 'Dir {} ({}) has wrong owner: {}'.format(name, dirpath, owner))
196- self.assertEqual(group, details.get('group', 'root'),
197- 'Dir {} ({}) has wrong group: {}'.format(name, dirpath, group))
198- self.assertEqual(perms, details.get('perms', 0o755),
199- 'Dir {} ({}) has wrong perms: 0o{:o}'.format(name, dirpath, perms))
200-
201-
202-if __name__ == '__main__':
203- unittest.main()
204
205=== added file 'tests/tests.yaml'
206--- tests/tests.yaml 1970-01-01 00:00:00 +0000
207+++ tests/tests.yaml 2015-10-07 17:47:05 +0000
208@@ -0,0 +1,3 @@
209+reset: false
210+packages:
211+ - amulet
212
213=== removed file 'tests/tests.yaml'
214--- tests/tests.yaml 2015-06-25 17:41:57 +0000
215+++ tests/tests.yaml 1970-01-01 00:00:00 +0000
216@@ -1,10 +0,0 @@
217-# Driver for bundletester: https://github.com/juju-solutions/bundletester
218-#
219-# It may be useful to alter the defaults during manual testing. For example,
220-# set 'reset: false' to reuse existing charms instead of redeploying them.
221-
222-# Allow bootstrap of current env, default: true
223-bootstrap: true
224-
225-# Use juju-deployer to reset env between test, default: true
226-reset: true

Subscribers

People subscribed via source and target branches