Skip to content

Commit

Permalink
fix: playbook tests, makefile, acions adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaphoenix committed Aug 2, 2024
1 parent 3d9e294 commit 12945f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
pip install -r requirements.txt
- name: Running Tests
run: |
pytest tests/dfcx_scrapi/
pytest tests/dfcx_scrapi/ -vv
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ pfreeze:
pip freeze > requirements.txt

test:
pytest tests/dfcx_scrapi/core/$(f)
@if [ -n "$(v)" ]; then \
pytest tests/dfcx_scrapi/core/$(f) -vv; \
else \
pytest tests/dfcx_scrapi/core/$(f); \
fi

lint:
ruff check
Expand Down
23 changes: 13 additions & 10 deletions tests/dfcx_scrapi/core/test_playbooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,33 @@ def test_config():
]
)

# Note that we don't want any leading `-` in the final proto text because
# the UI / console automatically adds this in. If you include the `-` then
# you will end up with double leading `- -` in the console.
instructions_proto_from_str = types.Playbook.Instruction(
steps=[
types.Playbook.Step(
text="- Step 1",
text="Step 1",
steps=[
types.Playbook.Step(
text="- Step 1.1"
text="Step 1.1"
)
]
),
types.Playbook.Step(
text="- Step 2",
text="Step 2",
steps=[
types.Playbook.Step(
text="- Step 2.1",
text="Step 2.1",
steps=[
types.Playbook.Step(
text="- Step 2.1.1"
text="Step 2.1.1"
),
types.Playbook.Step(
text="- Step 2.1.2",
text="Step 2.1.2",
steps=[
types.Playbook.Step(
text="- Step 2.1.2.1"
text="Step 2.1.2.1"
)
]
)
Expand All @@ -88,7 +91,7 @@ def test_config():
]
),
types.Playbook.Step(
text="- Step 3"
text="Step 3"
)
]
)
Expand Down Expand Up @@ -373,7 +376,7 @@ def test_build_instructions_from_str(mock_playbooks, test_config):

assert res == test_config["instructions_proto_from_str"]

def test_parse_steps_simple(mock_playbooks):
def test_parse_steps_simple_list(mock_playbooks):
pb, _, _ = mock_playbooks

lines = [
Expand All @@ -392,7 +395,7 @@ def test_parse_steps_simple(mock_playbooks):
assert steps == expected_steps
assert next_index == 3

def test_parse_steps_nested(mock_playbooks, test_config):
def test_parse_steps_nested_list(mock_playbooks, test_config):
pb, _, _ = mock_playbooks

lines = [
Expand Down

0 comments on commit 12945f0

Please sign in to comment.