Skip to content

Commit

Permalink
refactor: remove standard_lib nested folder (#850)
Browse files Browse the repository at this point in the history
Moved modules from standard_lib folder to its parent folder
Kept addon_basic.py in standard_lib folder for backward compatibility.
  • Loading branch information
harshilgajera-crest committed Aug 2, 2024
1 parent d7f63ea commit 8256d2e
Show file tree
Hide file tree
Showing 131 changed files with 158 additions and 229 deletions.
4 changes: 2 additions & 2 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ header:
- "docs/**"
- "tests/**"
- ".*"
- "pytest_splunk_addon/standard_lib/**/*.json"
- "pytest_splunk_addon/standard_lib/**/*.xsd"
- "pytest_splunk_addon/**/*.json"
- "pytest_splunk_addon/**/*.xsd"
- "MANIFEST.in"
- "entrypoint.sh"
- "renovate.json"
Expand Down
14 changes: 7 additions & 7 deletions docs/api_reference/addon_parser.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# AddonParser

::: pytest_splunk_addon.standard_lib.addon_parser
::: pytest_splunk_addon.addon_parser
handler: python


## PropsParser

::: pytest_splunk_addon.standard_lib.addon_parser.props_parser
::: pytest_splunk_addon.addon_parser.props_parser
handler: python


## EventtypeParser

::: pytest_splunk_addon.standard_lib.addon_parser.eventtype_parser
::: pytest_splunk_addon.addon_parser.eventtype_parser
handler: python


## Field

::: pytest_splunk_addon.standard_lib.addon_parser.fields
::: pytest_splunk_addon.addon_parser.fields
handler: python


## TagsParser

::: pytest_splunk_addon.standard_lib.addon_parser.tags_parser
::: pytest_splunk_addon.addon_parser.tags_parser
handler: python


## TransformsParser

::: pytest_splunk_addon.standard_lib.addon_parser.transforms_parser
::: pytest_splunk_addon.addon_parser.transforms_parser
handler: python


## SavedsearchesParser

::: pytest_splunk_addon.standard_lib.addon_parser.savedsearches_parser
::: pytest_splunk_addon.addon_parser.savedsearches_parser
handler: python

2 changes: 1 addition & 1 deletion docs/api_reference/api_reference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API Documentation

::: pytest_splunk_addon.standard_lib
::: pytest_splunk_addon
handler: python


Expand Down
2 changes: 1 addition & 1 deletion docs/api_reference/app_test_generator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AppTestGenerator

::: pytest_splunk_addon.standard_lib.app_test_generator
::: pytest_splunk_addon.app_test_generator
handler: python
20 changes: 10 additions & 10 deletions docs/api_reference/cim_tests.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
# CimTests

::: pytest_splunk_addon.standard_lib.cim_tests
::: pytest_splunk_addon.cim_tests
handler: python

## TestTemplates

::: pytest_splunk_addon.standard_lib.cim_tests.test_templates
::: pytest_splunk_addon.cim_tests.test_templates
handler: python


## TestGenerator

::: pytest_splunk_addon.standard_lib.cim_tests.test_generator
::: pytest_splunk_addon.cim_tests.test_generator
handler: python


## DataModelHandler

::: pytest_splunk_addon.standard_lib.cim_tests.data_model_handler
::: pytest_splunk_addon.cim_tests.data_model_handler
handler: python


## DataModel

::: pytest_splunk_addon.standard_lib.cim_tests.data_model
::: pytest_splunk_addon.cim_tests.data_model
handler: python


## DataSet

::: pytest_splunk_addon.standard_lib.cim_tests.data_set
::: pytest_splunk_addon.cim_tests.data_set
handler: python


## FieldTestAdapter

::: pytest_splunk_addon.standard_lib.cim_tests.field_test_adapter
::: pytest_splunk_addon.cim_tests.field_test_adapter
handler: python


## FieldTestHelper

::: pytest_splunk_addon.standard_lib.cim_tests.field_test_helper
::: pytest_splunk_addon.cim_tests.field_test_helper
handler: python


## JsonSchema

::: pytest_splunk_addon.standard_lib.cim_tests.json_schema
::: pytest_splunk_addon.cim_tests.json_schema
handler: python


## BaseSchema

::: pytest_splunk_addon.standard_lib.cim_tests.base_schema
::: pytest_splunk_addon.cim_tests.base_schema
handler: python
8 changes: 4 additions & 4 deletions docs/api_reference/event_ingestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

## HEC Event Ingestor

::: pytest_splunk_addon.standard_lib.event_ingestors.hec_event_ingestor
::: pytest_splunk_addon.event_ingestors.hec_event_ingestor
handler: python


## HEC Raw Ingestor

::: pytest_splunk_addon.standard_lib.event_ingestors.hec_raw_ingestor
::: pytest_splunk_addon.event_ingestors.hec_raw_ingestor
handler: python


## SC4S Event Ingestor

::: pytest_splunk_addon.standard_lib.event_ingestors.sc4s_event_ingestor
::: pytest_splunk_addon.event_ingestors.sc4s_event_ingestor
handler: python


## File Monitor Ingestor

::: pytest_splunk_addon.standard_lib.event_ingestors.file_monitor_ingestor
::: pytest_splunk_addon.event_ingestors.file_monitor_ingestor
handler: python


8 changes: 4 additions & 4 deletions docs/api_reference/fields_tests.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# FieldsTests

::: pytest_splunk_addon.standard_lib.fields_tests
::: pytest_splunk_addon.fields_tests
handler: python


## TestTemplates

::: pytest_splunk_addon.standard_lib.fields_tests.test_templates
::: pytest_splunk_addon.fields_tests.test_templates
handler: python


## TestGenerator

::: pytest_splunk_addon.standard_lib.fields_tests.test_generator
::: pytest_splunk_addon.fields_tests.test_generator
handler: python


## FieldBank

::: pytest_splunk_addon.standard_lib.fields_tests.field_bank
::: pytest_splunk_addon.fields_tests.field_bank
handler: python

6 changes: 3 additions & 3 deletions docs/api_reference/index_time_tests.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# IndexTimeTests

::: pytest_splunk_addon.standard_lib.index_tests
::: pytest_splunk_addon.index_tests
handler: python


## TestTemplates

::: pytest_splunk_addon.standard_lib.index_tests.test_templates
::: pytest_splunk_addon.index_tests.test_templates
handler: python


## TestGenerator

::: pytest_splunk_addon.standard_lib.index_tests.test_generator
::: pytest_splunk_addon.index_tests.test_generator
handler: python

8 changes: 4 additions & 4 deletions docs/api_reference/sample_generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

## PytestSplunkAddonDataParser

::: pytest_splunk_addon.standard_lib.sample_generation.pytest_splunk_addon_data_parser
::: pytest_splunk_addon.sample_generation.pytest_splunk_addon_data_parser
handler: python

## SampleStanza

::: pytest_splunk_addon.standard_lib.sample_generation.sample_stanza
::: pytest_splunk_addon.sample_generation.sample_stanza
handler: python


## SampleEvent

::: pytest_splunk_addon.standard_lib.sample_generation.sample_event
::: pytest_splunk_addon.sample_generation.sample_event
handler: python


## Rule

::: pytest_splunk_addon.standard_lib.sample_generation.rule
::: pytest_splunk_addon.sample_generation.rule
handler: python
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ pytz = "^2024.1"
pytest11 = { plugin = "pytest_splunk_addon.plugin", "splunk" = "pytest_splunk_addon.splunk" }

[tool.poetry.scripts]
cim-report = 'pytest_splunk_addon.standard_lib.utilities.junit_parser:main'
cim-report = 'pytest_splunk_addon.utilities.junit_parser:main'
cim-field-report = 'pytest_splunk_addon.tools.cim_field_report:main'
sample_splitter = 'pytest_splunk_addon.standard_lib.utilities.sample_splitter:main'
sample_splitter = 'pytest_splunk_addon.utilities.sample_splitter:main'

[build-system]
requires = ["poetry>=1.0.2"]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from .fields import convert_to_fields
from .transforms_parser import TransformsParser
from pytest_splunk_addon.standard_lib import utils
from pytest_splunk_addon import utils

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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions pytest_splunk_addon/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
#
import logging
import pytest
from .standard_lib.sample_generation.sample_xdist_generator import SampleXdistGenerator

from .app_test_generator import AppTestGenerator
from .sample_generation.sample_xdist_generator import SampleXdistGenerator
import traceback
from .standard_lib import AppTestGenerator
from .standard_lib.cim_compliance import CIMReportPlugin
from .cim_compliance import CIMReportPlugin
from filelock import FileLock

LOG_FILE = "pytest_splunk_addon.log"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import json
import pytest

from pytest_splunk_addon.standard_lib import utils
from pytest_splunk_addon import utils


class SampleXdistGenerator:
Expand Down
6 changes: 3 additions & 3 deletions pytest_splunk_addon/splunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
from splunksplwrapper.manager.jobs import Jobs
from splunksplwrapper.splunk.cloud import CloudSplunk
from splunksplwrapper.SearchUtil import SearchUtil
from .standard_lib.event_ingestors import IngestorHelper
from .event_ingestors import IngestorHelper
from .docker_class import Services
from .standard_lib.CIM_Models.datamodel_definition import datamodels
from .CIM_Models.datamodel_definition import datamodels
import configparser
from filelock import FileLock

from pytest_splunk_addon.standard_lib import utils
from pytest_splunk_addon import utils

RESPONSIVE_SPLUNK_TIMEOUT = 300 # seconds

Expand Down
37 changes: 0 additions & 37 deletions pytest_splunk_addon/standard_lib/__init__.py

This file was deleted.

8 changes: 4 additions & 4 deletions pytest_splunk_addon/standard_lib/addon_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
field extractions and CIM compatibility.
"""

from .fields_tests import FieldTestTemplates
from .cim_tests import CIMTestTemplates
from .index_tests import IndexTimeTestTemplate
from .utilities.log_helper import get_table_output
from ..fields_tests import FieldTestTemplates
from ..cim_tests import CIMTestTemplates
from ..index_tests import IndexTimeTestTemplate
from ..utilities.log_helper import get_table_output
import pytest


Expand Down
2 changes: 1 addition & 1 deletion pytest_splunk_addon/tools/cim_field_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from splunksplwrapper.manager.jobs import Jobs
from splunksplwrapper.splunk.cloud import CloudSplunk
from pytest_splunk_addon.standard_lib.addon_parser import AddonParser
from pytest_splunk_addon.addon_parser import AddonParser

from splunklib import binding

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/e2e/test_cim_report.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import os

from pytest_splunk_addon.standard_lib.cim_compliance import CIMReportGenerator
from pytest_splunk_addon.cim_compliance import CIMReportGenerator


class TestCIMReport(object):
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_splunk_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import pytest
from tests.e2e import constants
from pytest_splunk_addon.standard_lib.sample_generation import SampleGenerator, Rule
from pytest_splunk_addon.sample_generation import SampleGenerator, Rule

logger = logging.getLogger("test_pytest_splunk_addon")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest.mock import patch, mock_open
from pytest_splunk_addon.standard_lib.addon_parser.eventtype_parser import (
from pytest_splunk_addon.addon_parser.eventtype_parser import (
EventTypeParser,
)

Expand Down
Loading

0 comments on commit 8256d2e

Please sign in to comment.