From 4d9fcd17a5eba408f6f494a254203916833de9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=96=D1=83=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= <33721692+LeaveMyYard@users.noreply.github.com> Date: Thu, 27 Apr 2023 18:15:57 +0300 Subject: Fix pytest --- robusta_krr/main.py | 5 ++++- tests/test_krr.py | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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 -- cgit v1.2.3 From 2223f12c47b5aef6fc416eff62f8be758024d6e7 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov <33721692+LeaveMyYard@users.noreply.github.com> Date: Thu, 27 Apr 2023 18:30:33 +0300 Subject: Update issue templates As proposed by GitHub --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md 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. -- cgit v1.2.3