diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fb90d76eb2d572d1943e5cea1241261f1248276..d0d0982745ac95edadccfef823ac0931c6a5e39e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -217,10 +217,12 @@ cert: script: - cd .docker - CAOSHOSTNAME=caosdb-server ./cert.sh + style: tags: [docker] stage: style image: $CI_REGISTRY_IMAGE + needs: [] script: - autopep8 -r --diff --exit-code . allow_failure: true diff --git a/CHANGELOG.md b/CHANGELOG.md index dd58edd8e7fa711540aa8e20f981c155c3945711..c997d3e3d77a949be42440117a4fcba538de7926 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [caosdb-server#155](https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/155) have been resolved. * Tests for caosdb-server#154 +* Tests for caosdb-server#217 * Tests for caosdb-pylib#61 ### Changed (for changes in existing functionality) diff --git a/Makefile b/Makefile index 9689f1e3b68d0bd7f501879bcb6c854c0153a88e..d81534bd53fe76e6244a998aa393a6a86f52ac69 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ help: # Run the tests through autopep8. autopep8: - autopep8 -ri tests + autopep8 -ri . # Meta target to call the other targets. all: autopep8 test diff --git a/pycaosdb.ini.template b/pycaosdb.ini.template index c94af17ae01408f9d7f24473ce36ce738c75331d..7530d6af2e24d564c3d02b88b3f7dd38eb4de073 100644 --- a/pycaosdb.ini.template +++ b/pycaosdb.ini.template @@ -2,28 +2,30 @@ ## This sections must exist in addition to the usual section. [IntegrationTests] -########## Server-side scripting ################## +########## Server-side scripting paths ################## ## These are used by tests of server side scripting. Both paths have ## to point to existing directories in which the CaosDB server has the ## permissions to create and execute scripts. -# location of the scripting bin dir which is used for the test scripts from the -# pyinttest's perspective. +# Location of the scripting bin dir which is used for the test scripts from the +# pyinttest's perspective. Probably the scripting/bin dir in the caosdb-server sources. #test_server_side_scripting.bin_dir.local=/path/to/scripting/bin -# location of the scripting bin dir which is used for the test scripts from the +# Location of the scripting bin dir which is used for the test scripts from the # server's perspective. #test_server_side_scripting.bin_dir.server=/opt/caosdb/git/caosdb-server/scripting/bin -########## Files ################## +########## Files paths ################## ## Used by tests of file handling. Specify the path to an existing ## directory in which file tests are performed, once as seen by the ## host and once as seen by the server. -# location of the files from the pyinttest (i.e. host) perspective +# Location of the files from the pyinttest (i.e. host) perspective. Probably the local extroot +# path plus `/test_insert_files_in_dir/`. #test_files.test_insert_files_in_dir.local=/extroot/test_insert_files_in_dir/ -# location of the files from the caosdb server's perspective +# Location of the files from the caosdb server's perspective. Probably with the same last +# component(s) as the local variant (above). #test_files.test_insert_files_in_dir.server=/opt/caosdb/mnt/extroot/test_insert_files_in_dir/ ########## Authentication tokens ################## diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 844de461a3665240cf9d053d0cb8f7439767efe6..ba2f31a3f5c2885c5eee10cedfb11be982d9ad50 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -1,10 +1,8 @@ # -*- coding: utf-8 -*- -# -# ** header v3.0 # This file is a part of the CaosDB Project. # -# Copyright (c) 2020 IndiScale GmbH <info@indiscale.com> -# Copyright (c) 2020 Daniel Hornung <d.hornung@indiscale.com> +# Copyright (c) 2022 IndiScale GmbH <info@indiscale.com> +# Copyright (c) 2022 Daniel Hornung <d.hornung@indiscale.com> # Copyright (c) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> # # This program is free software: you can redistribute it and/or modify @@ -19,8 +17,6 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -# -# ** end header """Tests for issues on gitlab.com, project caosdb-server.""" @@ -603,3 +599,17 @@ def test_issue_132(): # this one has the wront scope of the conjunction. query = "FIND RECORD TestRT WITH TestRT_Foo.TestP_Bar = val1 AND TestP_Baz = 'the other one'" assert len(db.execute_query(query)) == 0 + + +def test_issue_217(): + """Server gets list property datatype wrong if description is updated.""" + + rt = db.RecordType(name="TestRT").insert() + # prop = db.Property(name="LP", datatype=db.LIST("TestRT")).insert() + r = db.Record().add_parent(id=rt.id).add_property(name=rt.name, + datatype=db.LIST(db.INTEGER), + value=[1, 2]).insert() + r.retrieve() + r.description = "Changed description" + r.update() + r.retrieve() # This line fails in the bug report with invalid XML. diff --git a/tox.ini b/tox.ini index 26c5d1594c48fe755a355a3aee711fd6608c6f97..03ab50d132a82e6f7ee4b26cb55156e211f24b01 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,10 @@ [tox] -envlist=py36, py37, py38, py39 +envlist=py36, py37, py38, py39, py310 skip_missing_interpreters = true + +[pycodestyle] +max_line_length = 100 + [testenv] setenv = PASSWORD_STORE_DIR = {env:HOME}/.password-store passenv = PYCAOSDBINI