Skip to content

Conversation

@t8y8
Copy link
Collaborator

@t8y8 t8y8 commented Dec 8, 2016

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 a smoke.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?

@LGraber
Copy link
Contributor

LGraber commented Dec 9, 2016

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!

@t8y8
Copy link
Collaborator Author

t8y8 commented Dec 15, 2016

Just so I don't forget, apparently another way people add custom commands to setup.py is to be lazy and do this:

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)
Copy link
Contributor

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.

Copy link
Collaborator Author

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:

  1. Have a SmokeTestBase that gets the command line args
  2. 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:]
Copy link
Contributor

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()

@t8y8 t8y8 force-pushed the feature-livetests branch from 5546b6b to f6510d9 Compare February 2, 2017 19:13
@t8y8
Copy link
Collaborator Author

t8y8 commented Feb 2, 2017

Retiring this PR as it doesn't seem to want to run travisci

@t8y8 t8y8 closed this Feb 2, 2017
bryceglarsen pushed a commit to bryceglarsen/server-client-python that referenced this pull request Dec 28, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants