From 0c0a85b6952f98d575ce099e62ddcbe4882cbf87 Mon Sep 17 00:00:00 2001 From: "bj00rn@users.noreply.github.com" Date: Mon, 4 Dec 2023 16:16:19 +0100 Subject: [PATCH] chore(ci): implement test server --- .gitignore | 1 - .pre-commit-config.yaml | 7 +++++-- .vscode/launch.json | 30 ++++++++++++++++++++++++++++++ .vscode/settings.json | 18 ++++++++++++++++++ .vscode/tasks.json | 13 +++++++++++++ 5 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.gitignore b/.gitignore index e9e1e9b..24f9b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ __pycache__/* .pydevproject .settings .idea -.vscode tags # Package files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6eb9c2..429d635 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,9 +9,7 @@ repos: - id: trailing-whitespace - id: check-added-large-files - id: check-ast - - id: check-json - id: check-merge-conflict - - id: check-xml - id: check-yaml - id: debug-statements - id: end-of-file-fixer @@ -74,3 +72,8 @@ repos: - id: commitlint stages: [commit-msg] additional_dependencies: ['conventional-changelog-conventionalcommits'] + +- repo: https://gitlab.com/bmares/check-json5 + rev: v1.0.0 + hooks: + - id: check-json5 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d3f9546 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Test server", + "type": "python", + "request": "launch", + "module": "aiohttp.web", + "justMyCode": true, + "args": ["-H", "localhost", "-P", "3001", "tests.utils.test_server:run_server"] + }, + { + "name": "Debug CLI", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/src/pysaleryd/skeleton.py", + "console": "integratedTerminal", + "justMyCode": true, + "args": [ + "--host", + "localhost", + "--port", + "3001" + ] + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f49d681 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,18 @@ +{ + "esbonio.sphinx.confDir": "", + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": [ + // Coverage is not supported by vscode: + // https://github.com/Microsoft/vscode-python/issues/693 + // Note that this will make pytest fail if pytest-cov is not installed, + // if that's the case, then this option needs to be be removed (overrides + // can be set at a workspace level, it's up to you to decide what's the + // best approach). You might also prefer to only set this option + // per-workspace (wherever coverage is used). + "--no-cov", + "-o", + "log_cli=1", + "--timeout=30", + "--verbose" + ], +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..b6359b2 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Run test server", + "type": "shell", + "command": "python", + "args": ["-m", "aiohttp.web", "-H", "localhost", "-P", "3001", "tests.utils.test_server:run_server"] + } + ] +}