-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PROTOTYPE: Running smoketests #110
Conversation
I have to read up a bit on this but I have been wanting to do this. We need to port our smoketests to this. This is great! |
Just so I don't forget, apparently another way people add custom commands to if sys.argv[-1] == "command":
do_stuff() Because as you can see, subclassing the command is kind of annoying |
setup.py
Outdated
import os | ||
|
||
with open(os.devnull, 'wb') as silent: | ||
sp.check_call(['python', 'smoke.py', self.server, self.username, self.password, self.site], stdout=silent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than do it this way, could we do a directory of smoke tests and then run it with python -m unittest smoke
? This would mean we wouldn't need to write our own test runner just to run the smoke tests, then we can have a Base Smoke Test class that reads the arguments from the command line, and all tests derive from that test class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is possible, but I wasn't sure from online docs how to:
- Have a SmokeTestBase that gets the command line args
- Doesn't run under
python setup.py test
-- by default it runs everything named*test*.py
smoke.py
Outdated
import sys | ||
import tableauserverclient as TSC | ||
|
||
server, username, password, site = sys.argv[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, ew.
def main():
# ...
if __name__ == '__main__':
main()
5546b6b
to
f6510d9
Compare
Retiring this PR as it doesn't seem to want to run travisci |
* Fix tableau#117 by only attempting files with the right extension inside the archive (tableau#118) * Commenting and Docstring cleanup. A few very small code cleanups (tableau#120) Add docstrings and remove clutter. I also made some very tiny tweaks to some code for clarity. * Small cleanups for various editors. Play nice with built in test-runners (tableau#121) * Add Py36, update travis to use pycodestyle (tableau#124) * Add `initial sql` and `query band` support (tableau#123) Addresses tableau#109 and tableau#110 * Prep for release of 0.6 (tableau#125) * Prep for release of 0.6 * wordsmithing the changelog
Here's a quick prototype for one way we could add a smoketest command (to run locally, or even on some subset of travisci runs someday).
For simplicity's stake I have the command living in
setup.py
and it just calls asmoke.py
script vis subprocessing -- we could make modules and things and have it be a little integrated, but I wanted something quick to explore the idea.This does run locally against "http://qa-server"!
@RussTheAerialist @LGraber what do you think of the idea?