tests: add tests for build-dir
This commit is contained in:
1 parent
2580ad305c
commit
d4016223d5
5 files changed
+74
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
web: python3 web.py
|
||||||
|
release: python3 release.py
|
||||||
Whitespace-only changes.
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("SECRET_KEYS: {0}".format(os.getenv('SECRET_KEY')))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import http.server
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
class GetHandler(http.server.BaseHTTPRequestHandler):
|
||||||
|
def do_GET(self):
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
||||||
|
self.end_headers()
|
||||||
|
|
||||||
|
if self.path == '/':
|
||||||
|
self.wfile.write("python/http.server".encode("utf-8"))
|
||||||
|
else:
|
||||||
|
data = json.dumps(dict(os.environ), sort_keys=True, indent=4)
|
||||||
|
self.wfile.write(data.encode("utf-8"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
port = int(os.getenv("PORT", 5000))
|
||||||
|
server = http.server.HTTPServer(("0.0.0.0", port), GetHandler)
|
||||||
|
print("Listening on port {0}".format(port))
|
||||||
|
server.serve_forever()
|
||||||
@@ -187,3 +187,42 @@ teardown() {
|
|||||||
assert_success
|
assert_success
|
||||||
assert_line 0 "herokuish"
|
assert_line 0 "herokuish"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(builder:set)" {
|
||||||
|
run deploy_app python
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku builder:set $TEST_APP build-dir nonexistent-app"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_failure
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku builder:set $TEST_APP build-dir sub-app"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains 'SECRET_KEYS:'
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku builder:set $TEST_APP build-dir"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains 'SECRET_KEY:'
|
||||||
|
}
|
||||||
Reference in new issue
Block a user