Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from mpsonntag/deptests
Add dependent library release test scripts
- Loading branch information
Showing
31 changed files
with
10,795 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## python-odml convenience scripts | ||
|
||
This folder contains convenience scripts for build and deployment tests and should not be part of any release. Check the README files in the specific folders for details. | ||
|
||
The `release_tests` folder contains scripts and resources to test the odML library and all its dependent libraries like odmltools, odmlui, odmlconverter and nix-odml-converter from a local odML installation, from Test-PyPI and PyPI packages. | ||
The local version tests the installation via `pip install .` and `python setup.py install`. The Test-PyPI and PyPI package tests use conda environments to test the installation with all Python versions >= 3.5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# odml and odml dependent libraries installation tests | ||
|
||
Used to document the minimal automated tests for `python-odml` and `odmltools` and not fully automated tests of `odml-ui` installations with a special focus on the execution of command line scripts and gui with different local installation methods. | ||
|
||
## Automated odml and dependent library tests | ||
|
||
The tests include | ||
- basic odml import and file loading and saving | ||
- `odml` command line script execution using realistic example files | ||
- odmlview | ||
- odmltordf | ||
- odmlconversion | ||
- `odmltools` command line script execution | ||
- odmlimportdatacite | ||
- basic odml-ui installation | ||
|
||
### Local installation tests | ||
|
||
To test the various local installations of odml, execute `run_test_matrix.sh` with option 'A'. odml will be installed into fresh conda environments using `pip install .` and `python setup.py install` and all Python versions >= 3.5. | ||
|
||
### odml PyPI TEST installation tests | ||
|
||
To test the installation of the odml package from the PyPI TEST repository, execute `run_test_matrix.sh` with option 'B'. odml will be installed into fresh conda environments using `pip install odml` and all Python versions >= 3.5. | ||
The package `odml-ui` will be installed as well and all installable odml command line scripts will be tested after the odml installation. | ||
|
||
### odmltools PyPI server installation tests | ||
|
||
When executing `run_test_matrix.sh` with option 'C', the odml dependent package `odmltools` will be pip installed into fresh conda environments for all Python versions >= 3.6 from the PyPI TEST repository and appropriate conversion tests will be run using the installed command line tool. | ||
|
||
### nixodmlconverter PyPI TEST installation tests | ||
|
||
When executing `run_test_matrix.sh` with option 'D' the odml dependent package `nixodmlconverter` will be pip installed into fresh conda environments for all Python versions >= 3.6 from the PyPI TEST repository and appropriate conversion tests will be run using the installed command line tool. | ||
|
||
### odml PyPI LIVE installation tests | ||
|
||
To test the installation of the odml package from PyPI proper, execute `run_test_matrix.sh` with option 'E'. odml will be installed into fresh conda environments using `pip install odml` and all Python versions >= 3.5. | ||
The package `odml-ui` will be installed as well and all installable odml command line scripts will be tested after the odml installation. | ||
|
||
## Manual odml-ui tests | ||
|
||
To set up conda environments and run local or PyPI TEST installations run the script `run_test_matrix.sh` with option `B` from the current directory. | ||
Once set up, the conda environments can be used to manually test `odml-ui` as well. | ||
|
||
Activate python installation environment | ||
|
||
CONDA_ENV_SETUP=pyinst | ||
CONDA_ENV_PIP=pipinst | ||
ROOT_DIR=$(pwd) | ||
cd $ROOT_DIR/resources/test_load | ||
conda activate ${CONDA_ENV_SETUP} | ||
odmlui | ||
|
||
Run the following most tests: | ||
- open `test_load\load_v1.odml.xml` | ||
- check fail message | ||
- import `test_load\load_v1.odml.xml` | ||
- save as `pyi_conv.xml` | ||
- save as `pyi_conv.yaml` | ||
- save as `pyi_conv.json` | ||
- open `pyi_conv.xml` | ||
- open `pyi_conv.yaml` | ||
- open `pyi_conv.json` | ||
- check importing a terminology using the document wizard | ||
|
||
Exit and switch to pip environment | ||
|
||
conda deactivate | ||
conda activate ${CONDA_ENV_PIP} | ||
odmlui | ||
|
||
Run manual tests again | ||
|
||
Test odmltables plugin | ||
|
||
pip install odmltables | ||
pip install odmltables[gui] | ||
odmlui | ||
|
||
Run the following minimal tests | ||
- open `pyi_conv.xml` | ||
- use odmltables `convert` button, save as csv file | ||
- use odmltables `filter` button | ||
|
||
Exit, move back to the root and cleanup | ||
|
||
cd $ROOT_DIR | ||
conda deactivate | ||
rm $ROOT_DIR/resources/test_load/load_v1.odml_converted.xml | ||
rm $ROOT_DIR/resources/test_load/pyi_conv.json | ||
rm $ROOT_DIR/resources/test_load/pyi_conv.xml | ||
rm $ROOT_DIR/resources/test_load/pyi_conv.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import sys | ||
import unittest | ||
|
||
try: | ||
# Test possible imports of all parsers without importing the full odML package | ||
from odml.tools import ODMLReader, ODMLWriter, RDFReader, RDFWriter | ||
from odml.tools.converters import FormatConverter, VersionConverter | ||
from odml.tools import XMLReader, XMLWriter, DictReader, DictWriter | ||
|
||
import odml | ||
except Exception as exc: | ||
print("-- Failed on an import: %s" % exc) | ||
sys.exit(-1) | ||
|
||
|
||
class TestODMLBasics(unittest.TestCase): | ||
|
||
def test_load(self): | ||
print("-- Load odml xml file") | ||
xdoc = odml.load('./load.odml.xml') | ||
print(xdoc.pprint()) | ||
|
||
print("-- Load odml json file") | ||
jdoc = odml.load('./load.odml.json', 'JSON') | ||
self.assertEqual(xdoc, jdoc) | ||
|
||
print("-- Load odml yaml file") | ||
ydoc = odml.load('./load.odml.yaml', 'YAML') | ||
self.assertEqual(xdoc, ydoc) | ||
|
||
print("-- Document loading tests success") | ||
|
||
def test_version_load(self): | ||
print("-- Test invalid version exception xml file load") | ||
with self.assertRaises(odml.tools.parser_utils.InvalidVersionException): | ||
_ = odml.load('./load_v1.odml.xml') | ||
print("-- Invalid version loading test success") | ||
|
||
def test_tools_init(self): | ||
_ = ODMLReader() | ||
_ = ODMLWriter() | ||
_ = RDFReader() | ||
_ = RDFWriter([odml.Document()]) | ||
_ = FormatConverter() | ||
_ = VersionConverter("/I/do/not/exist.txt") | ||
_ = XMLReader() | ||
_ = XMLWriter(odml.Document()) | ||
_ = DictReader() | ||
_ = DictWriter() | ||
|
||
|
||
if __name__ == "__main__": | ||
try: | ||
svi = sys.version_info | ||
print("-- Using Python '%s.%s.%s'" % (svi.major, svi.minor, svi.micro)) | ||
print("-- Testing odml Version: '%s'" % odml.VERSION) | ||
|
||
unittest.main() | ||
|
||
except Exception as exc: | ||
print("-- Failed on a test: %s" % exc) | ||
sys.exit(-1) |
Oops, something went wrong.