Skip to content

Commit ec91011

Browse files
authored
chore(release): making a new release (#874)
Contains below feature PRs: - #864 - #862 - #845 - #850 - #875 - #877
2 parents 3ee0404 + f98a32c commit ec91011

File tree

137 files changed

+408
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+408
-245
lines changed

.licenserc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ header:
3030
- "docs/**"
3131
- "tests/**"
3232
- ".*"
33-
- "pytest_splunk_addon/standard_lib/**/*.json"
34-
- "pytest_splunk_addon/standard_lib/**/*.xsd"
33+
- "pytest_splunk_addon/**/*.json"
34+
- "pytest_splunk_addon/**/*.xsd"
3535
- "MANIFEST.in"
3636
- "entrypoint.sh"
3737
- "renovate.json"

docs/api_reference/addon_parser.md

Lines changed: 7 additions & 7 deletions

docs/api_reference/api_reference.md

Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion

docs/api_reference/cim_tests.md

Lines changed: 10 additions & 10 deletions

docs/api_reference/event_ingestion.md

Lines changed: 4 additions & 4 deletions

docs/api_reference/fields_tests.md

Lines changed: 4 additions & 4 deletions
Lines changed: 3 additions & 3 deletions

docs/api_reference/sample_generation.md

Lines changed: 4 additions & 4 deletions

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ pytz = "^2024.1"
5959
pytest11 = { plugin = "pytest_splunk_addon.plugin", "splunk" = "pytest_splunk_addon.splunk" }
6060

6161
[tool.poetry.scripts]
62-
cim-report = 'pytest_splunk_addon.standard_lib.utilities.junit_parser:main'
62+
cim-report = 'pytest_splunk_addon.utilities.junit_parser:main'
6363
cim-field-report = 'pytest_splunk_addon.tools.cim_field_report:main'
64-
sample_splitter = 'pytest_splunk_addon.standard_lib.utilities.sample_splitter:main'
64+
sample_splitter = 'pytest_splunk_addon.utilities.sample_splitter:main'
6565

6666
[build-system]
6767
requires = ["poetry>=1.0.2"]

pytest_splunk_addon/standard_lib/addon_parser/props_parser.py renamed to pytest_splunk_addon/addon_parser/props_parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
from .fields import convert_to_fields
3030
from .transforms_parser import TransformsParser
31+
from pytest_splunk_addon import utils
3132

3233
LOGGER = logging.getLogger("pytest-splunk-addon")
3334

@@ -110,7 +111,8 @@ def _get_props_method(self, class_name: str):
110111
LOGGER.info(f"Matched method of type={each_type}")
111112
return method_mapping[each_type]
112113
else:
113-
LOGGER.warning(f"No parser available for {class_name}. Skipping...")
114+
if utils.check_first_worker():
115+
LOGGER.warning(f"No parser available for {class_name}. Skipping...")
114116

115117
def _get_props_stanzas(self) -> Optional[Generator]:
116118
"""

pytest_splunk_addon/plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
#
1616
import logging
1717
import pytest
18-
from .standard_lib.sample_generation.sample_xdist_generator import SampleXdistGenerator
18+
19+
from .app_test_generator import AppTestGenerator
20+
from .sample_generation.sample_xdist_generator import SampleXdistGenerator
1921
import traceback
20-
from .standard_lib import AppTestGenerator
21-
from .standard_lib.cim_compliance import CIMReportPlugin
22+
from .cim_compliance import CIMReportPlugin
2223
from filelock import FileLock
2324

2425
LOG_FILE = "pytest_splunk_addon.log"

pytest_splunk_addon/standard_lib/sample_generation/rule.py renamed to pytest_splunk_addon/sample_generation/rule.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,8 @@ def replace(self, sample, token_count):
934934
url = self.fake.url()
935935

936936
if bool(set(["full", "path"]).intersection(value_list)):
937+
if value_list == ["path"]:
938+
url = ""
937939
url = (
938940
url
939941
+ "/"
@@ -944,8 +946,9 @@ def replace(self, sample, token_count):
944946
]
945947
)
946948
)
947-
948949
if bool(set(["full", "query"]).intersection(value_list)):
950+
if value_list == ["query"]:
951+
url = ""
949952
url = url + self.generate_url_query_params()
950953
yield self.token_value(*([str(url)] * 2))
951954
else:

pytest_splunk_addon/standard_lib/sample_generation/sample_xdist_generator.py renamed to pytest_splunk_addon/sample_generation/sample_xdist_generator.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import json
2121
import pytest
2222

23+
from pytest_splunk_addon import utils
24+
2325

2426
class SampleXdistGenerator:
2527
def __init__(self, addon_path, config_path=None, process_count=4):
@@ -28,14 +30,10 @@ def __init__(self, addon_path, config_path=None, process_count=4):
2830
self.config_path = config_path
2931

3032
def get_samples(self, store_events):
31-
3233
if self.tokenized_event_source == "pregenerated":
3334
with open(self.event_path, "rb") as file_obj:
3435
store_sample = pickle.load(file_obj)
35-
if store_events and (
36-
"PYTEST_XDIST_WORKER" not in os.environ
37-
or os.environ.get("PYTEST_XDIST_WORKER") == "gw0"
38-
):
36+
if store_events and utils.check_first_worker():
3937
try:
4038
tokenized_events = store_sample.get("tokenized_events")
4139
self.store_events(tokenized_events)

pytest_splunk_addon/standard_lib/sample_generation/schema.xsd renamed to pytest_splunk_addon/sample_generation/schema.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
</xs:sequence>
8484
</xs:complexType>
8585
</xs:element>
86+
<xs:element type="xs:string" name="note" minOccurs="0" />
8687
<xs:element type="xs:string" name="raw"/>
8788
<xs:element name="cim">
8889
<xs:complexType>
@@ -103,6 +104,7 @@
103104
<xs:extension base="xs:string">
104105
<xs:attribute type="xs:string" name="name" use="optional"/>
105106
<xs:attribute type="xs:string" name="value" use="optional"/>
107+
<xs:attribute type="xs:string" name="note" use="optional"/>
106108
</xs:extension>
107109
</xs:simpleContent>
108110
</xs:complexType>

0 commit comments

Comments
 (0)