From b201023713c119b488af296602a97aeee60bea99 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:26:35 +0100 Subject: [PATCH 01/10] Set python path for bazel run sync dependencies --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 191f214fcb..6516884c7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -804,7 +804,7 @@ jobs: apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common python3.9 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) + bazel run --python_path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) release-cleanup: executor: linux-x86_64-ubuntu-2204 @@ -978,9 +978,9 @@ workflows: - sync-dependencies: filters: branches: - only: [release] - requires: - - deploy-github + only: [release, one-off-sync-dependencies-bazel-run-python-path] +# requires: +# - deploy-github - release-cleanup: filters: branches: From 476fa2e5ab8cc3b85bf4ba6cd84564c2ce1ddb7e Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:33:28 +0100 Subject: [PATCH 02/10] Exporting bazel python? --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6516884c7a..733c8afa70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -804,7 +804,8 @@ jobs: apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common python3.9 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - bazel run --python_path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) + export BAZEL_PYTHON=$(which python3.9) + bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) release-cleanup: executor: linux-x86_64-ubuntu-2204 From 0e5ab4d860fa427c9a296131715c7fa1bde29b51 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:33:40 +0100 Subject: [PATCH 03/10] Disable factory --- .factory/automation.yml | 1134 +++++++++++++++++++-------------------- 1 file changed, 567 insertions(+), 567 deletions(-) diff --git a/.factory/automation.yml b/.factory/automation.yml index 9871d75291..2a6419b1f7 100644 --- a/.factory/automation.yml +++ b/.factory/automation.yml @@ -1,567 +1,567 @@ -# 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. - -config: - version-candidate: VERSION - dependencies: - dependencies: [build] - typedb-behaviour: [build] - typedb-protocol: [build, release] - typeql: [build, release] - -build: - quality: - filter: - owner: vaticle - branch: [master, development] - dependency-analysis: - image: vaticle-ubuntu-22.04 - command: | - bazel run @vaticle_dependencies//factory/analysis:dependency-analysis - - correctness: - build: - image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against - machine: 16-core-64-gb - command: | - export PATH="$HOME/.local/bin:$PATH" - sudo apt-get update - sudo apt install python3-pip -y - python3 -m pip install -U pip - python3 -m pip install -r python/requirements_dev.txt - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - bazel build //... - bazel run @vaticle_dependencies//tool/checkstyle:test-coverage - bazel test $(bazel query 'kind(checkstyle_test, //...)') --test_output=errors - bazel test $(bazel query 'kind(rustfmt_test, //...)') --@rules_rust//:rustfmt.toml=//rust:rustfmt_config - cd nodejs - npm install - npm run lint - - build-dependency: - image: vaticle-ubuntu-22.04 - command: | - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - dependencies/maven/update.sh - git diff --exit-code dependencies/maven/artifacts.snapshot - bazel run @vaticle_dependencies//tool/unuseddeps:unused-deps -- list - - build-docs: - image: vaticle-ubuntu-22.04 - command: | - curl -L https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz | tar xzO doxygen-1.10.0/bin/doxygen > /var/tmp/doxygen && - sudo mv /var/tmp/doxygen /usr/local/bin/ && sudo chmod +x /usr/local/bin/doxygen - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - DOCS_DIRS="docs/modules/ROOT/partials/java docs/modules/ROOT/partials/nodejs docs/modules/ROOT/partials/python docs/modules/ROOT/partials/rust docs/modules/ROOT/partials/cpp docs/modules/ROOT/partials/c docs/modules/ROOT/partials/csharp" - find $DOCS_DIRS -type f ! -name 'api-reference.adoc' -exec rm -f {} \; - tool/docs/update.sh - git add $DOCS_DIRS - git diff --exit-code HEAD $DOCS_DIRS - - test-rust-unit-integration: - image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - bazel test //rust:typedb_driver_unit_tests --test_output=streamed || exit 1 - tool/test/start-core-server.sh && - bazel test //rust/tests --test_output=streamed --test_arg=-- \ - --test_arg=integration::queries::core && - export CORE_FAILED= || export CORE_FAILED=1 - tool/test/stop-core-server.sh - if [[ -n "$CORE_FAILED" ]]; then exit 1; fi - - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ - --test_arg=integration::queries::cloud \ - --test_arg=integration::runtimes \ - --test_arg=integration::network && - export CLOUD_FAILED= || export CLOUD_FAILED=1 - tool/test/stop-cloud-servers.sh - if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi - - test-rust-behaviour-minimal: - image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ - --test_arg=behaviour::concept && - bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ - --test_arg=behaviour::connection && - bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ - --test_arg=behaviour::driver && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - test-rust-behaviour-query-read: - machine: 8-core-32-gb - image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against - filter: - owner: vaticle - branch: [master, development] - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ - --test_arg=behaviour::query::language::match_ \ - --test_arg=behaviour::query::language::get \ - --test_arg=behaviour::query::language::fetch \ - --test_arg=behaviour::query::language::modifiers \ - --test_arg=behaviour::query::language::expression && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - test-rust-behaviour-query-write: - machine: 8-core-32-gb - image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against - filter: - owner: vaticle - branch: [master, development] - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ - --test_arg=behaviour::query::language::define \ - --test_arg=behaviour::query::language::undefine \ - --test_arg=behaviour::query::language::insert \ - --test_arg=behaviour::query::language::delete \ - --test_arg=behaviour::query::language::update \ - --test_arg=behaviour::query::language::rule_validation && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - test-c-integration: - image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - tool/test/start-core-server.sh && - bazel test //c/tests/integration:test-driver --test_output=errors && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-core-server.sh - exit $TEST_SUCCESS - - test-java-integration: - image: vaticle-ubuntu-22.04 - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - bazel test //java/test/integration/... --test_output=errors - - test-java-behaviour-core: - image: vaticle-ubuntu-22.04 - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - .factory/test-core.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 - # TODO: delete --jobs=1 if we fix the issue with excess memory usage - .factory/test-core.sh //java/test/behaviour/concept/... --test_output=errors - .factory/test-core.sh //java/test/behaviour/driver/query/... --test_output=errors - .factory/test-core.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 - - test-java-behaviour-cloud: - image: vaticle-ubuntu-22.04 - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - .factory/test-cloud.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 - # TODO: delete --jobs=1 if we fix the issue with excess memory usage - .factory/test-cloud.sh //java/test/behaviour/concept/... --test_output=errors - .factory/test-cloud.sh //java/test/behaviour/driver/query/... --test_output=errors - .factory/test-cloud.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 - - test-python-behaviour-core: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - export PATH="$HOME/.local/bin:$PATH" - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - - tool/test/start-core-server.sh && - .factory/test-core.sh //python/tests/behaviour/connection/database/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //python/tests/behaviour/connection/session/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //python/tests/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //python/tests/behaviour/concept/... --test_output=errors --jobs=1 && - .factory/test-core.sh //python/tests/behaviour/driver/query/... --test_output=errors && - .factory/test-core.sh //python/tests/behaviour/query/language/... --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-core-server.sh - exit $TEST_SUCCESS - - test-python-behaviour-cloud: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - export PATH="$HOME/.local/bin:$PATH" - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - - source tool/test/start-cloud-servers.sh && # use source to receive export vars - .factory/test-cloud.sh //python/tests/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //python/tests/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //python/tests/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //python/tests/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //python/tests/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //python/tests/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && - .factory/test-cloud.sh //python/tests/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - test-python-integration: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - export PATH="$HOME/.local/bin:$PATH" - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - - tool/test/start-core-server.sh && - bazel test //python/tests/integration:test_stream --test_output=streamed --jobs=1 && - export CORE_FAILED= || export CORE_FAILED=1 - tool/test/stop-core-server.sh - if [[ -n "$CORE_FAILED" ]]; then exit 1; fi - - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //python/tests/integration:test_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - # TODO #635: currently broken test - # bazel test //python/tests/integration:test_cloud_failover --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - export CLOUD_FAILED= || export CLOUD_FAILED=1 - tool/test/stop-cloud-servers.sh - if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi - - test-nodejs-integration: - image: vaticle-ubuntu-22.04 - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - bazel build //nodejs/... - cp -rL bazel-bin/nodejs/node_modules nodejs/. - cp -rL bazel-bin/nodejs/dist nodejs/. - tool/test/start-core-server.sh && - node nodejs/test/integration/test-concept.js && - node nodejs/test/integration/test-query.js && - node nodejs/test/integration/test-connection-core.js && - export CORE_FAILED= || export CORE_FAILED=1 - tool/test/stop-core-server.sh - if [[ -n "$CORE_FAILED" ]]; then exit 1; fi - - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - node nodejs/test/integration/test-connection-cloud.js && - node nodejs/test/integration/test-cloud-failover.js && - export CLOUD_FAILED= || export CLOUD_FAILED=1 - tool/test/stop-cloud-servers.sh - if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi - - test-nodejs-behaviour-core: - image: vaticle-ubuntu-22.04 - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - tool/test/start-core-server.sh && - .factory/test-core.sh //nodejs/test/behaviour/connection/database/... --test_output=errors --jobs=1 && - .factory/test-core.sh //nodejs/test/behaviour/connection/session/... --test_output=errors --jobs=1 && - .factory/test-core.sh //nodejs/test/behaviour/connection/transaction/... --test_output=errors --jobs=1 && - .factory/test-core.sh //nodejs/test/behaviour/concept/... --test_output=errors --jobs=1 && - .factory/test-core.sh //nodejs/test/behaviour/driver/query/... --test_output=errors --jobs=1 && - .factory/test-core.sh //nodejs/test/behaviour/query/language/... --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-core-server.sh - exit $TEST_SUCCESS - - test-nodejs-behaviour-cloud: - image: vaticle-ubuntu-22.04 - dependencies: - - build - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - source tool/test/start-cloud-servers.sh && # use source to receive export vars - .factory/test-cloud.sh //nodejs/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //nodejs/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //nodejs/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //nodejs/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //nodejs/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //nodejs/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //nodejs/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - test-cpp-integration: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - sudo apt-get update - sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - tool/test/start-core-server.sh && - bazel test //cpp/test/integration:test-cpp-driver-core --test_output=streamed --jobs=1 && - export CORE_FAILED= || export CORE_FAILED=1 - tool/test/stop-core-server.sh - if [[ -n "$CORE_FAILED" ]]; then exit 1; fi - - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //cpp/test/integration:test-cpp-driver-cloud --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - export CLOUD_FAILED= || export CLOUD_FAILED=1 - tool/test/stop-cloud-servers.sh - if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi - - test-cpp-behaviour-core: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - sudo apt-get update - sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - tool/test/start-core-server.sh && - .factory/test-core.sh //cpp/test/behaviour/connection/database/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //cpp/test/behaviour/connection/session/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //cpp/test/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //cpp/test/behaviour/concept/... --test_output=errors --jobs=1 && - .factory/test-core.sh //cpp/test/behaviour/driver/query/... --test_output=errors && - .factory/test-core.sh //cpp/test/behaviour/query/language/... --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-core-server.sh - exit $TEST_SUCCESS - - test-cpp-behaviour-cloud: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - source tool/test/start-cloud-servers.sh && - .factory/test-cloud.sh //cpp/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //cpp/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //cpp/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //cpp/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //cpp/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //cpp/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && - .factory/test-cloud.sh //cpp/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - test-csharp-integration: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - sudo apt-get update - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - tool/test/start-core-server.sh && - bazel test //csharp/Test/Integration/Data/... --test_output=streamed --jobs=1 && - bazel test //csharp/Test/Integration/Marshal/... --test_output=streamed --jobs=1 && - .factory/test-core.sh //csharp/Test/Integration/Examples/... --test_output=streamed --jobs=1 && - export CORE_FAILED= || export CORE_FAILED=1 - tool/test/stop-core-server.sh - if [[ -n "$CORE_FAILED" ]]; then exit 1; fi - - source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars - bazel test //csharp/Test/Integration/Network/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Integration/Examples/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && - export CLOUD_FAILED= || export CLOUD_FAILED=1 - tool/test/stop-cloud-servers.sh - if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi - - test-csharp-behaviour-core: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - sudo apt-get update - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - tool/test/start-core-server.sh && - .factory/test-core.sh //csharp/Test/Behaviour/Connection/Database/... --test_output=errors --jobs=1 && - .factory/test-core.sh //csharp/Test/Behaviour/Connection/Session/... --test_output=errors --jobs=1 && - .factory/test-core.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_output=errors --jobs=1 && - .factory/test-core.sh //csharp/Test/Behaviour/Concept/... --test_output=errors --jobs=1 && - .factory/test-core.sh //csharp/Test/Behaviour/Driver/Query/... --test_output=errors && - .factory/test-core.sh //csharp/Test/Behaviour/Query/Language/... --test_output=errors --jobs=1 && - .factory/test-core.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-core-server.sh - exit $TEST_SUCCESS - - test-csharp-behaviour-cloud: - image: vaticle-ubuntu-22.04 - dependencies: - - build - type: foreground - command: | - export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME - export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD - bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh - bazel run @vaticle_dependencies//distribution/artifact:create-netrc - source tool/test/start-cloud-servers.sh && - .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/User/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Behaviour/Concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Behaviour/Driver/Query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && - .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && - export TEST_SUCCESS=0 || export TEST_SUCCESS=1 - tool/test/stop-cloud-servers.sh - exit $TEST_SUCCESS - - sync-dependencies: - image: vaticle-ubuntu-22.04 - filter: - owner: vaticle - branch: [master, development] - dependencies: - - build - - build-dependency - - build-docs - - test-rust-unit-integration - - test-rust-behaviour-minimal - - test-rust-behaviour-query-read - - test-rust-behaviour-query-write - - test-c-integration - - test-java-integration - - test-java-behaviour-core - - test-java-behaviour-cloud - - test-python-behaviour-core - - test-python-behaviour-cloud - - test-python-integration - - test-nodejs-integration - - test-nodejs-behaviour-core - - test-nodejs-behaviour-cloud - - test-cpp-integration - - test-cpp-behaviour-core - - test-cpp-behaviour-cloud - - test-csharp-integration - - test-csharp-behaviour-core - - test-csharp-behaviour-cloud - command: | - sudo add-apt-repository -y ppa:deadsnakes/ppa - sudo apt update && sudo apt install -y python3.9 python3.9-distutils python3-pip - python3.9 -m pip install -U cffi - export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${FACTORY_REPO}@${FACTORY_COMMIT} - -# TODO #512: assembly tests for all drivers to run in factory - -release: - filter: - owner: vaticle - branch: [master] - validation: - validate-dependencies: - image: vaticle-ubuntu-22.04 - command: | - bazel test //:release-validate-deps --test_output=streamed - validate-release-notes: - image: vaticle-ubuntu-22.04 - command: | - export NOTES_VALIDATE_TOKEN=$REPO_GITHUB_TOKEN - bazel run @vaticle_dependencies//tool/release/notes:validate --test_output=streamed -- $FACTORY_OWNER $FACTORY_REPO RELEASE_NOTES_LATEST.md - - deployment: - trigger-release-circleci: - image: vaticle-ubuntu-22.04 - command: | - git checkout -b release - git push -f origin release - echo "Successfully pushed branch 'release', which triggers a release workflow in CircleCI. The progress of the release can be tracked there." +## 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. +# +#config: +# version-candidate: VERSION +# dependencies: +# dependencies: [build] +# typedb-behaviour: [build] +# typedb-protocol: [build, release] +# typeql: [build, release] +# +#build: +# quality: +# filter: +# owner: vaticle +# branch: [master, development] +# dependency-analysis: +# image: vaticle-ubuntu-22.04 +# command: | +# bazel run @vaticle_dependencies//factory/analysis:dependency-analysis +# +# correctness: +# build: +# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against +# machine: 16-core-64-gb +# command: | +# export PATH="$HOME/.local/bin:$PATH" +# sudo apt-get update +# sudo apt install python3-pip -y +# python3 -m pip install -U pip +# python3 -m pip install -r python/requirements_dev.txt +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# bazel build //... +# bazel run @vaticle_dependencies//tool/checkstyle:test-coverage +# bazel test $(bazel query 'kind(checkstyle_test, //...)') --test_output=errors +# bazel test $(bazel query 'kind(rustfmt_test, //...)') --@rules_rust//:rustfmt.toml=//rust:rustfmt_config +# cd nodejs +# npm install +# npm run lint +# +# build-dependency: +# image: vaticle-ubuntu-22.04 +# command: | +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# dependencies/maven/update.sh +# git diff --exit-code dependencies/maven/artifacts.snapshot +# bazel run @vaticle_dependencies//tool/unuseddeps:unused-deps -- list +# +# build-docs: +# image: vaticle-ubuntu-22.04 +# command: | +# curl -L https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz | tar xzO doxygen-1.10.0/bin/doxygen > /var/tmp/doxygen && +# sudo mv /var/tmp/doxygen /usr/local/bin/ && sudo chmod +x /usr/local/bin/doxygen +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# DOCS_DIRS="docs/modules/ROOT/partials/java docs/modules/ROOT/partials/nodejs docs/modules/ROOT/partials/python docs/modules/ROOT/partials/rust docs/modules/ROOT/partials/cpp docs/modules/ROOT/partials/c docs/modules/ROOT/partials/csharp" +# find $DOCS_DIRS -type f ! -name 'api-reference.adoc' -exec rm -f {} \; +# tool/docs/update.sh +# git add $DOCS_DIRS +# git diff --exit-code HEAD $DOCS_DIRS +# +# test-rust-unit-integration: +# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# bazel test //rust:typedb_driver_unit_tests --test_output=streamed || exit 1 +# tool/test/start-core-server.sh && +# bazel test //rust/tests --test_output=streamed --test_arg=-- \ +# --test_arg=integration::queries::core && +# export CORE_FAILED= || export CORE_FAILED=1 +# tool/test/stop-core-server.sh +# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi +# +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ +# --test_arg=integration::queries::cloud \ +# --test_arg=integration::runtimes \ +# --test_arg=integration::network && +# export CLOUD_FAILED= || export CLOUD_FAILED=1 +# tool/test/stop-cloud-servers.sh +# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi +# +# test-rust-behaviour-minimal: +# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ +# --test_arg=behaviour::concept && +# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ +# --test_arg=behaviour::connection && +# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ +# --test_arg=behaviour::driver && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# test-rust-behaviour-query-read: +# machine: 8-core-32-gb +# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against +# filter: +# owner: vaticle +# branch: [master, development] +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ +# --test_arg=behaviour::query::language::match_ \ +# --test_arg=behaviour::query::language::get \ +# --test_arg=behaviour::query::language::fetch \ +# --test_arg=behaviour::query::language::modifiers \ +# --test_arg=behaviour::query::language::expression && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# test-rust-behaviour-query-write: +# machine: 8-core-32-gb +# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against +# filter: +# owner: vaticle +# branch: [master, development] +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ +# --test_arg=behaviour::query::language::define \ +# --test_arg=behaviour::query::language::undefine \ +# --test_arg=behaviour::query::language::insert \ +# --test_arg=behaviour::query::language::delete \ +# --test_arg=behaviour::query::language::update \ +# --test_arg=behaviour::query::language::rule_validation && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# test-c-integration: +# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# tool/test/start-core-server.sh && +# bazel test //c/tests/integration:test-driver --test_output=errors && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-core-server.sh +# exit $TEST_SUCCESS +# +# test-java-integration: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# bazel test //java/test/integration/... --test_output=errors +# +# test-java-behaviour-core: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# .factory/test-core.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 +# # TODO: delete --jobs=1 if we fix the issue with excess memory usage +# .factory/test-core.sh //java/test/behaviour/concept/... --test_output=errors +# .factory/test-core.sh //java/test/behaviour/driver/query/... --test_output=errors +# .factory/test-core.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 +# +# test-java-behaviour-cloud: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# .factory/test-cloud.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 +# # TODO: delete --jobs=1 if we fix the issue with excess memory usage +# .factory/test-cloud.sh //java/test/behaviour/concept/... --test_output=errors +# .factory/test-cloud.sh //java/test/behaviour/driver/query/... --test_output=errors +# .factory/test-cloud.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 +# +# test-python-behaviour-core: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# export PATH="$HOME/.local/bin:$PATH" +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# +# tool/test/start-core-server.sh && +# .factory/test-core.sh //python/tests/behaviour/connection/database/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //python/tests/behaviour/connection/session/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //python/tests/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //python/tests/behaviour/concept/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //python/tests/behaviour/driver/query/... --test_output=errors && +# .factory/test-core.sh //python/tests/behaviour/query/language/... --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-core-server.sh +# exit $TEST_SUCCESS +# +# test-python-behaviour-cloud: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# export PATH="$HOME/.local/bin:$PATH" +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# +# source tool/test/start-cloud-servers.sh && # use source to receive export vars +# .factory/test-cloud.sh //python/tests/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //python/tests/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //python/tests/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //python/tests/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //python/tests/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //python/tests/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && +# .factory/test-cloud.sh //python/tests/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# test-python-integration: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# export PATH="$HOME/.local/bin:$PATH" +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# +# tool/test/start-core-server.sh && +# bazel test //python/tests/integration:test_stream --test_output=streamed --jobs=1 && +# export CORE_FAILED= || export CORE_FAILED=1 +# tool/test/stop-core-server.sh +# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi +# +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //python/tests/integration:test_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# # TODO #635: currently broken test +# # bazel test //python/tests/integration:test_cloud_failover --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# export CLOUD_FAILED= || export CLOUD_FAILED=1 +# tool/test/stop-cloud-servers.sh +# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi +# +# test-nodejs-integration: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# bazel build //nodejs/... +# cp -rL bazel-bin/nodejs/node_modules nodejs/. +# cp -rL bazel-bin/nodejs/dist nodejs/. +# tool/test/start-core-server.sh && +# node nodejs/test/integration/test-concept.js && +# node nodejs/test/integration/test-query.js && +# node nodejs/test/integration/test-connection-core.js && +# export CORE_FAILED= || export CORE_FAILED=1 +# tool/test/stop-core-server.sh +# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi +# +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# node nodejs/test/integration/test-connection-cloud.js && +# node nodejs/test/integration/test-cloud-failover.js && +# export CLOUD_FAILED= || export CLOUD_FAILED=1 +# tool/test/stop-cloud-servers.sh +# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi +# +# test-nodejs-behaviour-core: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# tool/test/start-core-server.sh && +# .factory/test-core.sh //nodejs/test/behaviour/connection/database/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //nodejs/test/behaviour/connection/session/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //nodejs/test/behaviour/connection/transaction/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //nodejs/test/behaviour/concept/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //nodejs/test/behaviour/driver/query/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //nodejs/test/behaviour/query/language/... --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-core-server.sh +# exit $TEST_SUCCESS +# +# test-nodejs-behaviour-cloud: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# source tool/test/start-cloud-servers.sh && # use source to receive export vars +# .factory/test-cloud.sh //nodejs/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //nodejs/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //nodejs/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //nodejs/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //nodejs/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //nodejs/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //nodejs/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# test-cpp-integration: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# sudo apt-get update +# sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# tool/test/start-core-server.sh && +# bazel test //cpp/test/integration:test-cpp-driver-core --test_output=streamed --jobs=1 && +# export CORE_FAILED= || export CORE_FAILED=1 +# tool/test/stop-core-server.sh +# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi +# +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //cpp/test/integration:test-cpp-driver-cloud --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# export CLOUD_FAILED= || export CLOUD_FAILED=1 +# tool/test/stop-cloud-servers.sh +# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi +# +# test-cpp-behaviour-core: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# sudo apt-get update +# sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# tool/test/start-core-server.sh && +# .factory/test-core.sh //cpp/test/behaviour/connection/database/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //cpp/test/behaviour/connection/session/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //cpp/test/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //cpp/test/behaviour/concept/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //cpp/test/behaviour/driver/query/... --test_output=errors && +# .factory/test-core.sh //cpp/test/behaviour/query/language/... --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-core-server.sh +# exit $TEST_SUCCESS +# +# test-cpp-behaviour-cloud: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# source tool/test/start-cloud-servers.sh && +# .factory/test-cloud.sh //cpp/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //cpp/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //cpp/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //cpp/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //cpp/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //cpp/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && +# .factory/test-cloud.sh //cpp/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# test-csharp-integration: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# sudo apt-get update +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# tool/test/start-core-server.sh && +# bazel test //csharp/Test/Integration/Data/... --test_output=streamed --jobs=1 && +# bazel test //csharp/Test/Integration/Marshal/... --test_output=streamed --jobs=1 && +# .factory/test-core.sh //csharp/Test/Integration/Examples/... --test_output=streamed --jobs=1 && +# export CORE_FAILED= || export CORE_FAILED=1 +# tool/test/stop-core-server.sh +# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi +# +# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars +# bazel test //csharp/Test/Integration/Network/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Integration/Examples/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && +# export CLOUD_FAILED= || export CLOUD_FAILED=1 +# tool/test/stop-cloud-servers.sh +# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi +# +# test-csharp-behaviour-core: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# sudo apt-get update +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# tool/test/start-core-server.sh && +# .factory/test-core.sh //csharp/Test/Behaviour/Connection/Database/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //csharp/Test/Behaviour/Connection/Session/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //csharp/Test/Behaviour/Concept/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //csharp/Test/Behaviour/Driver/Query/... --test_output=errors && +# .factory/test-core.sh //csharp/Test/Behaviour/Query/Language/... --test_output=errors --jobs=1 && +# .factory/test-core.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-core-server.sh +# exit $TEST_SUCCESS +# +# test-csharp-behaviour-cloud: +# image: vaticle-ubuntu-22.04 +# dependencies: +# - build +# type: foreground +# command: | +# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME +# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD +# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh +# bazel run @vaticle_dependencies//distribution/artifact:create-netrc +# source tool/test/start-cloud-servers.sh && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/User/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Driver/Query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && +# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 +# tool/test/stop-cloud-servers.sh +# exit $TEST_SUCCESS +# +# sync-dependencies: +# image: vaticle-ubuntu-22.04 +# filter: +# owner: vaticle +# branch: [master, development] +# dependencies: +# - build +# - build-dependency +# - build-docs +# - test-rust-unit-integration +# - test-rust-behaviour-minimal +# - test-rust-behaviour-query-read +# - test-rust-behaviour-query-write +# - test-c-integration +# - test-java-integration +# - test-java-behaviour-core +# - test-java-behaviour-cloud +# - test-python-behaviour-core +# - test-python-behaviour-cloud +# - test-python-integration +# - test-nodejs-integration +# - test-nodejs-behaviour-core +# - test-nodejs-behaviour-cloud +# - test-cpp-integration +# - test-cpp-behaviour-core +# - test-cpp-behaviour-cloud +# - test-csharp-integration +# - test-csharp-behaviour-core +# - test-csharp-behaviour-cloud +# command: | +# sudo add-apt-repository -y ppa:deadsnakes/ppa +# sudo apt update && sudo apt install -y python3.9 python3.9-distutils python3-pip +# python3.9 -m pip install -U cffi +# export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN +# bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${FACTORY_REPO}@${FACTORY_COMMIT} +# +## TODO #512: assembly tests for all drivers to run in factory +# +#release: +# filter: +# owner: vaticle +# branch: [master] +# validation: +# validate-dependencies: +# image: vaticle-ubuntu-22.04 +# command: | +# bazel test //:release-validate-deps --test_output=streamed +# validate-release-notes: +# image: vaticle-ubuntu-22.04 +# command: | +# export NOTES_VALIDATE_TOKEN=$REPO_GITHUB_TOKEN +# bazel run @vaticle_dependencies//tool/release/notes:validate --test_output=streamed -- $FACTORY_OWNER $FACTORY_REPO RELEASE_NOTES_LATEST.md +# +# deployment: +# trigger-release-circleci: +# image: vaticle-ubuntu-22.04 +# command: | +# git checkout -b release +# git push -f origin release +# echo "Successfully pushed branch 'release', which triggers a release workflow in CircleCI. The progress of the release can be tracked there." From 53279740135150351e692982894ddd31dbd2271a Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:37:47 +0100 Subject: [PATCH 04/10] Force reinstall pip --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 733c8afa70..dc7cafe038 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,9 +802,8 @@ jobs: apt update -y && apt install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common - python3.9 -m pip install -U cffi + python3.9 -m pip install -U --force-reinstall cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - export BAZEL_PYTHON=$(which python3.9) bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) release-cleanup: From 1978561c21224df457bad101acf3b4d293092697 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:43:49 +0100 Subject: [PATCH 05/10] apt uninstall --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc7cafe038..950f69ce37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,9 +802,10 @@ jobs: apt update -y && apt install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common - python3.9 -m pip install -U --force-reinstall cffi + sudo apt-get remove -y python3-cffi-backend + python3.9 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) + bazel run --python-path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) release-cleanup: executor: linux-x86_64-ubuntu-2204 From b9b076fed68a4a0259aa0cfcc12f795bf11a7d6f Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:48:20 +0100 Subject: [PATCH 06/10] Remove sudo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 950f69ce37..38400ca659 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,7 +802,7 @@ jobs: apt update -y && apt install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common - sudo apt-get remove -y python3-cffi-backend + apt-get remove -y python3-cffi-backend python3.9 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN bazel run --python-path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) From 59591ee9fb118a9d4c69d088956b5f2eccc9077f Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:54:50 +0100 Subject: [PATCH 07/10] python_path, new dependencies, apt reintall python3-cffi-backend --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38400ca659..17e19da427 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -805,7 +805,7 @@ jobs: apt-get remove -y python3-cffi-backend python3.9 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - bazel run --python-path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) + bazel run --python_path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) release-cleanup: executor: linux-x86_64-ubuntu-2204 From d452f30843388b9335e70e451240ccb2f7980d28 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 21 May 2024 16:55:14 +0100 Subject: [PATCH 08/10] Just use python 3.10 --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 17e19da427..a84b50705d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,10 +802,9 @@ jobs: apt update -y && apt install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common - apt-get remove -y python3-cffi-backend - python3.9 -m pip install -U cffi + python3.10 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN - bazel run --python_path=$(which python3.9) @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) + bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) release-cleanup: executor: linux-x86_64-ubuntu-2204 From bae8b75f4f54d293c391bbfd38c71d092e4edbc1 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Wed, 22 May 2024 16:38:00 +0100 Subject: [PATCH 09/10] Specify python interpreter for pip_parse for ci dependencies --- WORKSPACE | 4 +++- python/python_versions.bzl | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/WORKSPACE b/WORKSPACE index 45c1eb46e1..0c9799ca65 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -121,8 +121,10 @@ load("@vaticle_dependencies//tool/swig:deps.bzl", swig_deps = "deps") swig_deps() # Load //tool/common +load("//python:python_versions.bzl", "create_interpreter_symlinks") +create_interpreter_symlinks({"python39_symlink" : "python39"}) load("@vaticle_dependencies//tool/common:deps.bzl", "vaticle_dependencies_ci_pip") -vaticle_dependencies_ci_pip() +vaticle_dependencies_ci_pip("@python39_symlink//:python") load("@vaticle_dependencies_ci_pip//:requirements.bzl", "install_deps") install_deps() diff --git a/python/python_versions.bzl b/python/python_versions.bzl index 374ec8e455..380c56e1ef 100644 --- a/python/python_versions.bzl +++ b/python/python_versions.bzl @@ -53,3 +53,48 @@ python_versions = [ def register_all_toolchains(): for version in python_versions: python_register_toolchains(name=version["name"], python_version=version["python_version"], ignore_root_user_error = True) + +# Symlinks which allow us to use the right python interpreter +def create_interpreter_symlinks(target_names_to_version): + for (name, version) in target_names_to_version.items(): + python_interpreter_symlink(name=name, version=version) + +OS_NAMES = ("mac", "win", "linux") +OS_ARCHS = ("aarch64", "x86_64") +(MAC, WIN, LINUX) = OS_NAMES +(ARM64, X64) = OS_ARCHS + +PYTHON_INTERPRETER_SUFFIXES = { + (MAC, ARM64) : "aarch64-apple-darwin", + (MAC, X64) : "x86_64-apple-darwin", + (LINUX, ARM64): "aarch64-unknown-linux-gnu", + (LINUX, X64): "x86_64-unknown-linux-gnu", + (WIN, X64) : "x86_64-pc-windows-msvc", +} + +def _python_interpreter_symlink_impl(rctx): + os_name = None + for name in OS_NAMES: + if name in rctx.os.name: + os_name = name + + if os_name == None: + fail + os_arch = rctx.os.arch + interpreter_suffix = PYTHON_INTERPRETER_SUFFIXES.get((os_name, os_arch)) + + resolved_interpreter_label = Label("@" + rctx.attr.version + "_" + interpreter_suffix + "//:python") + build_file_content = """ +package(default_visibility = ["//visibility:public"]) +exports_files(["python"]) + """ + rctx.file("WORKSPACE", "workspace(name = \"%s\")"%rctx.attr.name) + rctx.file("BUILD.bazel", content=build_file_content, executable=False) + rctx.symlink(resolved_interpreter_label, "python") + +python_interpreter_symlink = repository_rule( + implementation= _python_interpreter_symlink_impl, + attrs={ + "version" : attr.string(mandatory=True), + } +) From d90c666bc954ea0bf24fadccd6beb33e0ea797f6 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Thu, 13 Jun 2024 14:09:32 +0100 Subject: [PATCH 10/10] Revert factory & circleci --- .circleci/config.yml | 8 +- .factory/automation.yml | 1134 +++++++++++++++++++-------------------- 2 files changed, 571 insertions(+), 571 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a84b50705d..191f214fcb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,7 +802,7 @@ jobs: apt update -y && apt install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt update -y && apt install -y python3.9 python3.9-distutils python3-pip software-properties-common - python3.10 -m pip install -U cffi + python3.9 -m pip install -U cffi export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${CIRCLE_PROJECT_REPONAME}@$(cat VERSION) @@ -978,9 +978,9 @@ workflows: - sync-dependencies: filters: branches: - only: [release, one-off-sync-dependencies-bazel-run-python-path] -# requires: -# - deploy-github + only: [release] + requires: + - deploy-github - release-cleanup: filters: branches: diff --git a/.factory/automation.yml b/.factory/automation.yml index 2a6419b1f7..9871d75291 100644 --- a/.factory/automation.yml +++ b/.factory/automation.yml @@ -1,567 +1,567 @@ -## 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. -# -#config: -# version-candidate: VERSION -# dependencies: -# dependencies: [build] -# typedb-behaviour: [build] -# typedb-protocol: [build, release] -# typeql: [build, release] -# -#build: -# quality: -# filter: -# owner: vaticle -# branch: [master, development] -# dependency-analysis: -# image: vaticle-ubuntu-22.04 -# command: | -# bazel run @vaticle_dependencies//factory/analysis:dependency-analysis -# -# correctness: -# build: -# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against -# machine: 16-core-64-gb -# command: | -# export PATH="$HOME/.local/bin:$PATH" -# sudo apt-get update -# sudo apt install python3-pip -y -# python3 -m pip install -U pip -# python3 -m pip install -r python/requirements_dev.txt -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# bazel build //... -# bazel run @vaticle_dependencies//tool/checkstyle:test-coverage -# bazel test $(bazel query 'kind(checkstyle_test, //...)') --test_output=errors -# bazel test $(bazel query 'kind(rustfmt_test, //...)') --@rules_rust//:rustfmt.toml=//rust:rustfmt_config -# cd nodejs -# npm install -# npm run lint -# -# build-dependency: -# image: vaticle-ubuntu-22.04 -# command: | -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# dependencies/maven/update.sh -# git diff --exit-code dependencies/maven/artifacts.snapshot -# bazel run @vaticle_dependencies//tool/unuseddeps:unused-deps -- list -# -# build-docs: -# image: vaticle-ubuntu-22.04 -# command: | -# curl -L https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz | tar xzO doxygen-1.10.0/bin/doxygen > /var/tmp/doxygen && -# sudo mv /var/tmp/doxygen /usr/local/bin/ && sudo chmod +x /usr/local/bin/doxygen -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# DOCS_DIRS="docs/modules/ROOT/partials/java docs/modules/ROOT/partials/nodejs docs/modules/ROOT/partials/python docs/modules/ROOT/partials/rust docs/modules/ROOT/partials/cpp docs/modules/ROOT/partials/c docs/modules/ROOT/partials/csharp" -# find $DOCS_DIRS -type f ! -name 'api-reference.adoc' -exec rm -f {} \; -# tool/docs/update.sh -# git add $DOCS_DIRS -# git diff --exit-code HEAD $DOCS_DIRS -# -# test-rust-unit-integration: -# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# bazel test //rust:typedb_driver_unit_tests --test_output=streamed || exit 1 -# tool/test/start-core-server.sh && -# bazel test //rust/tests --test_output=streamed --test_arg=-- \ -# --test_arg=integration::queries::core && -# export CORE_FAILED= || export CORE_FAILED=1 -# tool/test/stop-core-server.sh -# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi -# -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ -# --test_arg=integration::queries::cloud \ -# --test_arg=integration::runtimes \ -# --test_arg=integration::network && -# export CLOUD_FAILED= || export CLOUD_FAILED=1 -# tool/test/stop-cloud-servers.sh -# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi -# -# test-rust-behaviour-minimal: -# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ -# --test_arg=behaviour::concept && -# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ -# --test_arg=behaviour::connection && -# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ -# --test_arg=behaviour::driver && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# test-rust-behaviour-query-read: -# machine: 8-core-32-gb -# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against -# filter: -# owner: vaticle -# branch: [master, development] -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ -# --test_arg=behaviour::query::language::match_ \ -# --test_arg=behaviour::query::language::get \ -# --test_arg=behaviour::query::language::fetch \ -# --test_arg=behaviour::query::language::modifiers \ -# --test_arg=behaviour::query::language::expression && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# test-rust-behaviour-query-write: -# machine: 8-core-32-gb -# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against -# filter: -# owner: vaticle -# branch: [master, development] -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ -# --test_arg=behaviour::query::language::define \ -# --test_arg=behaviour::query::language::undefine \ -# --test_arg=behaviour::query::language::insert \ -# --test_arg=behaviour::query::language::delete \ -# --test_arg=behaviour::query::language::update \ -# --test_arg=behaviour::query::language::rule_validation && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# test-c-integration: -# image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# tool/test/start-core-server.sh && -# bazel test //c/tests/integration:test-driver --test_output=errors && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-core-server.sh -# exit $TEST_SUCCESS -# -# test-java-integration: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# bazel test //java/test/integration/... --test_output=errors -# -# test-java-behaviour-core: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# .factory/test-core.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 -# # TODO: delete --jobs=1 if we fix the issue with excess memory usage -# .factory/test-core.sh //java/test/behaviour/concept/... --test_output=errors -# .factory/test-core.sh //java/test/behaviour/driver/query/... --test_output=errors -# .factory/test-core.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 -# -# test-java-behaviour-cloud: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# .factory/test-cloud.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 -# # TODO: delete --jobs=1 if we fix the issue with excess memory usage -# .factory/test-cloud.sh //java/test/behaviour/concept/... --test_output=errors -# .factory/test-cloud.sh //java/test/behaviour/driver/query/... --test_output=errors -# .factory/test-cloud.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 -# -# test-python-behaviour-core: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# export PATH="$HOME/.local/bin:$PATH" -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# -# tool/test/start-core-server.sh && -# .factory/test-core.sh //python/tests/behaviour/connection/database/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //python/tests/behaviour/connection/session/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //python/tests/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //python/tests/behaviour/concept/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //python/tests/behaviour/driver/query/... --test_output=errors && -# .factory/test-core.sh //python/tests/behaviour/query/language/... --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-core-server.sh -# exit $TEST_SUCCESS -# -# test-python-behaviour-cloud: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# export PATH="$HOME/.local/bin:$PATH" -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# -# source tool/test/start-cloud-servers.sh && # use source to receive export vars -# .factory/test-cloud.sh //python/tests/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //python/tests/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //python/tests/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //python/tests/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //python/tests/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //python/tests/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && -# .factory/test-cloud.sh //python/tests/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# test-python-integration: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# export PATH="$HOME/.local/bin:$PATH" -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# -# tool/test/start-core-server.sh && -# bazel test //python/tests/integration:test_stream --test_output=streamed --jobs=1 && -# export CORE_FAILED= || export CORE_FAILED=1 -# tool/test/stop-core-server.sh -# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi -# -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //python/tests/integration:test_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# # TODO #635: currently broken test -# # bazel test //python/tests/integration:test_cloud_failover --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# export CLOUD_FAILED= || export CLOUD_FAILED=1 -# tool/test/stop-cloud-servers.sh -# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi -# -# test-nodejs-integration: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# bazel build //nodejs/... -# cp -rL bazel-bin/nodejs/node_modules nodejs/. -# cp -rL bazel-bin/nodejs/dist nodejs/. -# tool/test/start-core-server.sh && -# node nodejs/test/integration/test-concept.js && -# node nodejs/test/integration/test-query.js && -# node nodejs/test/integration/test-connection-core.js && -# export CORE_FAILED= || export CORE_FAILED=1 -# tool/test/stop-core-server.sh -# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi -# -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# node nodejs/test/integration/test-connection-cloud.js && -# node nodejs/test/integration/test-cloud-failover.js && -# export CLOUD_FAILED= || export CLOUD_FAILED=1 -# tool/test/stop-cloud-servers.sh -# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi -# -# test-nodejs-behaviour-core: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# tool/test/start-core-server.sh && -# .factory/test-core.sh //nodejs/test/behaviour/connection/database/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //nodejs/test/behaviour/connection/session/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //nodejs/test/behaviour/connection/transaction/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //nodejs/test/behaviour/concept/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //nodejs/test/behaviour/driver/query/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //nodejs/test/behaviour/query/language/... --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-core-server.sh -# exit $TEST_SUCCESS -# -# test-nodejs-behaviour-cloud: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# source tool/test/start-cloud-servers.sh && # use source to receive export vars -# .factory/test-cloud.sh //nodejs/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //nodejs/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //nodejs/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //nodejs/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //nodejs/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //nodejs/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //nodejs/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# test-cpp-integration: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# sudo apt-get update -# sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# tool/test/start-core-server.sh && -# bazel test //cpp/test/integration:test-cpp-driver-core --test_output=streamed --jobs=1 && -# export CORE_FAILED= || export CORE_FAILED=1 -# tool/test/stop-core-server.sh -# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi -# -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //cpp/test/integration:test-cpp-driver-cloud --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# export CLOUD_FAILED= || export CLOUD_FAILED=1 -# tool/test/stop-cloud-servers.sh -# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi -# -# test-cpp-behaviour-core: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# sudo apt-get update -# sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# tool/test/start-core-server.sh && -# .factory/test-core.sh //cpp/test/behaviour/connection/database/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //cpp/test/behaviour/connection/session/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //cpp/test/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //cpp/test/behaviour/concept/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //cpp/test/behaviour/driver/query/... --test_output=errors && -# .factory/test-core.sh //cpp/test/behaviour/query/language/... --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-core-server.sh -# exit $TEST_SUCCESS -# -# test-cpp-behaviour-cloud: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# source tool/test/start-cloud-servers.sh && -# .factory/test-cloud.sh //cpp/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //cpp/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //cpp/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //cpp/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //cpp/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //cpp/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && -# .factory/test-cloud.sh //cpp/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# test-csharp-integration: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# sudo apt-get update -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# tool/test/start-core-server.sh && -# bazel test //csharp/Test/Integration/Data/... --test_output=streamed --jobs=1 && -# bazel test //csharp/Test/Integration/Marshal/... --test_output=streamed --jobs=1 && -# .factory/test-core.sh //csharp/Test/Integration/Examples/... --test_output=streamed --jobs=1 && -# export CORE_FAILED= || export CORE_FAILED=1 -# tool/test/stop-core-server.sh -# if [[ -n "$CORE_FAILED" ]]; then exit 1; fi -# -# source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars -# bazel test //csharp/Test/Integration/Network/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Integration/Examples/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && -# export CLOUD_FAILED= || export CLOUD_FAILED=1 -# tool/test/stop-cloud-servers.sh -# if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi -# -# test-csharp-behaviour-core: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# sudo apt-get update -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# tool/test/start-core-server.sh && -# .factory/test-core.sh //csharp/Test/Behaviour/Connection/Database/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //csharp/Test/Behaviour/Connection/Session/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //csharp/Test/Behaviour/Concept/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //csharp/Test/Behaviour/Driver/Query/... --test_output=errors && -# .factory/test-core.sh //csharp/Test/Behaviour/Query/Language/... --test_output=errors --jobs=1 && -# .factory/test-core.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-core-server.sh -# exit $TEST_SUCCESS -# -# test-csharp-behaviour-cloud: -# image: vaticle-ubuntu-22.04 -# dependencies: -# - build -# type: foreground -# command: | -# export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME -# export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD -# bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh -# bazel run @vaticle_dependencies//distribution/artifact:create-netrc -# source tool/test/start-cloud-servers.sh && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/User/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Driver/Query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && -# export TEST_SUCCESS=0 || export TEST_SUCCESS=1 -# tool/test/stop-cloud-servers.sh -# exit $TEST_SUCCESS -# -# sync-dependencies: -# image: vaticle-ubuntu-22.04 -# filter: -# owner: vaticle -# branch: [master, development] -# dependencies: -# - build -# - build-dependency -# - build-docs -# - test-rust-unit-integration -# - test-rust-behaviour-minimal -# - test-rust-behaviour-query-read -# - test-rust-behaviour-query-write -# - test-c-integration -# - test-java-integration -# - test-java-behaviour-core -# - test-java-behaviour-cloud -# - test-python-behaviour-core -# - test-python-behaviour-cloud -# - test-python-integration -# - test-nodejs-integration -# - test-nodejs-behaviour-core -# - test-nodejs-behaviour-cloud -# - test-cpp-integration -# - test-cpp-behaviour-core -# - test-cpp-behaviour-cloud -# - test-csharp-integration -# - test-csharp-behaviour-core -# - test-csharp-behaviour-cloud -# command: | -# sudo add-apt-repository -y ppa:deadsnakes/ppa -# sudo apt update && sudo apt install -y python3.9 python3.9-distutils python3-pip -# python3.9 -m pip install -U cffi -# export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN -# bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${FACTORY_REPO}@${FACTORY_COMMIT} -# -## TODO #512: assembly tests for all drivers to run in factory -# -#release: -# filter: -# owner: vaticle -# branch: [master] -# validation: -# validate-dependencies: -# image: vaticle-ubuntu-22.04 -# command: | -# bazel test //:release-validate-deps --test_output=streamed -# validate-release-notes: -# image: vaticle-ubuntu-22.04 -# command: | -# export NOTES_VALIDATE_TOKEN=$REPO_GITHUB_TOKEN -# bazel run @vaticle_dependencies//tool/release/notes:validate --test_output=streamed -- $FACTORY_OWNER $FACTORY_REPO RELEASE_NOTES_LATEST.md -# -# deployment: -# trigger-release-circleci: -# image: vaticle-ubuntu-22.04 -# command: | -# git checkout -b release -# git push -f origin release -# echo "Successfully pushed branch 'release', which triggers a release workflow in CircleCI. The progress of the release can be tracked there." +# 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. + +config: + version-candidate: VERSION + dependencies: + dependencies: [build] + typedb-behaviour: [build] + typedb-protocol: [build, release] + typeql: [build, release] + +build: + quality: + filter: + owner: vaticle + branch: [master, development] + dependency-analysis: + image: vaticle-ubuntu-22.04 + command: | + bazel run @vaticle_dependencies//factory/analysis:dependency-analysis + + correctness: + build: + image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against + machine: 16-core-64-gb + command: | + export PATH="$HOME/.local/bin:$PATH" + sudo apt-get update + sudo apt install python3-pip -y + python3 -m pip install -U pip + python3 -m pip install -r python/requirements_dev.txt + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + bazel build //... + bazel run @vaticle_dependencies//tool/checkstyle:test-coverage + bazel test $(bazel query 'kind(checkstyle_test, //...)') --test_output=errors + bazel test $(bazel query 'kind(rustfmt_test, //...)') --@rules_rust//:rustfmt.toml=//rust:rustfmt_config + cd nodejs + npm install + npm run lint + + build-dependency: + image: vaticle-ubuntu-22.04 + command: | + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + dependencies/maven/update.sh + git diff --exit-code dependencies/maven/artifacts.snapshot + bazel run @vaticle_dependencies//tool/unuseddeps:unused-deps -- list + + build-docs: + image: vaticle-ubuntu-22.04 + command: | + curl -L https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz | tar xzO doxygen-1.10.0/bin/doxygen > /var/tmp/doxygen && + sudo mv /var/tmp/doxygen /usr/local/bin/ && sudo chmod +x /usr/local/bin/doxygen + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + DOCS_DIRS="docs/modules/ROOT/partials/java docs/modules/ROOT/partials/nodejs docs/modules/ROOT/partials/python docs/modules/ROOT/partials/rust docs/modules/ROOT/partials/cpp docs/modules/ROOT/partials/c docs/modules/ROOT/partials/csharp" + find $DOCS_DIRS -type f ! -name 'api-reference.adoc' -exec rm -f {} \; + tool/docs/update.sh + git add $DOCS_DIRS + git diff --exit-code HEAD $DOCS_DIRS + + test-rust-unit-integration: + image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + bazel test //rust:typedb_driver_unit_tests --test_output=streamed || exit 1 + tool/test/start-core-server.sh && + bazel test //rust/tests --test_output=streamed --test_arg=-- \ + --test_arg=integration::queries::core && + export CORE_FAILED= || export CORE_FAILED=1 + tool/test/stop-core-server.sh + if [[ -n "$CORE_FAILED" ]]; then exit 1; fi + + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ + --test_arg=integration::queries::cloud \ + --test_arg=integration::runtimes \ + --test_arg=integration::network && + export CLOUD_FAILED= || export CLOUD_FAILED=1 + tool/test/stop-cloud-servers.sh + if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi + + test-rust-behaviour-minimal: + image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ + --test_arg=behaviour::concept && + bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ + --test_arg=behaviour::connection && + bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ + --test_arg=behaviour::driver && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + test-rust-behaviour-query-read: + machine: 8-core-32-gb + image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against + filter: + owner: vaticle + branch: [master, development] + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ + --test_arg=behaviour::query::language::match_ \ + --test_arg=behaviour::query::language::get \ + --test_arg=behaviour::query::language::fetch \ + --test_arg=behaviour::query::language::modifiers \ + --test_arg=behaviour::query::language::expression && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + test-rust-behaviour-query-write: + machine: 8-core-32-gb + image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against + filter: + owner: vaticle + branch: [master, development] + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //rust/tests --test_output=streamed --test_env=ROOT_CA=$ROOT_CA --test_arg=-- \ + --test_arg=behaviour::query::language::define \ + --test_arg=behaviour::query::language::undefine \ + --test_arg=behaviour::query::language::insert \ + --test_arg=behaviour::query::language::delete \ + --test_arg=behaviour::query::language::update \ + --test_arg=behaviour::query::language::rule_validation && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + test-c-integration: + image: vaticle-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + tool/test/start-core-server.sh && + bazel test //c/tests/integration:test-driver --test_output=errors && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-core-server.sh + exit $TEST_SUCCESS + + test-java-integration: + image: vaticle-ubuntu-22.04 + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + bazel test //java/test/integration/... --test_output=errors + + test-java-behaviour-core: + image: vaticle-ubuntu-22.04 + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + .factory/test-core.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 + # TODO: delete --jobs=1 if we fix the issue with excess memory usage + .factory/test-core.sh //java/test/behaviour/concept/... --test_output=errors + .factory/test-core.sh //java/test/behaviour/driver/query/... --test_output=errors + .factory/test-core.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 + + test-java-behaviour-cloud: + image: vaticle-ubuntu-22.04 + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + .factory/test-cloud.sh //java/test/behaviour/connection/... --test_output=errors --jobs=1 + # TODO: delete --jobs=1 if we fix the issue with excess memory usage + .factory/test-cloud.sh //java/test/behaviour/concept/... --test_output=errors + .factory/test-cloud.sh //java/test/behaviour/driver/query/... --test_output=errors + .factory/test-cloud.sh //java/test/behaviour/query/language/... --test_output=errors --jobs=1 + + test-python-behaviour-core: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + export PATH="$HOME/.local/bin:$PATH" + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + + tool/test/start-core-server.sh && + .factory/test-core.sh //python/tests/behaviour/connection/database/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //python/tests/behaviour/connection/session/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //python/tests/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //python/tests/behaviour/concept/... --test_output=errors --jobs=1 && + .factory/test-core.sh //python/tests/behaviour/driver/query/... --test_output=errors && + .factory/test-core.sh //python/tests/behaviour/query/language/... --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-core-server.sh + exit $TEST_SUCCESS + + test-python-behaviour-cloud: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + export PATH="$HOME/.local/bin:$PATH" + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + + source tool/test/start-cloud-servers.sh && # use source to receive export vars + .factory/test-cloud.sh //python/tests/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //python/tests/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //python/tests/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //python/tests/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //python/tests/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //python/tests/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && + .factory/test-cloud.sh //python/tests/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + test-python-integration: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + export PATH="$HOME/.local/bin:$PATH" + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + + tool/test/start-core-server.sh && + bazel test //python/tests/integration:test_stream --test_output=streamed --jobs=1 && + export CORE_FAILED= || export CORE_FAILED=1 + tool/test/stop-core-server.sh + if [[ -n "$CORE_FAILED" ]]; then exit 1; fi + + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //python/tests/integration:test_connection --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + # TODO #635: currently broken test + # bazel test //python/tests/integration:test_cloud_failover --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + export CLOUD_FAILED= || export CLOUD_FAILED=1 + tool/test/stop-cloud-servers.sh + if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi + + test-nodejs-integration: + image: vaticle-ubuntu-22.04 + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + bazel build //nodejs/... + cp -rL bazel-bin/nodejs/node_modules nodejs/. + cp -rL bazel-bin/nodejs/dist nodejs/. + tool/test/start-core-server.sh && + node nodejs/test/integration/test-concept.js && + node nodejs/test/integration/test-query.js && + node nodejs/test/integration/test-connection-core.js && + export CORE_FAILED= || export CORE_FAILED=1 + tool/test/stop-core-server.sh + if [[ -n "$CORE_FAILED" ]]; then exit 1; fi + + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + node nodejs/test/integration/test-connection-cloud.js && + node nodejs/test/integration/test-cloud-failover.js && + export CLOUD_FAILED= || export CLOUD_FAILED=1 + tool/test/stop-cloud-servers.sh + if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi + + test-nodejs-behaviour-core: + image: vaticle-ubuntu-22.04 + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + tool/test/start-core-server.sh && + .factory/test-core.sh //nodejs/test/behaviour/connection/database/... --test_output=errors --jobs=1 && + .factory/test-core.sh //nodejs/test/behaviour/connection/session/... --test_output=errors --jobs=1 && + .factory/test-core.sh //nodejs/test/behaviour/connection/transaction/... --test_output=errors --jobs=1 && + .factory/test-core.sh //nodejs/test/behaviour/concept/... --test_output=errors --jobs=1 && + .factory/test-core.sh //nodejs/test/behaviour/driver/query/... --test_output=errors --jobs=1 && + .factory/test-core.sh //nodejs/test/behaviour/query/language/... --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-core-server.sh + exit $TEST_SUCCESS + + test-nodejs-behaviour-cloud: + image: vaticle-ubuntu-22.04 + dependencies: + - build + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + source tool/test/start-cloud-servers.sh && # use source to receive export vars + .factory/test-cloud.sh //nodejs/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //nodejs/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //nodejs/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //nodejs/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //nodejs/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //nodejs/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //nodejs/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + test-cpp-integration: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + sudo apt-get update + sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + tool/test/start-core-server.sh && + bazel test //cpp/test/integration:test-cpp-driver-core --test_output=streamed --jobs=1 && + export CORE_FAILED= || export CORE_FAILED=1 + tool/test/stop-core-server.sh + if [[ -n "$CORE_FAILED" ]]; then exit 1; fi + + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //cpp/test/integration:test-cpp-driver-cloud --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + export CLOUD_FAILED= || export CLOUD_FAILED=1 + tool/test/stop-cloud-servers.sh + if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi + + test-cpp-behaviour-core: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + sudo apt-get update + sudo apt install clang-format-15 -y && sudo ln -s $(which clang-format-15) /usr/bin/clang-format + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + tool/test/start-core-server.sh && + .factory/test-core.sh //cpp/test/behaviour/connection/database/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //cpp/test/behaviour/connection/session/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //cpp/test/behaviour/connection/transaction/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //cpp/test/behaviour/concept/... --test_output=errors --jobs=1 && + .factory/test-core.sh //cpp/test/behaviour/driver/query/... --test_output=errors && + .factory/test-core.sh //cpp/test/behaviour/query/language/... --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-core-server.sh + exit $TEST_SUCCESS + + test-cpp-behaviour-cloud: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + source tool/test/start-cloud-servers.sh && + .factory/test-cloud.sh //cpp/test/behaviour/connection/database/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //cpp/test/behaviour/connection/session/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //cpp/test/behaviour/connection/transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //cpp/test/behaviour/connection/user/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //cpp/test/behaviour/concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //cpp/test/behaviour/driver/query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && + .factory/test-cloud.sh //cpp/test/behaviour/query/language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + test-csharp-integration: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + sudo apt-get update + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + tool/test/start-core-server.sh && + bazel test //csharp/Test/Integration/Data/... --test_output=streamed --jobs=1 && + bazel test //csharp/Test/Integration/Marshal/... --test_output=streamed --jobs=1 && + .factory/test-core.sh //csharp/Test/Integration/Examples/... --test_output=streamed --jobs=1 && + export CORE_FAILED= || export CORE_FAILED=1 + tool/test/stop-core-server.sh + if [[ -n "$CORE_FAILED" ]]; then exit 1; fi + + source tool/test/start-cloud-servers.sh 3 && # use source to receive export vars + bazel test //csharp/Test/Integration/Network/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Integration/Examples/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 && + export CLOUD_FAILED= || export CLOUD_FAILED=1 + tool/test/stop-cloud-servers.sh + if [[ -n "$CLOUD_FAILED" ]]; then exit 1; fi + + test-csharp-behaviour-core: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + sudo apt-get update + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + tool/test/start-core-server.sh && + .factory/test-core.sh //csharp/Test/Behaviour/Connection/Database/... --test_output=errors --jobs=1 && + .factory/test-core.sh //csharp/Test/Behaviour/Connection/Session/... --test_output=errors --jobs=1 && + .factory/test-core.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_output=errors --jobs=1 && + .factory/test-core.sh //csharp/Test/Behaviour/Concept/... --test_output=errors --jobs=1 && + .factory/test-core.sh //csharp/Test/Behaviour/Driver/Query/... --test_output=errors && + .factory/test-core.sh //csharp/Test/Behaviour/Query/Language/... --test_output=errors --jobs=1 && + .factory/test-core.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-core-server.sh + exit $TEST_SUCCESS + + test-csharp-behaviour-cloud: + image: vaticle-ubuntu-22.04 + dependencies: + - build + type: foreground + command: | + export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME + export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD + bazel run @vaticle_dependencies//tool/bazelinstall:remote_cache_setup.sh + bazel run @vaticle_dependencies//distribution/artifact:create-netrc + source tool/test/start-cloud-servers.sh && + .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Database/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Session/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/Transaction/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Behaviour/Connection/User/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Behaviour/Concept/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Behaviour/Driver/Query/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors && + .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Language/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + .factory/test-cloud.sh //csharp/Test/Behaviour/Query/Reasoner/... --test_env=ROOT_CA=$ROOT_CA --test_output=errors --jobs=1 && + export TEST_SUCCESS=0 || export TEST_SUCCESS=1 + tool/test/stop-cloud-servers.sh + exit $TEST_SUCCESS + + sync-dependencies: + image: vaticle-ubuntu-22.04 + filter: + owner: vaticle + branch: [master, development] + dependencies: + - build + - build-dependency + - build-docs + - test-rust-unit-integration + - test-rust-behaviour-minimal + - test-rust-behaviour-query-read + - test-rust-behaviour-query-write + - test-c-integration + - test-java-integration + - test-java-behaviour-core + - test-java-behaviour-cloud + - test-python-behaviour-core + - test-python-behaviour-cloud + - test-python-integration + - test-nodejs-integration + - test-nodejs-behaviour-core + - test-nodejs-behaviour-cloud + - test-cpp-integration + - test-cpp-behaviour-core + - test-cpp-behaviour-cloud + - test-csharp-integration + - test-csharp-behaviour-core + - test-csharp-behaviour-cloud + command: | + sudo add-apt-repository -y ppa:deadsnakes/ppa + sudo apt update && sudo apt install -y python3.9 python3.9-distutils python3-pip + python3.9 -m pip install -U cffi + export SYNC_DEPENDENCIES_TOKEN=$REPO_GITHUB_TOKEN + bazel run @vaticle_dependencies//tool/sync:dependencies -- --source ${FACTORY_REPO}@${FACTORY_COMMIT} + +# TODO #512: assembly tests for all drivers to run in factory + +release: + filter: + owner: vaticle + branch: [master] + validation: + validate-dependencies: + image: vaticle-ubuntu-22.04 + command: | + bazel test //:release-validate-deps --test_output=streamed + validate-release-notes: + image: vaticle-ubuntu-22.04 + command: | + export NOTES_VALIDATE_TOKEN=$REPO_GITHUB_TOKEN + bazel run @vaticle_dependencies//tool/release/notes:validate --test_output=streamed -- $FACTORY_OWNER $FACTORY_REPO RELEASE_NOTES_LATEST.md + + deployment: + trigger-release-circleci: + image: vaticle-ubuntu-22.04 + command: | + git checkout -b release + git push -f origin release + echo "Successfully pushed branch 'release', which triggers a release workflow in CircleCI. The progress of the release can be tracked there."