Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Add a test module against a real running server #131

Merged
merged 4 commits into from Mar 25, 2015

Conversation

gst
Copy link
Contributor

@gst gst commented Mar 23, 2015

This PR brings basically 2 things:

  • Add a "client_test_with_server.py" test module, that will upon execution, launch a fresh influxdb server instance in a temporary place.
  • Correct few detected bad things in the client code itself.

any comments ?

client_test_with_server.py could now easily be extended with others (more complex) test cases..

shutil.rmtree(self.influxd_temp_dir_base)


class TestClientWithNoServer(unittest.TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those tests already exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectively, had done a copy of client_test.py to start this one.. ;)
how about making client_test.py renamed to client_tests_without_server.py, and this one renamed to client_tests_with_server.py and also effectively remove this from here ?
or just rename this one to client_tests_with_server.py to insist enough ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if you renamed the new file to client_tests_with_server.py and keep the current one as it is.

@aviau
Copy link
Collaborator

aviau commented Mar 24, 2015

Very good job @gst :) This is awesome.

  • I wouldn't build from source. The lib tries to target the last InfluxDB release, not master. This would also take out some of the complexity of your PR. I would prefer if you just wget a .deb and install it. We could change the link whenever we want to target a new release.
  • The tests don't work on Travis yet
  • There is still only two flake8 errors.

@gst
Copy link
Contributor Author

gst commented Mar 24, 2015

don't merge this already so, I'll also do a slight change in real_client_test (among its probable rename).
g.

@gst
Copy link
Contributor Author

gst commented Mar 24, 2015

I wouldn't build from source.

I wanted to be sure to also have some tests against the latest master server version here, so that's the reason.

The lib tries to target the last InfluxDB release, not master.

Right, but this greatly helps to keep up to date with influxdb server master so, that's what I simply wanted to get at the initial stage in fact, and I've added this to the PR so to have it right there for the (near) future ;)

This would also take out some of the complexity of your PR.

relative complexity ;) that's just an install of ruby and few others packages, a gem install and a build & deb install finally, and within the tests a creation and start of a fresh server instance also. Advanced but not complex :p

I would prefer if you just wget a .deb and install it. We could change the link whenever we want to target a new release.

That's the other possibility I've also think about. Not sure it's better..

@gst
Copy link
Contributor Author

gst commented Mar 24, 2015

I have also missed that the deb fails to install damn.. will check that also..

@@ -12,6 +12,7 @@ env:
install:
- sudo pip install tox
- sudo pip install coveralls
- ./build_influxdb_server.sh || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the || true ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause wasn t sure of need of command to return exit code of true (0) to continue test run..

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove it?

@aviau
Copy link
Collaborator

aviau commented Mar 24, 2015

The tests now work on Travis :)

@aviau
Copy link
Collaborator

aviau commented Mar 24, 2015

Next time, please don't put unrelated changes in the same PR.

The ''Random python fixes" should not be in the same PR as the integration tests.

@gst
Copy link
Contributor Author

gst commented Mar 24, 2015

You would make separate pr for each "pythonic" change ? (There was about 3 hère)

@aviau
Copy link
Collaborator

aviau commented Mar 24, 2015

Yes

If its not too much trouble for you, one PR for each change is best, but one PR for the integration tests and one pr for "pythonic changes" would have been fine. Don't worry about it for this PR tho.

@gst
Copy link
Contributor Author

gst commented Mar 25, 2015

Yes

ok then ;)

I'm splitting this one in 2 PR : this one but "cleaned" ; and one for each "pythonic" change unrelated to this test_client_with_server.py and I'll rebase this one without thoses changes so.

stay tuned..

@gst
Copy link
Contributor Author

gst commented Mar 25, 2015

@ReAzem : if you are ok to merge the "pythonic" PR (#133) first ?
I'll then rebase this one on it. (hmm, maybe i can already do it in fact, gonna try..)

@aviau
Copy link
Collaborator

aviau commented Mar 25, 2015

I'll be merging #133 in a few mins when the tests are done.

@gst gst force-pushed the build_and_install_server branch from 715f8e4 to 9ae38d3 Compare March 25, 2015 14:28
@aviau
Copy link
Collaborator

aviau commented Mar 25, 2015

You should be able to rebase now.

Grégory Starck added 4 commits March 25, 2015 10:53
By *real* we mean : one which really connect to a server instance.
So to be able to run client_test_with_server.py.
@gst gst force-pushed the build_and_install_server branch from 9ae38d3 to b00409a Compare March 25, 2015 14:54
@gst
Copy link
Contributor Author

gst commented Mar 25, 2015

rebased,
should just pass.. (if i've not forgotten some thing(s))

@aviau
Copy link
Collaborator

aviau commented Mar 25, 2015

Oh yeah! Thats a clean PR ;)

@gst
Copy link
Contributor Author

gst commented Mar 25, 2015

that's better/cleaner effectively ;)
don't know why but the list of commits here appears in another order than in the branch :?

@aviau
Copy link
Collaborator

aviau commented Mar 25, 2015

don't know why but the list of commits here appears in another order than in the branch :?

don't worry about it.

For some reason GitHub history can be pretty hard to read. I still don't know if they list commits in "author" or in "apply" order.

aviau added a commit that referenced this pull request Mar 25, 2015
Add a test module against a real running server (Thanks @gst!)
@aviau aviau merged commit a3c383e into influxdata:master Mar 25, 2015
@aviau
Copy link
Collaborator

aviau commented Mar 25, 2015

Thank you! :)

@aviau aviau deleted the build_and_install_server branch March 25, 2015 18:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants