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
=== added file 'charm-testing/check-initial-charm'
--- charm-testing/check-initial-charm 1970-01-01 00:00:00 +0000
+++ charm-testing/check-initial-charm 2018-02-08 10:46:52 +0000
@@ -0,0 +1,9 @@
1#!/bin/bash
2
3if [ -n "$INITAL_CHARM" ]; then
4 echo "Initial charm set to $INITIAL_CHARM ; proceeding..."
5 exit 0
6fi
7
8echo "Initial charm (INITIAL_CHARM environment variable) not set. Exiting..."
9exit 99
010
=== added file 'charm-testing/create-initial-collect'
--- charm-testing/create-initial-collect 1970-01-01 00:00:00 +0000
+++ charm-testing/create-initial-collect 2018-02-08 10:46:52 +0000
@@ -0,0 +1,13 @@
1#!/bin/bash
2
3# Our expected MOJO_STAGE would be something like 'charm-testing/postgresql' so
4# this would be set to 'postgresql'
5CHARM=${MOJO_STAGE##*/}
6# If we have a charm directory already, let's remove it in case the new
7# version is a different type (bzr, git, charmstore, etc.)
8cd ${MOJO_BUILD_DIR}
9[ -d ${CHARM} ] && rm -rf ${CHARM}
10# Now create a collect file we can use in the next phase to download the new
11# charm we want to test
12cd ${MOJO_SPEC_DIR}/${MOJO_STAGE}
13echo "${CHARM} ${INITIAL_CHARM}" > collect-initial
014
=== added file 'charm-testing/manifest-initial'
--- charm-testing/manifest-initial 1970-01-01 00:00:00 +0000
+++ charm-testing/manifest-initial 2018-02-08 10:46:52 +0000
@@ -0,0 +1,25 @@
1# Collect, pre-deploy (lint, etc.) deploy and check the initial charm
2# First of all get all other charms for this test
3collect config=collect
4# Now get the specific individual charm based on what's specified at run time
5stop-on return-code=99 config=check-initial-charm INITIAL_CHARM=${INITIAL_CHARM}
6script config=create-initial-collect INITIAL_CHARM=${INITIAL_CHARM}
7collect config=collect-inital
8script config=pre-deploy
9deploy config=deploy wait=true
10nagios-check retry=3 sleep=60
11verify config=post-deploy retry=3 sleep=60
12# Now test an upgrade to the new charm if UPGRADE_CHARM is set
13stop-on return-code=99 config=check-upgrade-charm UPGRADE_CHARM=${UPGRADE_CHARM}
14script config=create-upgrade-collect UPGRADE_CHARM=${UPGRADE_CHARM}
15collect config=collect-upgrade
16script config=upgrade-charm
17juju-check-wait
18nagios-check retry=3 sleep=60
19verify config=post-deploy retry=3 sleep=60
20# Now redeploy the model, and test a deployment from scratch (with the updated charm in place)
21script config=redeploy-model
22script config=pre-deploy
23deploy config=deploy wait=true
24nagios-check retry=3 sleep=60
25verify config=post-deploy retry=3 sleep=60

Subscribers

People subscribed via source and target branches

to all changes: