From 97d94ea7562144e2235c36537f728760f988e93f Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 15:39:57 +0000 Subject: [PATCH 01/13] Upgrade to support update tests --- dependencies/graknlabs/artifacts.bzl | 2 +- dependencies/graknlabs/repositories.bzl | 2 +- grakn/query/query_manager.py | 9 ++++ tests/behaviour/graql/graql_steps.py | 14 ++++++ tests/behaviour/graql/language/update/BUILD | 53 +++++++++++++++++++++ 5 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 tests/behaviour/graql/language/update/BUILD diff --git a/dependencies/graknlabs/artifacts.bzl b/dependencies/graknlabs/artifacts.bzl index 0b3cad2f..0540acaf 100644 --- a/dependencies/graknlabs/artifacts.bzl +++ b/dependencies/graknlabs/artifacts.bzl @@ -27,7 +27,7 @@ def graknlabs_grakn_core_artifacts(): artifact_name = "grakn-core-server-{platform}-{version}.{ext}", tag_source = deployment["artifact.release"], commit_source = deployment["artifact.snapshot"], - commit = "c2efc0a71a215b59650a3ea0e8b6f4c2c83737e3", + commit = "0efbea38aaf0f187e03168cf2c515aa5c7b44f26", ) def graknlabs_grakn_cluster_artifacts(): diff --git a/dependencies/graknlabs/repositories.bzl b/dependencies/graknlabs/repositories.bzl index 1acaedc9..6085f053 100644 --- a/dependencies/graknlabs/repositories.bzl +++ b/dependencies/graknlabs/repositories.bzl @@ -37,5 +37,5 @@ def graknlabs_behaviour(): git_repository( name = "graknlabs_behaviour", remote = "https://github.com/graknlabs/behaviour", - commit = "71f72dce4e7b46488f0f1f5a6c457018b83660c5" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_behaviour + commit = "bc4730a40866f64decd22cb0cb35c9b6a6b77b31" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_behaviour ) diff --git a/grakn/query/query_manager.py b/grakn/query/query_manager.py index 094dc239..7cf1f571 100644 --- a/grakn/query/query_manager.py +++ b/grakn/query/query_manager.py @@ -92,6 +92,15 @@ def delete(self, query: str, options: GraknOptions = None): request.delete_req.CopyFrom(delete_req) return self._iterate_query(request, lambda res: [], options) + def update(self, query: str, options: GraknOptions = None): + if not options: + options = GraknOptions.core() + request = query_proto.Query.Req() + update_req = query_proto.Query.Update.Req() + update_req.query = query + request.update_req.CopyFrom(update_req) + return map(lambda answer_proto: concept_map._of(answer_proto), self._iterate_query(request, lambda res: res.query_res.update_res.answers, options)) + def define(self, query: str, options: GraknOptions = None): if not options: options = GraknOptions.core() diff --git a/tests/behaviour/graql/graql_steps.py b/tests/behaviour/graql/graql_steps.py index dd04a289..c2f2afaa 100644 --- a/tests/behaviour/graql/graql_steps.py +++ b/tests/behaviour/graql/graql_steps.py @@ -96,6 +96,20 @@ def step_impl(context: Context, exception: str): assert_that(calling(next).with_args(context.tx().query().insert(query=context.text)), raises(GraknClientException, exception)) +@step("graql update") +def step_impl(context: Context): + context.tx().query().update(query=context.text) + + +@step("graql update; throws exception") +def step_impl(context: Context): + assert_that(calling(next).with_args(context.tx().query().update(query=context.text)), raises(GraknClientException)) + + +@step("graql update; throws exception containing \"{exception}\"") +def step_impl(context: Context, exception: str): + assert_that(calling(next).with_args(context.tx().query().update(query=context.text)), raises(GraknClientException, exception)) + @step("get answers of graql insert") def step_impl(context: Context): context.clear_answers() diff --git a/tests/behaviour/graql/language/update/BUILD b/tests/behaviour/graql/language/update/BUILD new file mode 100644 index 00000000..fec3c7c2 --- /dev/null +++ b/tests/behaviour/graql/language/update/BUILD @@ -0,0 +1,53 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +package(default_visibility = ["//tests/behaviour:__subpackages__"]) +load("//tools:behave_rule.bzl", "grakn_behaviour_py_test") +load("@graknlabs_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") + +grakn_behaviour_py_test( + name = "test", + feats = ["@graknlabs_behaviour//graql/language:update.feature"], + background_core = ["//tests/behaviour/background:core"], + background_cluster = ["//tests/behaviour/background:cluster"], + steps = [ + "//tests/behaviour/connection:steps", + "//tests/behaviour/connection/database:steps", + "//tests/behaviour/connection/session:steps", + "//tests/behaviour/connection/transaction:steps", + "//tests/behaviour/graql:steps", + ], + deps = [ + "//:client_python", + "//tests/behaviour:context", + "//tests/behaviour:util", + "//tests/behaviour/config:parameters", + "//tests/behaviour/background", + ], + native_grakn_artifact_core = "//tests:native-grakn-core-artifact", + native_grakn_artifact_cluster = "//tests:native-grakn-cluster-artifact", + size = "medium", +) + +checkstyle_test( + name = "checkstyle", + include = glob(["*"]), + license_type = "apache", + size = "small", +) From a6856862b6fece8c3c42a1bef5a98aa1fc584c0d Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 15:50:32 +0000 Subject: [PATCH 02/13] Add missing rules --- tests/behaviour/concept/thing/relation/relation_steps.py | 7 +++++++ tests/behaviour/graql/graql_steps.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/behaviour/concept/thing/relation/relation_steps.py b/tests/behaviour/concept/thing/relation/relation_steps.py index ad375eb9..3123a496 100644 --- a/tests/behaviour/concept/thing/relation/relation_steps.py +++ b/tests/behaviour/concept/thing/relation/relation_steps.py @@ -76,6 +76,13 @@ def step_impl(context: Context, var1: str, role_label: str, var2: str): def step_impl(context: Context, var1: str, role_label: str, var2: str): context.get(var1).as_remote(context.tx()).remove_player(context.get(var1).as_remote(context.tx()).get_type().as_remote(context.tx()).get_relates(role_label), context.get(var2)) +@step("relation {var1:Var} add player for role({role_label}): {var2:Var}; throws exception") +def step_impl(context: Context, var1: str, role_label: str, var2: str): + assert_that(calling(context.get(var1).as_remote(context.tx()).add_player) + .with_args(context.get(var1).as_remote(context.tx()).get_type().as_remote(context.tx()).get_relates(role_label), context.get(var2)), + raises(GraknClientException)) + + @step("relation {var:Var} get players contain") def step_impl(context: Context, var: str): diff --git a/tests/behaviour/graql/graql_steps.py b/tests/behaviour/graql/graql_steps.py index c2f2afaa..0372fa33 100644 --- a/tests/behaviour/graql/graql_steps.py +++ b/tests/behaviour/graql/graql_steps.py @@ -150,6 +150,15 @@ def step_impl(context: Context, expected_size: int): assert_that(context.answers, has_length(expected_size), "Expected [%d] answers, but got [%d]" % (expected_size, len(context.answers))) +@step("rules contain: {rule_label:Str}") +def step_impl(context: Context, rule_label: str): + return rule_label in [rule.get_label() for rule in context.tx().logic().get_rules()] + +@step("rules do not contain: {rule_label:Str}") +def step_impl(context: Context, rule_label: str): + return not (rule_label in [rule.get_label() for rule in context.tx().logic().get_rules()]) + + class ConceptMatcher: def matches(self, context: Context, concept: ConceptSubtype): From 31f32d7857a0aceb8bfdb9059f4982f5bf5343f7 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 15:59:33 +0000 Subject: [PATCH 03/13] Format automation --- .grabl/automation.yml | 62 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/.grabl/automation.yml b/.grabl/automation.yml index 0d5b9a24..90e7a034 100644 --- a/.grabl/automation.yml +++ b/.grabl/automation.yml @@ -48,7 +48,7 @@ build: bazel build //... bazel run @graknlabs_dependencies//tool/checkstyle:test-coverage bazel test $(bazel query 'kind(checkstyle_test, //...)') --test_output=errors - test-behaviour: + test-behaviour-connection: image: graknlabs-ubuntu-20.04 type: foreground command: | @@ -61,10 +61,64 @@ build: export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc bazel test //tests/behaviour/connection/... --test_output=errors --jobs=1 + test-behaviour-concept: + image: graknlabs-ubuntu-20.04 + type: foreground + command: | + pyenv global 3.6.10 + pip install -r requirements_dev.txt + sudo unlink /usr/bin/python3 + sudo ln -s $(which python3) /usr/bin/python3 + sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.6.10/lib/python3.6/site-packages/lsb_release.py + export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME + export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD + bazel run @graknlabs_dependencies//distribution/artifact:create-netrc bazel test //tests/behaviour/concept/... --test_output=errors --jobs=1 - bazel test //tests/behaviour/graql/language/get/... --test_output=errors --jobs=1 - # TODO: add other Graql Language tests once they stabilise fully - # TODO: remove --jobs=1 from Concept and Graql tests once Grakn runner is parallelisable + test-behaviour-match: + image: graknlabs-ubuntu-20.04 + type: foreground + command: | + pyenv global 3.6.10 + pip install -r requirements_dev.txt + sudo unlink /usr/bin/python3 + sudo ln -s $(which python3) /usr/bin/python3 + sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.6.10/lib/python3.6/site-packages/lsb_release.py + export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME + export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD + bazel run @graknlabs_dependencies//distribution/artifact:create-netrc + bazel test //test/behaviour/graql/language/match/... --test_output=streamed + bazel test //test/behaviour/graql/language/get/... --test_output=streamed + test-behaviour-writeable: + image: graknlabs-ubuntu-20.04 + type: foreground + command: | + pyenv global 3.6.10 + pip install -r requirements_dev.txt + sudo unlink /usr/bin/python3 + sudo ln -s $(which python3) /usr/bin/python3 + sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.6.10/lib/python3.6/site-packages/lsb_release.py + export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME + export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD + bazel run @graknlabs_dependencies//distribution/artifact:create-netrc + bazel test //test/behaviour/graql/language/insert/... --test_output=streamed + bazel test //test/behaviour/graql/language/delete/... --test_output=streamed + bazel test //test/behaviour/graql/language/update/... --test_output=streamed + test-behaviour-defineable: + image: graknlabs-ubuntu-20.04 + type: foreground + command: | + pyenv global 3.6.10 + pip install -r requirements_dev.txt + sudo unlink /usr/bin/python3 + sudo ln -s $(which python3) /usr/bin/python3 + sudo ln -s /usr/share/pyshared/lsb_release.py /opt/pyenv/versions/3.6.10/lib/python3.6/site-packages/lsb_release.py + export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME + export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD + bazel run @graknlabs_dependencies//distribution/artifact:create-netrc + bazel test //test/behaviour/graql/language/define:checkstyle --test_output=streamed + bazel test //test/behaviour/graql/language/define:test-core --test_output=streamed --jobs=1 + bazel test //test/behaviour/graql/language/undefine:checkstyle --test_output=streamed + bazel test //test/behaviour/graql/language/undefine:test-core --test_output=streamed --jobs=1 test-cluster-failover: image: graknlabs-ubuntu-20.04 type: foreground From 65c5b79ad9420e6a0e4d4b664ff76512a6285445 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:00:30 +0000 Subject: [PATCH 04/13] And the rest --- .grabl/automation.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.grabl/automation.yml b/.grabl/automation.yml index 90e7a034..bdf78970 100644 --- a/.grabl/automation.yml +++ b/.grabl/automation.yml @@ -88,7 +88,7 @@ build: bazel run @graknlabs_dependencies//distribution/artifact:create-netrc bazel test //test/behaviour/graql/language/match/... --test_output=streamed bazel test //test/behaviour/graql/language/get/... --test_output=streamed - test-behaviour-writeable: + test-behaviour-writable: image: graknlabs-ubuntu-20.04 type: foreground command: | @@ -103,7 +103,7 @@ build: bazel test //test/behaviour/graql/language/insert/... --test_output=streamed bazel test //test/behaviour/graql/language/delete/... --test_output=streamed bazel test //test/behaviour/graql/language/update/... --test_output=streamed - test-behaviour-defineable: + test-behaviour-definable: image: graknlabs-ubuntu-20.04 type: foreground command: | @@ -134,7 +134,7 @@ build: bazel test //tests:test_cluster_failover --test_output=errors deploy-pip-snapshot: image: graknlabs-ubuntu-20.04 - dependencies: [build, test-behaviour, test-cluster-failover] + dependencies: [build, test-behaviour-connection, test-behaviour-concept, test-behaviour-match, test-behaviour-writable, test-behaviour-definable test-cluster-failover] filter: owner: graknlabs branch: master From f2878778bcd804f54c7d087e15432346cd1ec581 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:08:13 +0000 Subject: [PATCH 05/13] Correct step formatting --- tests/behaviour/graql/graql_steps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/behaviour/graql/graql_steps.py b/tests/behaviour/graql/graql_steps.py index 0372fa33..d617f05f 100644 --- a/tests/behaviour/graql/graql_steps.py +++ b/tests/behaviour/graql/graql_steps.py @@ -150,11 +150,11 @@ def step_impl(context: Context, expected_size: int): assert_that(context.answers, has_length(expected_size), "Expected [%d] answers, but got [%d]" % (expected_size, len(context.answers))) -@step("rules contain: {rule_label:Str}") +@step("rules contain: {rule_label}") def step_impl(context: Context, rule_label: str): return rule_label in [rule.get_label() for rule in context.tx().logic().get_rules()] -@step("rules do not contain: {rule_label:Str}") +@step("rules do not contain: {rule_label}") def step_impl(context: Context, rule_label: str): return not (rule_label in [rule.get_label() for rule in context.tx().logic().get_rules()]) From 737e0cd27943816c1ce67a5a15bf2323f527c050 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:19:41 +0000 Subject: [PATCH 06/13] Add delays --- tests/behaviour/background/environment_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/behaviour/background/environment_base.py b/tests/behaviour/background/environment_base.py index eac6a5ad..37c241c8 100644 --- a/tests/behaviour/background/environment_base.py +++ b/tests/behaviour/background/environment_base.py @@ -23,6 +23,8 @@ from tests.behaviour.config.parameters import RootLabel from tests.behaviour.context import Context, ThingSubtype +import time + IGNORE_TAGS = ["ignore", "ignore-client-python"] @@ -78,6 +80,9 @@ def after_scenario(context: Context, scenario): if scenario.status == Status.skipped: return + #TODO: REMOVE THIS ONCE THE CRASHES ARE FIXED + time.sleep(1) + for session in context.sessions: session.close() for future_session in context.sessions_parallel: @@ -87,4 +92,7 @@ def after_scenario(context: Context, scenario): def after_all(context: Context): + #TODO: REMOVE THIS ONCE THE CRASHES ARE FIXED + time.sleep(1) + context.client.close() From 9f73ccf603e1b9cd7ee056fd5b8664834cde906e Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:28:01 +0000 Subject: [PATCH 07/13] test -> tests --- .grabl/automation.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.grabl/automation.yml b/.grabl/automation.yml index bdf78970..46ec8414 100644 --- a/.grabl/automation.yml +++ b/.grabl/automation.yml @@ -86,8 +86,8 @@ build: export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc - bazel test //test/behaviour/graql/language/match/... --test_output=streamed - bazel test //test/behaviour/graql/language/get/... --test_output=streamed + bazel test //tests/behaviour/graql/language/match/... --test_output=streamed + bazel test //tests/behaviour/graql/language/get/... --test_output=streamed test-behaviour-writable: image: graknlabs-ubuntu-20.04 type: foreground @@ -100,9 +100,9 @@ build: export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc - bazel test //test/behaviour/graql/language/insert/... --test_output=streamed - bazel test //test/behaviour/graql/language/delete/... --test_output=streamed - bazel test //test/behaviour/graql/language/update/... --test_output=streamed + bazel test //tests/behaviour/graql/language/insert/... --test_output=streamed + bazel test //tests/behaviour/graql/language/delete/... --test_output=streamed + bazel test //tests/behaviour/graql/language/update/... --test_output=streamed test-behaviour-definable: image: graknlabs-ubuntu-20.04 type: foreground @@ -115,10 +115,10 @@ build: export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc - bazel test //test/behaviour/graql/language/define:checkstyle --test_output=streamed - bazel test //test/behaviour/graql/language/define:test-core --test_output=streamed --jobs=1 - bazel test //test/behaviour/graql/language/undefine:checkstyle --test_output=streamed - bazel test //test/behaviour/graql/language/undefine:test-core --test_output=streamed --jobs=1 + bazel test //tests/behaviour/graql/language/define:checkstyle --test_output=streamed + bazel test //tests/behaviour/graql/language/define:test-core --test_output=streamed --jobs=1 + bazel test //tests/behaviour/graql/language/undefine:checkstyle --test_output=streamed + bazel test //tests/behaviour/graql/language/undefine:test-core --test_output=streamed --jobs=1 test-cluster-failover: image: graknlabs-ubuntu-20.04 type: foreground From bc6a864e475bcb837136c1c00299f5134774a855 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:33:03 +0000 Subject: [PATCH 08/13] Update .grabl/automation.yml Co-authored-by: Alex Walker --- .grabl/automation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.grabl/automation.yml b/.grabl/automation.yml index 46ec8414..3e9eeb48 100644 --- a/.grabl/automation.yml +++ b/.grabl/automation.yml @@ -134,7 +134,7 @@ build: bazel test //tests:test_cluster_failover --test_output=errors deploy-pip-snapshot: image: graknlabs-ubuntu-20.04 - dependencies: [build, test-behaviour-connection, test-behaviour-concept, test-behaviour-match, test-behaviour-writable, test-behaviour-definable test-cluster-failover] + dependencies: [build, test-behaviour-connection, test-behaviour-concept, test-behaviour-match, test-behaviour-writable, test-behaviour-definable, test-cluster-failover] filter: owner: graknlabs branch: master From 0b810a680ddc77a8a0401b24823e0ef264bed19c Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:39:08 +0000 Subject: [PATCH 09/13] shorten sleep --- tests/behaviour/background/environment_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/behaviour/background/environment_base.py b/tests/behaviour/background/environment_base.py index 37c241c8..b200e372 100644 --- a/tests/behaviour/background/environment_base.py +++ b/tests/behaviour/background/environment_base.py @@ -81,7 +81,7 @@ def after_scenario(context: Context, scenario): return #TODO: REMOVE THIS ONCE THE CRASHES ARE FIXED - time.sleep(1) + time.sleep(0.01) for session in context.sessions: session.close() @@ -93,6 +93,6 @@ def after_scenario(context: Context, scenario): def after_all(context: Context): #TODO: REMOVE THIS ONCE THE CRASHES ARE FIXED - time.sleep(1) + time.sleep(0.01) context.client.close() From 5719bf2169454e89d8155225467294cf583d6165 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:50:14 +0000 Subject: [PATCH 10/13] Yet longer cluster timeout --- tools/cluster_test_rule.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cluster_test_rule.bzl b/tools/cluster_test_rule.bzl index be81531d..2b1201d5 100644 --- a/tools/cluster_test_rule.bzl +++ b/tools/cluster_test_rule.bzl @@ -57,7 +57,7 @@ def _rule_implementation(ctx): ./1/grakn server --data data --address=127.0.0.1:11729:11730 --peers=127.0.0.1:11729:11730,127.0.0.1:21729:21730,127.0.0.1:31729:31730 & ./2/grakn server --data data --address=127.0.0.1:21729:21730 --peers=127.0.0.1:11729:11730,127.0.0.1:21729:21730,127.0.0.1:31729:31730 & ./3/grakn server --data data --address=127.0.0.1:31729:31730 --peers=127.0.0.1:11729:11730,127.0.0.1:21729:21730,127.0.0.1:31729:31730 & - sleep 14 + sleep 20 """ From a85891b4a8eb8c4b5dbdc117fa97c455b29284f2 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 16:57:35 +0000 Subject: [PATCH 11/13] Fix automation outputs --- .grabl/automation.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.grabl/automation.yml b/.grabl/automation.yml index 3e9eeb48..2d1dbaa9 100644 --- a/.grabl/automation.yml +++ b/.grabl/automation.yml @@ -86,8 +86,8 @@ build: export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc - bazel test //tests/behaviour/graql/language/match/... --test_output=streamed - bazel test //tests/behaviour/graql/language/get/... --test_output=streamed + bazel test //tests/behaviour/graql/language/match/... --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/get/... --test_output=errors --jobs=1 test-behaviour-writable: image: graknlabs-ubuntu-20.04 type: foreground @@ -100,9 +100,9 @@ build: export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc - bazel test //tests/behaviour/graql/language/insert/... --test_output=streamed - bazel test //tests/behaviour/graql/language/delete/... --test_output=streamed - bazel test //tests/behaviour/graql/language/update/... --test_output=streamed + bazel test //tests/behaviour/graql/language/insert/... --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/delete/... --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/update/... --test_output=errors --jobs=1 test-behaviour-definable: image: graknlabs-ubuntu-20.04 type: foreground @@ -115,10 +115,10 @@ build: export ARTIFACT_USERNAME=$REPO_GRAKN_USERNAME export ARTIFACT_PASSWORD=$REPO_GRAKN_PASSWORD bazel run @graknlabs_dependencies//distribution/artifact:create-netrc - bazel test //tests/behaviour/graql/language/define:checkstyle --test_output=streamed - bazel test //tests/behaviour/graql/language/define:test-core --test_output=streamed --jobs=1 - bazel test //tests/behaviour/graql/language/undefine:checkstyle --test_output=streamed - bazel test //tests/behaviour/graql/language/undefine:test-core --test_output=streamed --jobs=1 + bazel test //tests/behaviour/graql/language/define:checkstyle --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/define:test-core --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/undefine:checkstyle --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/undefine:test-core --test_output=errors --jobs=1 test-cluster-failover: image: graknlabs-ubuntu-20.04 type: foreground From bd90637675bcd456daa2ae43d8edb5b3f73e36c7 Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 17:21:26 +0000 Subject: [PATCH 12/13] Fix relation step --- .../concept/thing/relation/relation_steps.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/behaviour/concept/thing/relation/relation_steps.py b/tests/behaviour/concept/thing/relation/relation_steps.py index 3123a496..ba233923 100644 --- a/tests/behaviour/concept/thing/relation/relation_steps.py +++ b/tests/behaviour/concept/thing/relation/relation_steps.py @@ -78,9 +78,16 @@ def step_impl(context: Context, var1: str, role_label: str, var2: str): @step("relation {var1:Var} add player for role({role_label}): {var2:Var}; throws exception") def step_impl(context: Context, var1: str, role_label: str, var2: str): - assert_that(calling(context.get(var1).as_remote(context.tx()).add_player) - .with_args(context.get(var1).as_remote(context.tx()).get_type().as_remote(context.tx()).get_relates(role_label), context.get(var2)), - raises(GraknClientException)) + adding_player_throws_exception(context, var1, role_label, var2) + +def adding_player_throws_exception(context: Context, var1: str, role_label: str, var2: str): + try: + context.get(var1).as_remote(context.tx()).add_player( + context.get(var1).as_remote(context.tx()).get_type().as_remote(context.tx()).get_relates(role_label), + context.get(var2)) + assert False; + except GraknClientException: + pass From 4925022a6270490a194e866deb6539651b9bd1bf Mon Sep 17 00:00:00 2001 From: Alistair Crook Date: Thu, 4 Feb 2021 17:24:29 +0000 Subject: [PATCH 13/13] Disable updater cluster test temporarily --- .grabl/automation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.grabl/automation.yml b/.grabl/automation.yml index 2d1dbaa9..7d81ae7a 100644 --- a/.grabl/automation.yml +++ b/.grabl/automation.yml @@ -102,7 +102,8 @@ build: bazel run @graknlabs_dependencies//distribution/artifact:create-netrc bazel test //tests/behaviour/graql/language/insert/... --test_output=errors --jobs=1 bazel test //tests/behaviour/graql/language/delete/... --test_output=errors --jobs=1 - bazel test //tests/behaviour/graql/language/update/... --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/update:checkstyle --test_output=errors --jobs=1 + bazel test //tests/behaviour/graql/language/update:test-core --test_output=errors --jobs=1 test-behaviour-definable: image: graknlabs-ubuntu-20.04 type: foreground