Package: test-ot-ws
All rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, thislist of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentationand/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Description: # Open Tree integration testsThis repository holds integration tests, intended to answer thequestion: "is a new version of the web site good enough to go toproduction?"# InstallationPython 3.5 or higher is recommended (see note below on python2.7 prerequisites).## For end-users:Using a[virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)is probably a wise move (as it is for most work-in-progress python packages).python setup.py install## Tab-completionA bash script is included that provides pretty good tab-completion(including completion to finish arguments that select what test to run).Since there are a lot of tests, it is quite handy to be able to run a subsetof them.Add:source {ABSPATH TO YOUR CLONE OF THIS REPO}/dev/completion.shto your `.bashrc` (or equivalent) to get tab completion of options for the `test-ot-ws`script.## For developers:One time only:virtualenv -p$(which python3) envsource env/bin/activatepython setup developsource dev/activate.shthen add:source {ABSPATH TO YOUR CLONE OF THIS REPO}/env/bin/activatesource {ABSPATH TO YOUR CLONE OF THIS REPO}/dev/activate.shto some script that you source whenever you want to run the tests.Note that the `activate.sh` sources the `completion.sh`, so you won't need to dothat step explicitly.You may need to runpip install -r requirements.txtif the prerequisites of the package change over time.## Python 2.7 supportYou'll need to run:pip install enum34if you are using Python 2.7# UsageThe `test-ot-ws` script is a Python program that tests aspects of the[v2](https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-of-Life-APIs) and[v3](https://github.com/OpenTreeOfLife/germinator/wiki/Open-Tree-of-Life-Web-APIs)versions of the Open Tree of Life web APIs.Details of the tests performed and the results are stored in a scratch directoryat `~/.opentreeoflife/test-ot-ws`## ServicesThe top-level services of the api are `studies`, `taxonomy`, `tnrs`,and `tree_of_life`.Version 0.1.0 of the test software only supports tests of the `taxonomy` and`tnrs` services.The default behavior is to test all of the services that are supported, butyou can specify positional arguments to limit this.So `test-ot-ws` runs all of the test, while `test-ot-ws tnrs` would justrun the `tnrs` tests.## Running a subset of testsThe `--test=` argument can be used to select a test or a subset of tests.Either `--test=XYZ` or `--test=XYZ.` would cause any test that matches the[glob](https://en.wikipedia.org/wiki/Glob_(programming))`XYZ.*` to be run.Note that (at least in version 0.1.0 of the testing tool), the globbingonly works at different levels of the test hierarchies (not within aword).So, `test-ot-ws --test=tnrs.test_contexts.v3` would run a test of the`tnrs/contexts` API function in version 3 of the API, while`test-ot-ws --test=tnrs.test_contexts` would test that method underboth the 2 and 3 versions of the API.## System to testThis is used to specify whether or not the tests run against:* `production` - calls methods on `https://api.opentreeoflife.org` anddoes not support any tests that write* `dev` - calls methods on `https://devapi.opentreeoflife.org`. Whentests that write to databases are added to the repertoire, thenthese can be tried on dev (an additional `--allow-write` argumentwill also be added).* `local` - assumes that you are running the services locally usingthe default configuration. So:* `taxonomy` and `tnrs` tests run against URLs that start with`http://localhost:7474/db/data/ext/`## API-versionThe default is to test both `v2` and `v3` of the API, but either canbe selected by using syntax similar to `--api-vesion=v3`.## ActionsThis argument controls the main action taken by the invocaton.* `test` is the default. This is used to run tests and exit with a returncode that indicates the number of problems encountered.* `retry-failing` runs only the subset of tests that have previouslyfailed.* `report` describes the last run state of each test withoutre-executing any tests.* `curl` writes the HTTP calls made in an already executed test outto standard output as a curl command.* `scan` is rarely (if ever) needed. This is only used by developersto records the list of available tests for better tab-completion. Thislist is autogenerated if a `--test=` argument fails, so it should notbe necessary to run `scan`## --versionreports the version of the testing tool.## --noise=#Specifies the the noisyness level from 0 (silent) up to 5 (tracing ofactions)## --threads=#The number of threads to use when simultaneously running tests.The default is 8. Large choices could overload the server, so be careful.# History of this repoThis code was previously in the [germinator](https://github.com/OpenTreeOfLife/germinator)repository with the individual tests spread out across each ofthe implementation repositories and peyotl as a prerequisite.The goal of this refactoring was for the test repository for integration teststo be standalone and easier to use.Platform: UNKNOWNClassifier: Development Status :: 3 - AlphaClassifier: Intended Audience :: Science/ResearchClassifier: Intended Audience :: DevelopersClassifier: Natural Language :: EnglishClassifier: License :: OSI Approved :: BSD LicenseClassifier: Operating System :: OS IndependentClassifier: Programming Language :: Python :: 2.7Classifier: Programming Language :: Python :: 3.5Classifier: Programming Language :: Python :: 3.6Classifier: Programming Language :: Python :: 3.7Classifier: Topic :: Scientific/Engineering :: Bio-Informatics