Skip to content

Commit 028f741

Browse files
committed
Add .env to .gitignore
1 parent 7bd53fc commit 028f741

File tree

6 files changed

+109
-50
lines changed

6 files changed

+109
-50
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ venv/
2727
.mypy_cache/
2828
.tox
2929
test-reports/
30-
*.code-workspace
30+
.env

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Install the sources you cloned from GitHub:
6060
You'll need `docker` and `docker-compose` to get up and running using this method.
6161

6262
```shell
63-
make up SPLUNK_VERSION=9.4
63+
make up SPLUNK_VERSION=latest # also available: 10, 9.4
6464
make wait_up
6565
make test
6666
make down
@@ -213,18 +213,18 @@ Don't
213213
- In stream_events() method we can access modular input app metadata from InputDefinition object
214214
- See [GitHub Commit](https://github.com/splunk/splunk-app-examples/blob/master/modularinputs/python/github_commits/bin/github_commits.py) Modular input App example for reference.
215215

216-
```python
217-
def stream_events(self, inputs, ew):
218-
# other code
216+
```python
217+
def stream_events(self, inputs, ew):
218+
# other code
219219

220-
# access metadata (like server_host, server_uri, etc) of modular inputs app from InputDefinition object
221-
# here inputs is a InputDefinition object
222-
server_host = inputs.metadata["server_host"]
223-
server_uri = inputs.metadata["server_uri"]
220+
# access metadata (like server_host, server_uri, etc) of modular inputs app from InputDefinition object
221+
# here inputs is a InputDefinition object
222+
server_host = inputs.metadata["server_host"]
223+
server_uri = inputs.metadata["server_uri"]
224224

225-
# Get the checkpoint directory out of the modular input's metadata
226-
checkpoint_dir = inputs.metadata["checkpoint_dir"]
227-
```
225+
# Get the checkpoint directory out of the modular input's metadata
226+
checkpoint_dir = inputs.metadata["checkpoint_dir"]
227+
```
228228

229229
### Access service object in Custom Search Command & Modular Input apps
230230

docker-compose.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
version: '3.6'
2-
31
services:
4-
splunk:
5-
image: "splunk/splunk:${SPLUNK_VERSION}"
6-
container_name: splunk
7-
environment:
8-
- SPLUNK_START_ARGS=--accept-license
9-
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
10-
- SPLUNK_PASSWORD=changed!
11-
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
12-
ports:
13-
- 8000:8000
14-
- 8088:8088
15-
- 8089:8089
16-
healthcheck:
17-
test: ['CMD', 'curl', '-f', 'http://localhost:8000']
18-
interval: 5s
19-
timeout: 5s
20-
retries: 20
21-
volumes:
22-
- "./tests/searchcommands/test_apps/eventing_app:/opt/splunk/etc/apps/eventing_app"
23-
- "./tests/searchcommands/test_apps/generating_app:/opt/splunk/etc/apps/generating_app"
24-
- "./tests/searchcommands/test_apps/reporting_app:/opt/splunk/etc/apps/reporting_app"
25-
- "./tests/searchcommands/test_apps/streaming_app:/opt/splunk/etc/apps/streaming_app"
26-
- "./splunklib:/opt/splunk/etc/apps/eventing_app/lib/splunklib"
27-
- "./splunklib:/opt/splunk/etc/apps/generating_app/lib/splunklib"
28-
- "./splunklib:/opt/splunk/etc/apps/reporting_app/lib/splunklib"
29-
- "./splunklib:/opt/splunk/etc/apps/streaming_app/lib/splunklib"
2+
splunk:
3+
image: "splunk/splunk:${SPLUNK_VERSION}"
4+
container_name: splunk
5+
platform: linux/amd64
6+
environment:
7+
- SPLUNK_START_ARGS=--accept-license
8+
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
9+
- SPLUNK_PASSWORD=changed!
10+
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
11+
ports:
12+
- 8000:8000
13+
- 8088:8088
14+
- 8089:8089
15+
healthcheck:
16+
test: ["CMD", "curl", "-f", "http://localhost:8000"]
17+
interval: 5s
18+
timeout: 5s
19+
retries: 20
20+
volumes:
21+
- "./tests/searchcommands/test_apps/eventing_app:/opt/splunk/etc/apps/eventing_app"
22+
- "./tests/searchcommands/test_apps/generating_app:/opt/splunk/etc/apps/generating_app"
23+
- "./tests/searchcommands/test_apps/reporting_app:/opt/splunk/etc/apps/reporting_app"
24+
- "./tests/searchcommands/test_apps/streaming_app:/opt/splunk/etc/apps/streaming_app"
25+
- "./splunklib:/opt/splunk/etc/apps/eventing_app/lib/splunklib"
26+
- "./splunklib:/opt/splunk/etc/apps/generating_app/lib/splunklib"
27+
- "./splunklib:/opt/splunk/etc/apps/reporting_app/lib/splunklib"
28+
- "./splunklib:/opt/splunk/etc/apps/streaming_app/lib/splunklib"

sitecustomize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
try:
2020
import coverage
21+
2122
coverage.process_startup()
2223
except:
24+
# TODO: Add logging
2325
pass

splunk-sdk-python.code-workspace

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {
8+
"makefile.configureOnOpen": false,
9+
"cSpell.words": [
10+
"autologin",
11+
"basepython",
12+
"coveragerc",
13+
"distdir",
14+
"docstrings",
15+
"dotenv",
16+
"envlist",
17+
"envname",
18+
"eventingcsc",
19+
"healthcheck",
20+
"junitxml",
21+
"levelname",
22+
"LICEN",
23+
"modularinput",
24+
"mypy",
25+
"passenv",
26+
"posargs",
27+
"pypa",
28+
"pypi",
29+
"pytest",
30+
"PYTHONPATH",
31+
"sdist",
32+
"searchcommands",
33+
"setuptools",
34+
"skipsdist",
35+
"Splunkd",
36+
"splunklib",
37+
"testlib",
38+
"TOXBUILD"
39+
]
40+
},
41+
"extensions": {
42+
"recommendations": [
43+
"aaron-bond.better-comments",
44+
"christian-kohler.path-intellisense",
45+
"mikestead.dotenv",
46+
"ms-python.black-formatter",
47+
"ms-python.debugpy",
48+
"ms-python.isort",
49+
"ms-python.python",
50+
"ms-python.vscode-pylance",
51+
"ms-python.vscode-python-envs",
52+
"ms-vscode.makefile-tools",
53+
"streetsidesoftware.code-spell-checker",
54+
"pflannery.vscode-versionlens",
55+
"splunk.splunk",
56+
"charliermarsh.ruff"
57+
]
58+
}
59+
}

tests/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Splunk Test Suite
22

3-
The test suite uses Python's standard library and the built-in **unittest**
4-
library. The Splunk Enterprise SDK for Python has been tested with Python v3.7
3+
The test suite uses Python's standard library and the built-in **unittest**
4+
library. The Splunk Enterprise SDK for Python has been tested with Python v3.7
55
and v3.9.
66

7-
To run the unit tests, open a command prompt in the **/splunk-sdk-python**
7+
To run the unit tests, open a command prompt in the **/splunk-sdk-python**
88
directory and enter:
99

1010
python setup.py test
1111

12-
You can also run individual test files, which are located in
13-
**/splunk-sdk-python/tests**. Each distinct area of the SDK is tested in a
12+
You can also run individual test files, which are located in
13+
**/splunk-sdk-python/tests**. Each distinct area of the SDK is tested in a
1414
single file. For example, roles are tested
1515
in `test_role.py`. To run this test, open a command prompt in
1616
the **/splunk-sdk-python/tests** subdirectory and enter:
@@ -21,11 +21,10 @@ NOTE: Before running the test suite, make sure the instance of Splunk you
2121
are testing against doesn't have new events being dumped continuously
2222
into it. Several of the tests rely on a stable event count. It's best
2323
to test against a clean install of Splunk, but if you can't, you
24-
should at least disable the *NIX and Windows apps. Do not run the test
24+
should at least disable the \*NIX and Windows apps. Do not run the test
2525
suite against a production instance of Splunk! It will run just fine
2626
with the free Splunk license.
2727

28-
2928
## Code Coverage
3029

3130
Coverage.py is an excellent tool for measuring code coverage of Python programs.
@@ -43,8 +42,8 @@ prompt in the **/splunk-sdk-python** directory and enter:
4342

4443
python setup.py coverage
4544

46-
This command runs the entire test suite and writes an HTML coverage report to
45+
This command runs the entire test suite and writes an HTML coverage report to
4746
the **/splunk-sdk-python/coverage_report** directory.
4847

49-
For more information about Coverage.py, see the author's website
50-
([http://nedbatchelder.com/code/coverage/](http://nedbatchelder.com/code/coverage/)).
48+
For more information about Coverage.py, see the author's website
49+
([http://nedbatchelder.com/code/coverage/](http://nedbatchelder.com/code/coverage/)).

0 commit comments

Comments
 (0)