diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..df07ef804 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: python +python: + - "2.6" + - "2.7" + +services: mysql + +install: + - python setup.py -q install + +before_script: + - mysql -e 'create database modoboa_test;' + +script: + - PYTHONPATH=tests python -m unittest install_from_scratch diff --git a/tests/install_from_scratch.py b/tests/install_from_scratch.py index 63dec55cd..c166fdb09 100644 --- a/tests/install_from_scratch.py +++ b/tests/install_from_scratch.py @@ -12,27 +12,17 @@ class DeployTest(unittest.TestCase): dbtype = "mysql" dbhost = "localhost" projname = "modoboa_test" - dbuser = "root" - dbpassword = "toto" + dbuser = "travis" + dbpassword = "" def setUp(self): - cmd = "mysqladmin -u %s -p%s create %s" % (self.dbuser, self.dbpassword, self.projname) - code, out = exec_cmd(cmd) - self.assertEqual(code, 0) self.workdir = tempfile.mkdtemp() def tearDown(self): path = os.path.join(self.workdir, self.projname) - code, output = exec_cmd("python manage.py test lib admin limits", cwd=path) + code, output = exec_cmd("python manage.py test lib admin limits postfix_relay_domains", cwd=path) self.assertEqual(code, 0) - if hasattr(self, "workdir"): - shutil.rmtree(self.workdir) - child = pexpect.spawn("mysqladmin -u root -p%s drop %s" % (self.dbpassword, self.projname)) - child.expect("\[y/N\]") - child.sendline("y") - child.expect('Database "%s" dropped' % self.projname) - def test_standard(self): timeout = 2 cmd = "modoboa-admin.py deploy --syncdb --collectstatic %s" % self.projname