@@ -31,15 +31,25 @@ def setUpClass(cls):
3131 child .expect ("created {}.*to scale a basic formation" .format (
3232 cls .formation ))
3333 child .expect (pexpect .EOF )
34- # TODO: scale the formation runtime=1
34+ # scale the formation runtime=1
35+ child = pexpect .spawn ("{} nodes:scale {} runtime=1" .format (
36+ DEIS , cls .formation ), timeout = 10 * 60 )
37+ child .expect ('Scaling nodes...' )
38+ child .expect (r'done in \d+s' )
39+ child .expect (pexpect .EOF )
3540
3641 @classmethod
3742 def tearDownClass (cls ):
38- # TODO: scale formation runtime=0
43+ # scale formation runtime=0
44+ child = pexpect .spawn ("{} nodes:scale {} runtime=0" .format (
45+ DEIS , cls .formation ), timeout = 3 * 60 )
46+ child .expect ('Scaling nodes...' )
47+ child .expect (r'done in \d+s' )
48+ child .expect (pexpect .EOF )
3949 # destroy the formation
4050 child = pexpect .spawn ("{} formations:destroy {} --confirm={}" .format (
4151 DEIS , cls .formation , cls .formation ))
42- child .expect ('done in ' , timeout = 5 * 60 )
52+ child .expect ('done in ' , timeout = 5 * 60 )
4353 child .expect (pexpect .EOF )
4454 purge (cls .username , cls .password )
4555
@@ -51,25 +61,37 @@ def _test_example(self, repo_name):
5161 # create an App
5262 child = pexpect .spawn ("{} create --formation={}" .format (
5363 DEIS , self .formation ))
54- child .expect ('done, created (?P<name>[-_\w]+)' )
64+ child .expect ('done, created (?P<name>[-_\w]+)' , timeout = 3 * 60 )
5565 app = child .match .group ('name' )
5666 try :
5767 child .expect ('Git remote deis added' )
5868 child .expect (pexpect .EOF )
5969 child = pexpect .spawn ('git push deis master' )
6070 # check git output for repo_type, e.g. "Clojure app detected"
61- child .expect ("{} app detected" .format (repo_type ), timeout = 2 * 60 )
62- child .expect (' -> master' , timeout = 10 * 60 )
63- child .expect (pexpect .EOF , timeout = 2 * 60 )
64- # TODO: scale up runtime nodes in setUpClass, then
65- # actually fetch the URL with curl and check the output
66- # TODO: `deis config:set POWERED_BY="Automated Testing"`
71+ # TODO: for some reason, the next regex times out...
72+ # child.expect("{} app detected".format(repo_type), timeout=5 * 60)
73+ child .expect ('Launching... ' , timeout = 10 * 60 )
74+ child .expect ('deployed to Deis(?P<url>.+)To learn more' , timeout = 3 * 60 )
75+ url = child .match .group ('url' )
76+ child .expect (' -> master' )
77+ child .expect (pexpect .EOF , timeout = 2 * 60 )
78+ # fetch the URL with curl and check the output
79+ child = pexpect .spawn ("curl -s {}" .format (url ))
80+ child .expect ('Powered by Deis' )
81+ child .expect (pexpect .EOF )
82+ # `deis config:set POWERED_BY="Automated Testing"`
83+ child = pexpect .spawn (
84+ "{} config:set POWERED_BY='Automated Testing'" .format (DEIS ))
85+ child .expect (pexpect .EOF , timeout = 3 * 60 )
6786 # then re-fetch the URL with curl and recheck the output
87+ child = pexpect .spawn ("curl -s {}" .format (url ))
88+ child .expect ('Powered by Automated Testing' )
89+ child .expect (pexpect .EOF )
6890 finally :
6991 # destroy the app
7092 child = pexpect .spawn (
7193 "{} apps:destroy --app={} --confirm={}" .format (DEIS , app , app ),
72- timeout = 5 * 60 )
94+ timeout = 5 * 60 )
7395 child .expect ('Git remote deis removed' )
7496 child .expect (pexpect .EOF )
7597
0 commit comments