Adds deploy flag to runTest

Also fails on bad login credentials or repo name and closes an outstanding issue I opened [Fixes #528]

I tried cherry picking from #506 but I really only used one line and didn't want to clutter the commit history with a lot of insertions that were immediately deleted