Skip to content
Snippets Groups Projects
Commit 0b26273c authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-fix-inttests' into 'dev'

Pipeline streamlining

See merge request !35
parents 42590e2c 11c652ae
No related branches found
No related tags found
2 merge requests!39Release 0.4.0,!35Pipeline streamlining
Pipeline #20728 passed
...@@ -64,6 +64,7 @@ test: ...@@ -64,6 +64,7 @@ test:
- rc=`cat .docker/result` - rc=`cat .docker/result`
- exit $rc - exit $rc
dependencies: [cert] dependencies: [cert]
needs: [cert]
artifacts: artifacts:
paths: paths:
- caosdb_log.txt - caosdb_log.txt
...@@ -95,6 +96,7 @@ cert: ...@@ -95,6 +96,7 @@ cert:
tags: [docker] tags: [docker]
stage: cert stage: cert
image: $CI_REGISTRY_IMAGE image: $CI_REGISTRY_IMAGE
needs: [build-testenv]
artifacts: artifacts:
paths: paths:
- .docker/cert/ - .docker/cert/
...@@ -106,6 +108,7 @@ style: ...@@ -106,6 +108,7 @@ style:
tags: [docker] tags: [docker]
stage: style stage: style
image: $CI_REGISTRY_IMAGE image: $CI_REGISTRY_IMAGE
needs: []
script: script:
- make style - make style
allow_failure: true allow_failure: true
...@@ -114,6 +117,7 @@ unittest: ...@@ -114,6 +117,7 @@ unittest:
tags: [docker] tags: [docker]
stage: unittest stage: unittest
image: $CI_REGISTRY_IMAGE image: $CI_REGISTRY_IMAGE
needs: []
script: script:
- tox - tox
......
...@@ -48,7 +48,8 @@ Optional h5-crawler: ...@@ -48,7 +48,8 @@ Optional h5-crawler:
`integrationtest/extroot/` directory. `integrationtest/extroot/` directory.
## Code Formatting ## Code Formatting
`autopep8 -i -r ./`
`make style`
## Documentation # ## Documentation #
......
...@@ -32,26 +32,25 @@ from caosadvancedtools.cfood import (assure_object_is_in_list) ...@@ -32,26 +32,25 @@ from caosadvancedtools.cfood import (assure_object_is_in_list)
from caosadvancedtools.guard import (global_guard, RETRIEVE, UPDATE) from caosadvancedtools.guard import (global_guard, RETRIEVE, UPDATE)
def setup_module(): def setup():
"""Delete all test entities.""" """Delete all test entities."""
db.execute_query("FIND Test*").delete(raise_exception_on_error=False) db.execute_query("FIND Test*").delete(raise_exception_on_error=False)
def setup(): def setup_module():
"""Allow all updates and delete test data""" """Allow all updates and delete test data"""
global_guard.level = UPDATE global_guard.level = UPDATE
setup_module() setup()
def teardown(): def teardown_module():
"""Reset guard level and delete test data.""" """Reset guard level and delete test data."""
global_guard.level = RETRIEVE global_guard.level = RETRIEVE
setup_module() setup()
def test_assure_list_in_place(): def test_assure_list_in_place():
"""Test an in-place update with `assure_object_is_in_list`.""" """Test an in-place update with `assure_object_is_in_list`."""
int_list_prop = db.Property(name="TestIntListProperty", int_list_prop = db.Property(name="TestIntListProperty",
datatype=db.LIST(db.INTEGER)).insert() datatype=db.LIST(db.INTEGER)).insert()
rt1 = db.RecordType(name="TestType1").add_property( rt1 = db.RecordType(name="TestType1").add_property(
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
# ** end header # ** end header
# #
import caosdb as db import caosdb as db
import pytest
from caosadvancedtools import table_export as te from caosadvancedtools import table_export as te
...@@ -85,8 +86,11 @@ def setup_module(): ...@@ -85,8 +86,11 @@ def setup_module():
pass pass
@pytest.fixture(autouse=True)
def setup(): def setup():
"""No further setup""" """Same as module setup."""
setup_module()
yield None
setup_module() setup_module()
......
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
# ** end header # ** end header
"""Test whether the crawler correctly identifies the data model
problems caused by a faulty model. """Test whether the crawler correctly identifies the data model problems caused by a faulty model.
""" """
import caosdb as db import caosdb as db
from caosadvancedtools import loadFiles from caosadvancedtools import loadFiles
from caosadvancedtools.cfood import fileguide from caosadvancedtools.cfood import fileguide
......
...@@ -44,12 +44,15 @@ def setup_module(): ...@@ -44,12 +44,15 @@ def setup_module():
print(delete_exc) print(delete_exc)
@pytest.fixture(autouse=True)
def setup(): def setup():
"""No further setup""" """Same as module setup."""
setup_module()
yield None
setup_module() setup_module()
def teardown(): def teardown_module():
"""Clear and delete again.""" """Clear and delete again."""
setup_module() setup_module()
......
...@@ -154,10 +154,10 @@ def setup_package(): ...@@ -154,10 +154,10 @@ def setup_package():
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
author='Henrik tom Wörden', author='Henrik tom Wörden',
author_email='h.tomwoerden@indiscale.com', author_email='h.tomwoerden@indiscale.com',
install_requires=["caosdb>=0.6.0", install_requires=["caosdb>=0.7.0",
"numpy>=1.17.3",
"openpyxl>=3.0.0", "openpyxl>=3.0.0",
"pandas>=1.2.0", "pandas>=1.2.0",
"numpy>=1.17.3",
"xlrd>=2.0", "xlrd>=2.0",
], ],
extras_require={"h5-crawler": ["h5py>=3.3.0", ], extras_require={"h5-crawler": ["h5py>=3.3.0", ],
......
...@@ -391,7 +391,7 @@ class AbstractFileCFood(AbstractCFood): ...@@ -391,7 +391,7 @@ class AbstractFileCFood(AbstractCFood):
def assure_object_is_in_list(obj, containing_object, property_name, def assure_object_is_in_list(obj, containing_object, property_name,
to_be_updated=None, datatype=None): to_be_updated=None, datatype=None):
"""Checks whether `obj` is one of the values in the list property """Checks whether `obj` is one of the values in the list property
`property_name` of the supplied entity containing_object`. `property_name` of the supplied entity `containing_object`.
If this is the case this function returns. Otherwise the entity is If this is the case this function returns. Otherwise the entity is
added to the property `property_name` and the entity added to the property `property_name` and the entity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment