Skip to content

Instantly share code, notes, and snippets.

@toolness
Created September 6, 2012 21:17
Show Gist options
  • Select an option

  • Save toolness/3660428 to your computer and use it in GitHub Desktop.

Select an option

Save toolness/3660428 to your computer and use it in GitHub Desktop.
$ ./test/smoke_test.py
15Running smoke test on localhost.
16
17Setting up sample 'tinysmoke' repository.
18
19 $ cd /home/travis/builds/toolness/tinyserv/test
20 $ mkdir tinysmoke
21 $ cd tinysmoke
22 $ git init
23 Initialized empty Git repository in /home/travis/builds/toolness/tinyserv/test/tinysmoke/.git/
24 $ cat <<EOF > package.json
25 > {
26 > "license": "MIT",
27 > "description": "smoke test for tinyserv.",
28 > "engines": {
29 > "node": "0.8.x",
30 > "npm": "1.1.x"
31 > },
32 > "author": "Foo <[email protected]>",
33 > "version": "0.0.1",
34 > "dependencies": {},
35 > "name": "tinyserv-smoketest"
36 > }
37 > EOF
38 $ cat <<EOF > Procfile
39 > web: node app.js
40 > EOF
41 $ cat <<EOF > app.js
42 > var port = process.env['PORT'];
43 > var http = require('http');
44 >
45 > http.createServer(function (req, res) {
46 > res.writeHead(200, {'Content-Type': 'text/plain'});
47 > res.end('foo is ' + process.env['foo']);
48 > }).listen(port, function() {
49 > console.log("listening on port " + port);
50 > });
51 > EOF
52 $ git add package.json Procfile app.js
53 $ git commit -m 'origination'
54 [master (root-commit) 7b43b4a] origination
55 Committer: travis <travis@nettuno.(none)>
56 Your name and email address were configured automatically based
57 on your username and hostname. Please check that they are accurate.
58 You can suppress this message by setting them explicitly:
59
60 git config --global user.name "Your Name"
61 git config --global user.email [email protected]
62
63 After doing this, you may fix the identity used for this commit with:
64
65 git commit --amend --reset-author
66
67 3 files changed, 22 insertions(+)
68 create mode 100644 Procfile
69 create mode 100644 app.js
70 create mode 100644 package.json
71
72Creating tinyserv app on localhost.
73
74 $ tinyserv apps:create
75 Initialized empty Git repository in /home/travis/builds/toolness/tinyserv/test/.tinyserv/repositories/tinysmoke/
76 repository: /home/travis/builds/toolness/tinyserv/test/.tinyserv/repositories/tinysmoke
77 Added remote 'tinyserv'.
78 Remote repository URL is /home/travis/builds/toolness/tinyserv/test/.tinyserv/repositories/tinysmoke.
79
80Deploying app by pushing to localhost.
81
82 $ git push tinyserv master
83 remote: Cloning into '/home/travis/builds/toolness/tinyserv/test/.tinyserv/builds/tinysmoke'...
84 remote: done.
85 remote: Already up-to-date.
86 remote: npm WARN package.json [email protected] No README.md file found!
87 remote: Launching tinysmoke... OK
88 To /home/travis/builds/toolness/tinyserv/test/.tinyserv/repositories/tinysmoke
89 * [new branch] master -> master
90
91Ensuring app is now running.
92
93 $ tinyserv ps
94 tinysmoke running
95
96Obtaining app configuration.
97
98 $ tinyserv config
99 {
100 "cmdline": "node app.js",
101 "commit": null,
102 "description": "smoke test for tinyserv.",
103 "id": "Mon Sep 3 06:03:35 2012",
104 "port": 5001
105 }
106
107Accessing app at http://localhost:5001.
108
109 $ curl http://localhost:5001
110 foo is undefined
111
112Changing app environment.
113
114 $ tinyserv config:set foo=blargey
115 Stopping tinysmoke... OK
116 Configuration updated.
117 Launching tinysmoke... OK
118 $ curl http://localhost:5001
119 foo is blargey
120
121Checking app log.
122
123 $ tinyserv logs
124 Launching node with args ['node', 'app.js'] on Mon Sep 3 06:03:35 2012.
125 listening on port 5001
126 Launching node with args [u'node', u'app.js'] on Mon Sep 3 06:03:36 2012.
127 listening on port 5001
128
129Shutting down app.
130
131 $ tinyserv apps:destroy
132 Destroying project tinysmoke...
133 Stopping tinysmoke... OK
134 Project tinysmoke destroyed.
135 Removed remote 'tinysmoke'.
136 $ cd ..
137 $ rm -rf tinysmoke
138
139Smoke test successful.
140
141
142Done. Build script exited with: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment