rethinkdb / rethinkdb_rebirth

The open-source database for the realtime web.
https://rethinkdb.com
Other
1k stars 42 forks source link

Create prepare_remote_test.py #20

Closed gabor-boros closed 6 years ago

gabor-boros commented 6 years ago

Description

In order to run remote tests on DO nodes, we need to set up a droplet, install rebirthdb, run tests (integration, performance or regression) and clean up after the tests, to not waste resources.

Workflow

  1. Create an "in-memory" ssh key with paramiko
  2. Create an SSH key on DO
  3. Create droplet
  4. Add debian package and install rebirthdb
  5. Create a default configuration file
  6. Start/Restart rebirthdb
  7. Run integration tests
  8. Remove SSH key and droplet

Example output

[2018-08-06T09:32:18.006548]    generating ssh key
[2018-08-06T09:32:18.122468]    create ssh key on DigitalOcean
[2018-08-06T09:32:18.762295]    creating droplet
[2018-08-06T09:32:20.327846]    waiting for droplet to be ready
[2018-08-06T09:32:47.484535]    connecting to droplet
[2018-08-06T09:33:10.783060]    getting rebirthdb
[2018-08-06T09:33:10.783129]    executing source /etc/lsb-release && echo "deb https://dl.bintray.com/floydkots/apt $DISTRIB_CODENAME main" | tee /etc/apt/sources.list.d/rebirthdb.list
[2018-08-06T09:33:11.358472]    executing wget -qO- https://dl.bintray.com/floydkots/keys/pubkey.gpg | apt-key add -
[2018-08-06T09:33:12.392463]    installing rebirthdb
[2018-08-06T09:33:12.392495]    executing apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y rebirthdb
[2018-08-06T09:33:29.986438]    executing echo "bind=all" > /etc/rebirthdb/instances.d/default.conf
[2018-08-06T09:33:30.602472]    restarting rebirthdb
[2018-08-06T09:33:30.602521]    executing /etc/init.d/rebirthdb restart
[2018-08-06T09:33:31.261257]    executing script
======================================================================== test session starts ========================================================================
platform darwin -- Python 2.7.10, pytest-3.7.1, py-1.5.4, pluggy-0.7.1
rootdir: /Users/buco/python/github.com/RebirthDB/rebirthdb-python, inifile: setup.cfg
plugins: xdist-1.22.5, forked-0.2, cov-2.5.1
collected 6 items / 5 deselected

tests/test_repl.py .                                                                                                                                          [100%]

============================================================== 1 passed, 5 deselected in 1.59 seconds ===============================================================
[2018-08-06T09:33:33.259663]    destroying droplet
[2018-08-06T09:33:33.962999]    removing ssh key

Related PR

https://github.com/RebirthDB/rebirthdb-python/pull/19

atris commented 6 years ago

@floydkots Please take a look

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 65


Totals Coverage Status
Change from base Build 58: 0.0%
Covered Lines: 0
Relevant Lines: 0

💛 - Coveralls