summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Zhukov <33721692+LeaveMyYard@users.noreply.github.com>2023-04-27 18:32:23 +0300
committerGitHub <noreply@github.com>2023-04-27 18:32:23 +0300
commitfa4cd5b953544dcd953ed0a6133bd594293ce415 (patch)
tree3cec6ef2a8ffa121f31333ad7f5ef8246cd27c87
parent26b867a3fa859a112e8eb0a6c1e18930355fe03d (diff)
parent2223f12c47b5aef6fc416eff62f8be758024d6e7 (diff)
Merge branch 'main' into main
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md38
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.md20
-rw-r--r--robusta_krr/main.py5
-rw-r--r--tests/test_krr.py7
4 files changed, 66 insertions, 4 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..dd84ea7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,38 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Desktop (please complete the following information):**
+ - OS: [e.g. iOS]
+ - Browser [e.g. chrome, safari]
+ - Version [e.g. 22]
+
+**Smartphone (please complete the following information):**
+ - Device: [e.g. iPhone6]
+ - OS: [e.g. iOS8.1]
+ - Browser [e.g. stock browser, safari]
+ - Version [e.g. 22]
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..bbcbbe7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/robusta_krr/main.py b/robusta_krr/main.py
index 0412974..fdd654d 100644
--- a/robusta_krr/main.py
+++ b/robusta_krr/main.py
@@ -36,7 +36,7 @@ def __process_type(_T: type) -> str:
return "str" # It the type is unknown, just use str and let pydantic handle it
-def run() -> None:
+def load_commands() -> None:
for strategy_name, strategy_type in BaseStrategy.get_all().items(): # type: ignore
FUNC_TEMPLATE = textwrap.dedent(
"""
@@ -133,6 +133,9 @@ def run() -> None:
locals(),
)
+
+def run() -> None:
+ load_commands()
app()
diff --git a/tests/test_krr.py b/tests/test_krr.py
index 30704ba..23dab01 100644
--- a/tests/test_krr.py
+++ b/tests/test_krr.py
@@ -9,9 +9,10 @@ import pytest
import yaml
from typer.testing import CliRunner
-from robusta_krr import app
+from robusta_krr.main import app, load_commands
runner = CliRunner()
+load_commands()
STRATEGY_NAME = "simple"
@@ -28,7 +29,7 @@ def test_help():
def test_run(log_flag: str):
result = runner.invoke(app, [STRATEGY_NAME, log_flag, "--namespace", "default"])
try:
- assert result.exit_code == 0
+ assert result.exit_code == 0, result.stdout
except AssertionError as e:
raise e from result.exception
@@ -37,7 +38,7 @@ def test_run(log_flag: str):
def test_output_formats(format: str):
result = runner.invoke(app, [STRATEGY_NAME, "-q", "-f", format, "--namespace", "default"])
try:
- assert result.exit_code == 0
+ assert result.exit_code == 0, result.exc_info
except AssertionError as e:
raise e from result.exception