Package: rube.core
_
 _ __ _   _| |__   ___
| '__| | | | '_ \ / _ \
| |  | |_| | |_) |  __/
|_|   \__,_|_.__/ \___|.corerube.coreis a convenience layer
on top of selenium; the idea was to make it easier to write new integration
tests for our staging infrastructure in a way that looked like normal old
unit tests.Rube is developed by theFedora Infrastructure team.  You can find the tests forourinfrastructure in therube.fedora.  Please feel free to re-userube.coreas you see fit.If you are interested inrunning the Fedora Infrastructure test suite, please
see therube.fedoraREADME.Featuresrube.core provides a number of useful decorators for your tests.@rube.core.tolerant(n=3)tries to run your test.  If it succeeds, it does
nothing more.  If your test fails, it tries again and again (up tontimes, by default 3 times).  If it fails allntimes, the failure is
reported in the test.  This is useful if your connection is flaky, or you
know that one app is sometimes on the fritz.@rube.core.skip_logout()perhaps somewhat obviously will add your test to
a hidden_no_teardownlist.  ThetearDownmethod will skip it when
the time comes.@rube.core.expects_zmqmsg(topic, timeout=20000)will cause rube to start
up a background thread with azmq.SUBsocket.  It will connect to
whatever endpoint you have listed insetup.cfglike this:[zeromq]
tcp://stg.fedoraproject.org:9940If a message does not arrive with the specified multipart prefix before the
timeout has elapsed, then that test will fail.  In Fedora Infrastructure, we
use this to ensure that actions triggered on webapps by rube causefedmsgmessages to be published on our staging gateway.@rube.core.ensures_after(callable)will invokecallableafter your
test has run, giving it a chance to raise an exception.The common use case is to define a callable that executes a shell
command.  For instance, you could have a selenium test that goes to an
account system and applies for a dummy user’s membership in a group.  After
that test has run, your callable could use paramiko to ssh to a machine and
ensure that that user now has shell access (or something).@rube.core.collect_harwill collect HAR performance data on your
websites.  You have to do a little extra work (including setting up
browsermob-proxy) in order to get this work.  See below.Running the tests will open up Firefox in X which is a bit of a pain
sometimes.  If you want, you can run the tests in headless mode by settingheadless=1in setup.cfg.  Doing so will require that you havexorg-x11-server-Xvfbinstalled via yum, however.Collecting HAR files for performance metrics.Rube will output harfile data into aharfiles/directory if you turn oncollect-harand specify apathtobrowsermob-proxyin the[browsermob]section of your setup.cfg
file.You’ll also need to manuallypip installbrowsermob-proxyinto your
virtualenv.  Note thatthis patchis required
to collect HAR files from https sites (such as our entire infrastructure).AuthorsRalph BeanRemy DeCausemakerLuke MackenRicky ElrodGreg JurmanLicenseRube is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.Rube is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along
with Rube. If not, seegnu.org/licenses.