Merge lp:~mthaddon/mojo/charm-testing-initial into lp:mojo/mojo-specs

Proposed by Tom Haddon
Status: Merged
Merged at revision: 68
Proposed branch: lp:~mthaddon/mojo/charm-testing-initial
Merge into: lp:mojo/mojo-specs
Diff against target: 61 lines (+47/-0)
3 files modified
charm-testing/check-initial-charm (+9/-0)
charm-testing/create-initial-collect (+13/-0)
charm-testing/manifest-initial (+25/-0)
To merge this branch: bzr merge lp:~mthaddon/mojo/charm-testing-initial
Reviewer Review Type Date Requested Status
Junien F Approve
Review via email: mp+337346@code.launchpad.net

Description of the change

If we specify INITIAL_CHARM env variable and use MOJO_MANIFEST_FILE of manifest-initial, start with that charm.

This can be useful for testing new series, for instance - we can create a new version of the charm to test with and do our initial deploy with that rather than the upstream version.

To post a comment you must log in.
Revision history for this message
Junien F (axino) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'charm-testing/check-initial-charm'
2--- charm-testing/check-initial-charm 1970-01-01 00:00:00 +0000
3+++ charm-testing/check-initial-charm 2018-02-08 10:46:52 +0000
4@@ -0,0 +1,9 @@
5+#!/bin/bash
6+
7+if [ -n "$INITAL_CHARM" ]; then
8+ echo "Initial charm set to $INITIAL_CHARM ; proceeding..."
9+ exit 0
10+fi
11+
12+echo "Initial charm (INITIAL_CHARM environment variable) not set. Exiting..."
13+exit 99
14
15=== added file 'charm-testing/create-initial-collect'
16--- charm-testing/create-initial-collect 1970-01-01 00:00:00 +0000
17+++ charm-testing/create-initial-collect 2018-02-08 10:46:52 +0000
18@@ -0,0 +1,13 @@
19+#!/bin/bash
20+
21+# Our expected MOJO_STAGE would be something like 'charm-testing/postgresql' so
22+# this would be set to 'postgresql'
23+CHARM=${MOJO_STAGE##*/}
24+# If we have a charm directory already, let's remove it in case the new
25+# version is a different type (bzr, git, charmstore, etc.)
26+cd ${MOJO_BUILD_DIR}
27+[ -d ${CHARM} ] && rm -rf ${CHARM}
28+# Now create a collect file we can use in the next phase to download the new
29+# charm we want to test
30+cd ${MOJO_SPEC_DIR}/${MOJO_STAGE}
31+echo "${CHARM} ${INITIAL_CHARM}" > collect-initial
32
33=== added file 'charm-testing/manifest-initial'
34--- charm-testing/manifest-initial 1970-01-01 00:00:00 +0000
35+++ charm-testing/manifest-initial 2018-02-08 10:46:52 +0000
36@@ -0,0 +1,25 @@
37+# Collect, pre-deploy (lint, etc.) deploy and check the initial charm
38+# First of all get all other charms for this test
39+collect config=collect
40+# Now get the specific individual charm based on what's specified at run time
41+stop-on return-code=99 config=check-initial-charm INITIAL_CHARM=${INITIAL_CHARM}
42+script config=create-initial-collect INITIAL_CHARM=${INITIAL_CHARM}
43+collect config=collect-inital
44+script config=pre-deploy
45+deploy config=deploy wait=true
46+nagios-check retry=3 sleep=60
47+verify config=post-deploy retry=3 sleep=60
48+# Now test an upgrade to the new charm if UPGRADE_CHARM is set
49+stop-on return-code=99 config=check-upgrade-charm UPGRADE_CHARM=${UPGRADE_CHARM}
50+script config=create-upgrade-collect UPGRADE_CHARM=${UPGRADE_CHARM}
51+collect config=collect-upgrade
52+script config=upgrade-charm
53+juju-check-wait
54+nagios-check retry=3 sleep=60
55+verify config=post-deploy retry=3 sleep=60
56+# Now redeploy the model, and test a deployment from scratch (with the updated charm in place)
57+script config=redeploy-model
58+script config=pre-deploy
59+deploy config=deploy wait=true
60+nagios-check retry=3 sleep=60
61+verify config=post-deploy retry=3 sleep=60

Subscribers

People subscribed via source and target branches

to all changes: