← Back to team overview

wordpress-charmers team mailing list archive

[Merge] ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:image-builder-tests into charm-k8s-wordpress:master

 

Tom Haddon has proposed merging ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:image-builder-tests into charm-k8s-wordpress:master.

Commit message:
Updates tests to pass since merging image-building branch

Requested reviews:
  Wordpress Charmers (wordpress-charmers)

For more details, see:
https://code.launchpad.net/~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress/+merge/394883

Updates tests to pass since merging image-building branch
-- 
Your team Wordpress Charmers is requested to review the proposed merge of ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:image-builder-tests into charm-k8s-wordpress:master.
diff --git a/Dockerfile b/Dockerfile
index ace57f9..0994203 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -66,7 +66,7 @@ RUN curl -o wordpress.tar.gz -fSL "https://wordpress.org/latest.tar.gz"; \
     && mv /usr/src/wordpress /var/www/html
 
 COPY ./image-builder/files/ /files/
-COPY ./image-builder/fetcher.py .
+COPY ./image-builder/src/fetcher.py .
 RUN mkdir -p /files/themes /files/plugins
 RUN ./fetcher.py
 # Copy our collected themes and plugins into the appropriate paths
diff --git a/image-builder/fetcher.py b/image-builder/src/fetcher.py
similarity index 71%
rename from image-builder/fetcher.py
rename to image-builder/src/fetcher.py
index 5ce0b50..a2af005 100755
--- a/image-builder/fetcher.py
+++ b/image-builder/src/fetcher.py
@@ -46,24 +46,45 @@ zip_plugins_to_get = {
 
 branch_plugins_to_get = {
     # please keep these in alphabetical order
-    'launchpad-integration': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress-launchpad-integration/+git/wordpress-launchpad-integration'},
-    'openstack-objectstorage': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/openstack-objectstorage-k8s'},
-    'teams-integration': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress-teams-integration/+git/wordpress-teams-integration'},
-    'xubuntu-team-members': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-plugin-xubuntu-team-members'},
+    'launchpad-integration': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress-launchpad-integration/+git/'
+               'wordpress-launchpad-integration'
+    },
+    'openstack-objectstorage': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/openstack-objectstorage-k8s'
+    },
+    'teams-integration': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress-teams-integration/+git/'
+               'wordpress-teams-integration'
+    },
+    'xubuntu-team-members': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-plugin-xubuntu-team-members'
+    },
 }
 
 branch_themes_to_get = {
     # please keep these in alphabetical order
     'fruitful': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-fruitful'},
-    'light-wordpress-theme': {'url': 'https://git.launchpad.net/~canonical-sysadmins/ubuntu-community-webthemes/+git/light-wordpress-theme'},
+    'light-wordpress-theme': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/ubuntu-community-webthemes/+git/light-wordpress-theme'
+    },
     'mscom': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-mscom'},
     'twentyeleven': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-twentyeleven'},
-    'ubuntu-cloud-website': {'url': 'https://git.launchpad.net/~canonical-sysadmins/ubuntu-cloud-website/+git/ubuntu-cloud-website'},
-    'ubuntu-community': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-ubuntu-community'},
-    'ubuntu-community-wordpress-theme': {'url': 'https://git.launchpad.net/~canonical-sysadmins/ubuntu-community-wordpress-theme/+git/ubuntu-community-wordpress-theme'},
+    'ubuntu-cloud-website': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/ubuntu-cloud-website/+git/ubuntu-cloud-website'
+    },
+    'ubuntu-community': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-ubuntu-community'
+    },
+    'ubuntu-community-wordpress-theme': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/ubuntu-community-wordpress-theme/+git/'
+               'ubuntu-community-wordpress-theme'
+    },
     'ubuntu-fi-new': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-ubuntu-fi'},
     'ubuntu-light': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-ubuntu-light'},
-    'ubuntustudio-wp': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-ubuntustudio-wp'},
+    'ubuntustudio-wp': {
+        'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-ubuntustudio-wp'
+    },
     'wordpress_launchpad': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-launchpad'},
     'xubuntu-theme': {'url': 'https://git.launchpad.net/~canonical-sysadmins/wordpress/+git/wp-theme-xubuntu-website'},
 }
diff --git a/image-builder/tests/unit/test_plugin_hander.py b/image-builder/tests/unit/test_plugin_hander.py
index 86f353b..e9b8f8c 100644
--- a/image-builder/tests/unit/test_plugin_hander.py
+++ b/image-builder/tests/unit/test_plugin_hander.py
@@ -1,17 +1,14 @@
-import os
-import sys
 import unittest
 from unittest import mock
 
-sys.path.append(os.path.join("..", "..", os.path.dirname(__file__)))
-from files import plugin_handler  # NOQA: E402
+import plugin_handler
 
 
 class testWrapper(unittest.TestCase):
     def setUp(self):
         self.maxDiff = None
 
-    @mock.patch("files.plugin_handler.logging")
+    @mock.patch("plugin_handler.logging")
     def test_team_mapper(self, foo):
         given = ",".join(
             [
diff --git a/image-builder/tox.ini b/image-builder/tox.ini
index 3074485..0cad7e3 100644
--- a/image-builder/tox.ini
+++ b/image-builder/tox.ini
@@ -18,10 +18,10 @@ deps = flake8
 
 [testenv:unit]
 commands =
-    pytest {posargs:-v  --cov=. --cov-report=term-missing --cov-branch}
+    pytest {posargs:-v --cov=src --cov=files --cov-report=term-missing --cov-branch}
 deps = -r{toxinidir}/tests/unit/requirements.txt
 setenv =
-  PYTHONPATH={toxinidir}/lib
+  PYTHONPATH={toxinidir}/src:{toxinidir}/files
   TZ=UTC
 
 [flake8]
diff --git a/tox.ini b/tox.ini
index 6b43ea1..0736115 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,7 @@ passenv =
 
 [testenv:unit]
 commands =
-    pytest --ignore mod --ignore {toxinidir}/tests/integration \
+    pytest --ignore image-builder --ignore {toxinidir}/tests/integration \
       {posargs:-v  --cov=src --cov-report=term-missing --cov-branch}
 deps = -r{toxinidir}/tests/unit/requirements.txt
        -r{toxinidir}/requirements.txt

Follow ups