Skip to content

Commit

Permalink
chore(ci): implement test server
Browse files Browse the repository at this point in the history
  • Loading branch information
bj00rn committed Dec 4, 2023
1 parent ed1f0ec commit 0c0a85b
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ __pycache__/*
.pydevproject
.settings
.idea
.vscode
tags

# Package files
Expand Down
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
],
}
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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"]
}
]
}

0 comments on commit 0c0a85b

Please sign in to comment.