diff --git a/README.md b/README.md index 88d1c4e788b3a384deaa93e31129c749c58ed975..ddb70bcc87161689bcca6901a751d4354f399ee0 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,36 @@ should be run against all language ports of the adapter A set of fixtures to be used to configure the tests. -### Implementations +## Implementations You can see existing implementations of the test suite here - [JS-Cucumber](https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-javascript) -Step definitions are in `test/cucumber` \ No newline at end of file +Step definitions are in `test/cucumber` + +## Installing + +The intention is to install a tagged version of the testsuite into each adapter so that if we develop +the testsuite existing adapter implementations won't break. + +### NPM + +```bash +npm install --saveDev git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-testsuite.git#[tag|branch|commit] +``` + +### Yarn + +```bash +yarn add --dev git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-testsuite.git#[tag|branch|commit] +``` + +### PIP + +```bash +echo +"git+https://git.noc.ac.uk/communications-backbone-system/backbone-adapter-testsuite.git@[tag|branch|commit]#egg=backbone-adapter-testsuite" >> requirements.txt +pip install -r reqiurements.txt +# copy features and fixtures into test directory +copy_tests +``` diff --git a/copy_tests.py b/copy_tests.py new file mode 100644 index 0000000000000000000000000000000000000000..631c83117177a9810406e1131eaef7fe204efabe --- /dev/null +++ b/copy_tests.py @@ -0,0 +1,25 @@ +import os +from shutil import copytree +import site + + +def copy_directory(src, dest, directory): + copytree(os.path.join(src, directory), os.path.join(dest, directory)) + + +def copy(): + here = os.getcwd(); + package_locations = site.getsitepackages() + + for root_path in package_locations: + dirs = [x[0] for x in os.walk(root_path)] + for dirx in dirs: + if dirx.endswith('testsuite'): + src = dirx + dest = os.path.join(here, 'test') + copy_directory(src, dest, 'features') + copy_directory(src, dest, 'fixtures') + + +if __name__ == '__main__': + copy() \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..a8aeb66e297d4cc00b2a3a959536d842f9ec6b7e --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[options.entry_points] +console_scripts= + copy_tests = testsuite.copy_tests:copy \ No newline at end of file diff --git a/setup.py b/setup.py index 6e8bc2e8bea6275b8a0c7df03e8432fb0745c298..b025934aa2d98dc14581deb0665f623266d8a088 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( - name='backbone-adapter-testsuite', + name='backbone_adapter_testsuite', packages=['testsuite'], package_dir={ 'testsuite': '.',