Merge lp:~tcuthbert/mojo/mojo-specs-wp-k8s into lp:mojo/mojo-specs

Proposed by Thomas Cuthbert
Status: Rejected
Rejected by: Haw Loeung
Proposed branch: lp:~tcuthbert/mojo/mojo-specs-wp-k8s
Merge into: lp:mojo/mojo-specs
Diff against target: 89 lines (+64/-0)
5 files modified
charm-testing/wordpress/bundle.yaml (+17/-0)
charm-testing/wordpress/collect (+1/-0)
charm-testing/wordpress/manage-ci-db (+34/-0)
charm-testing/wordpress/manifest (+5/-0)
charm-testing/wordpress/run_tests.sh (+7/-0)
To merge this branch: bzr merge lp:~tcuthbert/mojo/mojo-specs-wp-k8s
Reviewer Review Type Date Requested Status
Mojo Maintainers Pending
Review via email: mp+386662@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tom Haddon (mthaddon) wrote :

One comment about the WORKSPACE variable

Unmerged revisions

164. By Thomas Cuthbert

Initial wordpress kubernetes charm tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'charm-testing/wordpress'
2=== added file 'charm-testing/wordpress/bundle.yaml'
3--- charm-testing/wordpress/bundle.yaml 1970-01-01 00:00:00 +0000
4+++ charm-testing/wordpress/bundle.yaml 2020-07-01 09:48:01 +0000
5@@ -0,0 +1,17 @@
6+bundle: kubernetes
7+applications:
8+ wordpress-k8s:
9+ scale: 2
10+ #channel: edge
11+ #charm: cs:~wordpress-charmers/kubernetes/wordpress
12+ #charm: {{charm_dir}}/wordpress
13+ options:
14+ wp_plugin_openid_team_map: canonical-sysadmins=administrator
15+ blog_hostname: ci-blog.admin.canonical.com
16+ image: "prod-is-external.docker-registry.canonical.com/wordpress:{{series}}-latest"
17+ initial_settings: |
18+ user_name: admin
19+ admin_email: devnull@canonical.com
20+ weblog_title: CI IS Test Blog
21+ blog_public: False
22+
23
24=== added file 'charm-testing/wordpress/collect'
25--- charm-testing/wordpress/collect 1970-01-01 00:00:00 +0000
26+++ charm-testing/wordpress/collect 2020-07-01 09:48:01 +0000
27@@ -0,0 +1,1 @@
28+wordpress cs:~tcuthbert/kubernetes/wordpress;channel=edge
29
30=== added file 'charm-testing/wordpress/manage-ci-db'
31--- charm-testing/wordpress/manage-ci-db 1970-01-01 00:00:00 +0000
32+++ charm-testing/wordpress/manage-ci-db 2020-07-01 09:48:01 +0000
33@@ -0,0 +1,34 @@
34+#!/usr/bin/env bash
35+
36+set -eu
37+
38+MOJO_SECRETS="/srv/mojo/LOCAL/${MOJO_PROJECT?}/${MOJO_STAGE?}/secrets.yaml"
39+DB_NAME="wordpress_ci"
40+DB_USER="$(grep db_user "${MOJO_SECRETS?}" | cut -f2 -d':' | sed 's/^ //')"
41+DB_HOST="$(grep db_host "${MOJO_SECRETS?}" | cut -f2 -d':' | sed 's/^ //')"
42+
43+
44+ci_db_password () {
45+ echo -n "$(grep db_password "${MOJO_SECRETS?}" | cut -f2 -d':' | sed 's/^ //')"
46+}
47+
48+
49+setup_ci_db () {
50+ teardown_ci_db 2>/dev/null || true
51+ mysql -u"${DB_USER?}" -p"$(ci_db_password)" -h "${DB_HOST?}" -e "CREATE database ${DB_NAME?};"
52+}
53+
54+
55+teardown_ci_db () {
56+ mysql -u"${DB_USER?}" -p"$(ci_db_password)" -h "${DB_HOST?}" -e "DROP database ${DB_NAME?};"
57+}
58+
59+
60+if [[ "${ACTION?}" == "setup" ]]; then
61+ setup_ci_db
62+elif [[ "${ACTION?}" == "teardown" ]]; then
63+ teardown_ci_db
64+else
65+ echo "manage-ci-db requires the "'$ACTION'" environmental variable to either be 'setup' or 'teardown'."
66+ exit -1
67+fi
68
69=== added file 'charm-testing/wordpress/manifest'
70--- charm-testing/wordpress/manifest 1970-01-01 00:00:00 +0000
71+++ charm-testing/wordpress/manifest 2020-07-01 09:48:01 +0000
72@@ -0,0 +1,5 @@
73+collect
74+script config=manage-ci-db ACTION=setup
75+bundle config=bundle.yaml local=secrets.yaml
76+script config=run_tests.sh
77+script config=manage-ci-db ACTION=teardown
78
79=== added file 'charm-testing/wordpress/run_tests.sh'
80--- charm-testing/wordpress/run_tests.sh 1970-01-01 00:00:00 +0000
81+++ charm-testing/wordpress/run_tests.sh 2020-07-01 09:48:01 +0000
82@@ -0,0 +1,7 @@
83+#!/bin/bash
84+export HTTP_PROXY="https://squid.internal:3128/"
85+export HTTPS_PROXY="https://squid.internal:3128/"
86+export WORKSPACE="/srv/mojo/LOCAL/$MOJO_PROJECT/$MOJO_STAGE"
87+
88+cd $MOJO_REPO_DIR/$MOJO_SERIES/wordpress
89+make test

Subscribers

People subscribed via source and target branches

to all changes: