Skip to content

Commit 6f8b98d

Browse files
Revert "fix: terminate tests for improper props conf" (#902)
Reverts #901 We decided to keep the check for conf files in app inspect (the check is already implemented, but requires a fix) : https://splunk.atlassian.net/browse/A3-1577 Also upgraded pip for test-splunk-external job: https://github.com/splunk/pytest-splunk-addon/actions/runs/13541590970/job/37843909257#step:3:19
1 parent e29e0f7 commit 6f8b98d

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

.github/workflows/build-test-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ jobs:
9797
submodules: true
9898
- name: Setup for testing
9999
run: |
100-
pip install git+https://github.com/pixelb/crudini
101100
mkdir test-results-${{ matrix.splunk.version }}
102101
- name: Test
103102
run: |

pytest_splunk_addon/addon_parser/transforms_parser.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import re
2424
import os
2525
import csv
26-
import sys
2726

2827
import addonfactory_splunk_conf_parser_lib as conf_parser
2928

@@ -115,9 +114,6 @@ def get_transform_fields(self, transforms_stanza: str) -> Optional[Generator]:
115114
LOGGER.error(
116115
f"The stanza {transforms_stanza} does not exists in transforms.conf."
117116
)
118-
sys.exit(
119-
f"The stanza {transforms_stanza} does not exists in transforms.conf."
120-
)
121117

122118
def get_lookup_csv_fields(self, lookup_stanza: str) -> Optional[Generator]:
123119
"""

tests/e2e/addons/TA_broken/default/props.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ LOOKUP-PASS_test_lookup_not_found = broken-NaN_lookup FAIL_component FAIL_broken
5858
REPORT-broken-FAIL_tsc-delim-fields = broken-tsc-delim-fields
5959
REPORT-broken-PASS_tsc-sk-regex-format = broken-tsc-sk-regex-format
6060
REPORT-broken-FAIL_tsc-sk-delim-format = broken-contact_mode_extract
61-
REPORT-broken-FAIL_tsc-regex-format = broken-tsc-regex-format
61+
# If a non_existing stanza is present then no testcases are generated for it.
62+
REPORT-broken-FAIL_tsc-regex-format = broken-tsc-regex-format, broken-non_existing_transforms_stanza
6263

6364
# Component tested: FIELDALIAS
6465
# Scenario: Plugin searches for the original field and one or more alias field names.

tests/unit/tests_standard_lib/test_addon_parser/test_transforms_parser.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ def test_no_transforms_config_file():
6161
assert transforms_parser.transforms is None
6262

6363

64-
def test_stanza_does_not_exist_in_transforms():
64+
def test_stanza_does_not_exist_in_transforms(caplog):
6565
transforms_conf_path = os.path.join(os.path.dirname(__file__), "testdata")
6666
transforms_parser = TransformsParser(transforms_conf_path)
67-
with pytest.raises(SystemExit) as excinfo:
68-
for result in transforms_parser.get_transform_fields("dummy_stanza"):
69-
assert result is None
70-
assert "The stanza dummy_stanza does not exists in transforms.conf." == str(
71-
excinfo.value
67+
for result in transforms_parser.get_transform_fields("dummy_stanza"):
68+
assert result is None
69+
assert (
70+
"The stanza dummy_stanza does not exists in transforms.conf." in caplog.messages
7271
)
7372

7473

0 commit comments

Comments
 (0)