Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.1.0 #595

Merged
merged 35 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ca3d9eb
Add exception logging in Script
kkedziak-splunk Feb 22, 2024
d9492f5
Merge branch 'master' into feature/improve_logging
kkedziak-splunk Apr 5, 2024
2869237
Revert CHANGELOG.md
kkedziak-splunk Apr 5, 2024
e5f7af0
Revert README.md
kkedziak-splunk Apr 5, 2024
3dab0b5
Update __init__.py
kkedziak-splunk Apr 5, 2024
be7dfe0
Refactor comment
kkedziak-splunk May 8, 2024
40e7b2a
DVPL-0: don't use latest splunk version because of HEC token issue
maszyk99 May 16, 2024
75806e6
Merge pull request #576 from splunk/DVPL-0/change-splunk-versions
maszyk99 May 17, 2024
e4a07be
Merge branch 'refs/heads/develop' into feature/improve_logging
kkedziak-splunk May 20, 2024
3ef0519
Change
kkedziak-splunk May 21, 2024
8d74bd5
Merge pull request #559 from kkedziak-splunk/feature/improve_logging
maszyk99 May 23, 2024
1a2d17f
Add python2/3 utils file back
maszyk99 Jun 25, 2024
ba04e1b
Merge pull request #578 from splunk/DVPL-0/add-six-py-back
maszyk99 Jun 27, 2024
a02b2ce
update pipelines so they would be testing python3.13
szymonjas Oct 15, 2024
a4085e0
DVPL-0: enable manual workflow trigger
maszyk99 Oct 16, 2024
6b55844
DVPL-0: fix test pipeline
maszyk99 Oct 20, 2024
eeb1ecf
Merge pull request #587 from splunk/DVPL-0/enable-manual-workflow-tri…
maszyk99 Oct 20, 2024
93f51c4
Add Service.macros
Synse Feb 13, 2023
6de12b1
Add tests for macros
Synse Feb 13, 2023
e7ba1c1
Merge pull request #589 from splunk/test-macros-pr
maszyk99 Oct 21, 2024
6ec2559
remove commands used to run test directly from setup.py
szymonjas Oct 24, 2024
1b44135
modify tox ini not to use deprecated libraries for unittests and add …
szymonjas Oct 24, 2024
97e1b60
Merge remote-tracking branch 'origin/develop' into DVPL-11087-Python3.13
szymonjas Oct 24, 2024
2f2e174
modify testing traceback so it would filter out additions to tracback…
szymonjas Oct 24, 2024
e3f3968
Revert "DVPL-0: don't use latest splunk version because of HEC token …
maszyk99 Oct 25, 2024
0c9469d
Merge pull request #593 from splunk/DVPL-0/update-splunk-image
szymonjas Oct 28, 2024
a8948f8
resolve conflicts
szymonjas Oct 29, 2024
41e8948
Merge remote-tracking branch 'origin/develop' into VULN-17383
szymonjas Oct 29, 2024
2a8931e
Merge pull request #590 from splunk/VULN-17383
szymonjas Oct 29, 2024
2b90307
Merge pull request #592 from splunk/DVPL-11087-Python3.13
szymonjas Oct 29, 2024
daf1bcd
Merge remote-tracking branch 'origin/master' into develop
szymonjas Oct 29, 2024
f637ade
use SSL DEFAULT CONTEX, use tls version min 1.2, allow for usage of S…
szymonjas Sep 25, 2024
180cdd2
Add changelog
szymonjas Oct 29, 2024
25c44e9
update changelog
szymonjas Oct 29, 2024
d36db5e
update ReadMe
szymonjas Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os:
- ubuntu-latest
python: [ 3.7, 3.9]
python: [ 3.7, 3.9, 3.13]
splunk-version:
- "8.1"
- "8.2"
Expand Down
111 changes: 1 addition & 110 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,124 +14,15 @@
# License for the specific language governing permissions and limitations
# under the License.

from setuptools import setup, Command

import os
import sys
from setuptools import setup

import splunklib

failed = False

def run_test_suite():
import unittest

def mark_failed():
global failed
failed = True

class _TrackingTextTestResult(unittest._TextTestResult):
def addError(self, test, err):
unittest._TextTestResult.addError(self, test, err)
mark_failed()

def addFailure(self, test, err):
unittest._TextTestResult.addFailure(self, test, err)
mark_failed()

class TrackingTextTestRunner(unittest.TextTestRunner):
def _makeResult(self):
return _TrackingTextTestResult(
self.stream, self.descriptions, self.verbosity)

original_cwd = os.path.abspath(os.getcwd())
os.chdir('tests')
suite = unittest.defaultTestLoader.discover('.')
runner = TrackingTextTestRunner(verbosity=2)
runner.run(suite)
os.chdir(original_cwd)

return failed


def run_test_suite_with_junit_output():
try:
import unittest2 as unittest
except ImportError:
import unittest
import xmlrunner
original_cwd = os.path.abspath(os.getcwd())
os.chdir('tests')
suite = unittest.defaultTestLoader.discover('.')
xmlrunner.XMLTestRunner(output='../test-reports').run(suite)
os.chdir(original_cwd)


class CoverageCommand(Command):
"""setup.py command to run code coverage of the test suite."""
description = "Create an HTML coverage report from running the full test suite."
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
try:
import coverage
except ImportError:
print("Could not import coverage. Please install it and try again.")
exit(1)
cov = coverage.coverage(source=['splunklib'])
cov.start()
run_test_suite()
cov.stop()
cov.html_report(directory='coverage_report')


class TestCommand(Command):
"""setup.py command to run the whole test suite."""
description = "Run test full test suite."
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
failed = run_test_suite()
if failed:
sys.exit(1)


class JunitXmlTestCommand(Command):
"""setup.py command to run the whole test suite."""
description = "Run test full test suite with JUnit-formatted output."
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
run_test_suite_with_junit_output()


setup(
author="Splunk, Inc.",

author_email="[email protected]",

cmdclass={'coverage': CoverageCommand,
'test': TestCommand,
'testjunit': JunitXmlTestCommand},

description="The Splunk Software Development Kit for Python.",

license="http://www.apache.org/licenses/LICENSE-2.0",
Expand Down
1 change: 1 addition & 0 deletions tests/modularinput/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def stream_events(self, inputs, ew):
# Remove paths and line numbers
err = re.sub(r'File "[^"]+', 'File "...', err.getvalue())
err = re.sub(r'line \d+', 'line 123', err)
err = re.sub(r' +~+\^+', '', err)

assert out.getvalue() == ""
assert err == (
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = clean,docs,py37,py39
envlist = clean,docs,py37,py39,313
skipsdist = {env:TOXBUILD:false}

[testenv:pep8]
Expand Down Expand Up @@ -28,8 +28,6 @@ setenv = SPLUNK_HOME=/opt/splunk
allowlist_externals = make
deps = pytest
pytest-cov
xmlrunner
unittest-xml-reporting
python-dotenv

distdir = build
Expand Down
Loading