From cd9131978159a23aa0c24a3845c3a87a92ec62b0 Mon Sep 17 00:00:00 2001 From: Nikita Melkozerov Date: Wed, 6 Mar 2024 15:08:22 +0000 Subject: [PATCH] fix the tests --- .devcontainer/Dockerfile | 3 +++ .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .devcontainer/docker-compose.yml | 26 ++++++++++++++++++++++++++ .github/dependabot.yml | 12 ++++++++++++ tests/fixclient_test.py | 6 ++++++ 5 files changed, 72 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..083f704 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,3 @@ +FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye + +ENV PYTHONUNBUFFERED 1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..db2d0d2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "features": { + "ghcr.io/devcontainers-contrib/features/poetry:2": {} + }, + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 8900, + 8529 + ], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip install --upgrade pip poetry nox nox-poetry" + // Configure tool-specific properties. + // "customizations": {}, + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..6ad43f7 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile + + volumes: + - ../..:/workspaces:cached + - ${HOME}/.ssh:/home/vscode/.ssh + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + resotocore: + image: somecr.io/someengineering/fixcore:4.0.0 + network_mode: service:app + environment: + RESOTOCORE_ANALYTICS_OPT_OUT: true + RESOTOCORE_OVERRIDE: "resotocore.api.web_hosts=0.0.0.0" + arangodb: + image: arangodb:3.10.5 + network_mode: service:app + environment: + ARANGO_NO_AUTH: 1 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/tests/fixclient_test.py b/tests/fixclient_test.py index 7253e6f..04bb48b 100644 --- a/tests/fixclient_test.py +++ b/tests/fixclient_test.py @@ -63,7 +63,13 @@ async def core_ready() -> bool: # chech that connection is possible list(client.cli_execute("system info")) + # fix is the default name of the graph for many calls + # let's create it first + client.create_graph("fix") client.update_model(foo_kinds) + # graphtest needs to have the model too. + client.create_graph(g) + client.update_model(foo_kinds, g) yield client