Commits

Mikhail Korobov committed 46e2034

test_project is now using sqlite, test_project2 is now using mysql.

Comments (0)

Files changed (21)

fab_deploy_tests/test_project/config.server.py

 DEBUG = True
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.mysql',
-        'NAME': '{{ DB_NAME }}',
-        'USER': '{{ DB_USER }}',
-        'PASSWORD': '{{ DB_PASSWORD }}',
-        'HOST': '',
-        'PORT': '',
-        'OPTIONS': {
-            "init_command": "SET storage_engine=INNODB"
-        },
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': '{{ DB_NAME }}.sqlite',
     }
 }
 INSTANCE_NAME = '{{ INSTANCE_NAME }}'

fab_deploy_tests/test_project/reqs/basic.txt

 # packages that are widely used and rarely updated
 # PIL
-mysql-python >= 1.2

fab_deploy_tests/test_project2/.git/COMMIT_EDITMSG

-initial commit
+Project is updated to use mysql

fab_deploy_tests/test_project2/.git/index

Binary file modified.

fab_deploy_tests/test_project2/.git/logs/HEAD

 0000000000000000000000000000000000000000 70a846be7991b72791ef556f731fe5fcca74d200 Mikhail Korobov <kmike84@gmail.com> 1299875649 +0500	commit (initial): initial commit
+70a846be7991b72791ef556f731fe5fcca74d200 25614a57709a7bbf22607752714a2a11010055a7 Mikhail Korobov <kmike84@gmail.com> 1303344241 +0600	commit: Project is updated to use mysql

fab_deploy_tests/test_project2/.git/logs/refs/heads/master

 0000000000000000000000000000000000000000 70a846be7991b72791ef556f731fe5fcca74d200 Mikhail Korobov <kmike84@gmail.com> 1299875649 +0500	commit (initial): initial commit
+70a846be7991b72791ef556f731fe5fcca74d200 25614a57709a7bbf22607752714a2a11010055a7 Mikhail Korobov <kmike84@gmail.com> 1303344241 +0600	commit: Project is updated to use mysql

fab_deploy_tests/test_project2/.git/objects/0e/f4e3571e39ea03cad8d4bf1fa213c4bd32072c

Binary file added.

fab_deploy_tests/test_project2/.git/objects/18/6e32b69312e8aebd113dd64b1a9ade78998c24

Binary file added.

fab_deploy_tests/test_project2/.git/objects/25/614a57709a7bbf22607752714a2a11010055a7

Binary file added.

fab_deploy_tests/test_project2/.git/objects/6a/b2f6d5771fb1ec4e976336854fa189f12a5c7d

Binary file added.

fab_deploy_tests/test_project2/.git/objects/85/188dc708c96a019f2e0a034c0107d83060b5f8

Binary file added.

fab_deploy_tests/test_project2/.git/objects/90/d5b9f652acdceeb7bda2bb5624a861189ab9fd

Binary file added.

fab_deploy_tests/test_project2/.git/objects/94/3b21036f11baf1d13b1e4726b75fa51cf40ff1

Binary file added.

fab_deploy_tests/test_project2/.git/objects/af/4e0f959ab56e68cdb09477cc15ecf07d2cc152

Binary file added.

fab_deploy_tests/test_project2/.git/objects/d6/6cd70c6b88f3be6dfad871a76c531de7afdba4

Binary file added.

fab_deploy_tests/test_project2/.git/objects/ea/eb330dbda2097e66871d6da35a7d53ee84ec4b

Binary file added.

fab_deploy_tests/test_project2/.git/refs/heads/master

-70a846be7991b72791ef556f731fe5fcca74d200
+25614a57709a7bbf22607752714a2a11010055a7

fab_deploy_tests/test_project2/fabfile.py

 def foo_site():
     env.hosts = ['foo2@127.0.0.1:2222']
     env.conf = dict(
-        DB_PASSWORD = '123',
         VCS = 'git',
         SERVER_NAME = 'foo.example.com',
+
         SUDO_USER = 'sudouser',
+
+        DB_ROOT_PASSWORD = '123',
+        DB_USER = 'foouser',
+        DB_PASSWORD = 'foo123',
     )
     env.conf.update(LAYOUT_OPTIONS)
     update_env()

fab_deploy_tests/test_project2/requirements.txt

 django==1.2.5
+mysql-python >= 1.2

fab_deploy_tests/test_project2/src/staging_settings.py

 DEBUG = True
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': '{{ DB_NAME }}.sqlite',
+        'ENGINE': 'django.db.backends.mysql',
+        'NAME': '{{ DB_NAME }}',
+        'USER': '{{ DB_USER }}',
+        'PASSWORD': '{{ DB_PASSWORD }}',
+        'OPTIONS': {
+            "init_command": "SET storage_engine=INNODB"
+        },
     }
 }
 INSTANCE_NAME = '{{ INSTANCE_NAME }}'

fab_deploy_tests/tests/deploy.py

     def test_deploy(self):
         # deploy first site
         fab(foo_site)
-        fab(mysql_create_db)
         fab(deploy_project)
 
         # first site works
 
         # deploy second site
         fab(bar_site)
-        fab(mysql_create_db)
         fab(deploy_project)
 
         # second site works
         setup_sudo()
         setup_ssh()
 
+        fab(mysql_create_db)
         fab(deploy_project)
         self.assertResponse(url, 'foo2')
 
         setup_sudo()
         setup_ssh()
 
+        fab(mysql_create_db)
         fab(deploy_project)
         fab(my_push)
         self.assertTrue(before_restart.called)