Skip to content

Commit

Permalink
Merge branch 'main' into refactor/component-name-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted authored Aug 31, 2023
2 parents f8b1510 + e3ddc07 commit e721a02
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kpops/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ def generate(
pipeline = setup_pipeline(
pipeline_base_dir, pipeline_path, components_module, pipeline_config
)
pipeline.print_yaml()

if not template:
pipeline.print_yaml()

if template:
steps_to_apply = get_steps_to_apply(pipeline, steps, filter_type)
Expand Down
31 changes: 31 additions & 0 deletions tests/pipeline/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from pathlib import Path

import pytest
Expand Down Expand Up @@ -46,6 +47,36 @@ def test_load_pipeline(self, snapshot: SnapshotTest):

snapshot.assert_match(enriched_pipeline, "test-pipeline")

def test_generate_with_steps_flag_should_write_log_warning(
self, caplog: pytest.LogCaptureFixture
):
result = runner.invoke(
app,
[
"generate",
"--pipeline-base-dir",
str(PIPELINE_BASE_DIR_PATH),
str(RESOURCE_PATH / "first-pipeline/pipeline.yaml"),
"tests.pipeline.test_components",
"--defaults",
str(RESOURCE_PATH),
"--steps",
"a",
],
catch_exceptions=False,
)

assert caplog.record_tuples == [
(
"root",
logging.WARNING,
"The following flags are considered only when `--template` is set: \n \
'--steps'",
)
]

assert result.exit_code == 0

def test_name_equal_prefix_name_concatenation(self):
result = runner.invoke(
app,
Expand Down

0 comments on commit e721a02

Please sign in to comment.