Skip to content

Commit cfdff60

Browse files
committed
Readme updates
1 parent 56c2d58 commit cfdff60

File tree

3 files changed

+83
-64
lines changed

3 files changed

+83
-64
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,21 @@ test:
2626
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
2727
@tox -e py27,py37
2828

29+
.PHONY: test_specific
30+
test_specific:
31+
@echo "$(ATTN_COLOR)==> test_specific $(NO_COLOR)"
32+
@sh ./scripts/test_specific.sh
33+
2934
.PHONY: test_smoke
3035
test_smoke:
3136
@echo "$(ATTN_COLOR)==> test_smoke $(NO_COLOR)"
3237
@tox -e py27,py37 -- -m smoke
3338

39+
.PHONY: test_no_app
40+
test_no_app:
41+
@echo "$(ATTN_COLOR)==> test_no_app $(NO_COLOR)"
42+
@tox -e py27,py37 -- -m "not app"
43+
3444
.PHONY: test_smoke_no_app
3545
test_smoke_no_app:
3646
@echo "$(ATTN_COLOR)==> test_smoke_no_app $(NO_COLOR)"

README.md

Lines changed: 71 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
#### Version 1.6.12
77

8-
The Splunk Software Development Kit (SDK) for Python contains library code and
8+
The Splunk Software Development Kit (SDK) for Python contains library code and
99
examples designed to enable developers to build applications using Splunk.
1010

1111
Splunk is a search engine and analytic environment that uses a distributed
12-
map-reduce architecture to efficiently index, search and process large
12+
map-reduce architecture to efficiently index, search and process large
1313
time-varying data sets.
1414

1515
The Splunk product is popular with system administrators for aggregation and
@@ -25,31 +25,31 @@ are enabled by Splunk's unique capabilities.
2525
## Getting started with the Splunk SDK for Python
2626

2727
The Splunk SDK for Python contains library code and examples that show how to
28-
programmatically interact with Splunk for a variety of scenarios including
29-
searching, saved searches, data inputs, and many more, along with building
30-
complete applications.
28+
programmatically interact with Splunk for a variety of scenarios including
29+
searching, saved searches, data inputs, and many more, along with building
30+
complete applications.
3131

3232
The information in this Readme provides steps to get going quickly, but for more
33-
in-depth information be sure to visit the
34-
[Splunk Developer Portal](http://dev.splunk.com/view/SP-CAAAEBB).
33+
in-depth information be sure to visit the
34+
[Splunk Developer Portal](http://dev.splunk.com/view/SP-CAAAEBB).
3535
### Requirements
3636

3737
Here's what you need to get going with the Splunk SDK for Python.
3838

3939
#### Python
4040

41-
The Splunk SDK for Python requires Python 2.7+, including Python 3. The Splunk SDK for Python has been tested with Python v2.7 and v3.5.
41+
The Splunk SDK for Python requires Python 2.7+, including Python 3. The Splunk SDK for Python has been tested with Python v2.7 and v3.5.
4242

4343
#### Splunk
4444

45-
If you haven't already installed Splunk, download it
46-
[here](http://www.splunk.com/download). For more about installing and running
47-
Splunk and system requirements, see
45+
If you haven't already installed Splunk, download it
46+
[here](http://www.splunk.com/download). For more about installing and running
47+
Splunk and system requirements, see
4848
[Installing & Running Splunk](http://dev.splunk.com/view/SP-CAAADRV). The Splunk SDK for Python has been tested with Splunk Enterprise 7.0 and 7.2.
4949

5050
#### Splunk SDK for Python
51-
Get the Splunk SDK for Python; [download the SDK as a ZIP](http://dev.splunk.com/view/SP-CAAAEBB)
52-
and extract the files. Or, if you want to contribute to the SDK, clone the
51+
Get the Splunk SDK for Python; [download the SDK as a ZIP](http://dev.splunk.com/view/SP-CAAAEBB)
52+
and extract the files. Or, if you want to contribute to the SDK, clone the
5353
repository from [GitHub](https://github.com/splunk/splunk-sdk-python).
5454

5555

@@ -85,17 +85,17 @@ home folder and are running OS X or Linux, add the following line to your
8585
export PYTHONPATH=~/splunk-sdk-python
8686

8787
The SDK command-line examples require a common set of arguments
88-
that specify things like the Splunk host, port, and login credentials. For a
89-
full list of command-line arguments, include `--help` as an argument to any of
90-
the examples.
88+
that specify things like the Splunk host, port, and login credentials. For a
89+
full list of command-line arguments, include `--help` as an argument to any of
90+
the examples.
9191

9292
#### .splunkrc
9393

9494
To connect to Splunk, many of the SDK examples and unit tests take command-line
9595
arguments that specify values for the host, port, and login credentials for
9696
Splunk. For convenience during development, you can store these arguments as
97-
key-value pairs in a text file named **.splunkrc**. Then, the SDK examples and
98-
unit tests use the values from the **.splunkrc** file when you don't specify
97+
key-value pairs in a text file named **.splunkrc**. Then, the SDK examples and
98+
unit tests use the values from the **.splunkrc** file when you don't specify
9999
them.
100100

101101
To use this convenience file, create a text file with the following format:
@@ -115,39 +115,39 @@ To use this convenience file, create a text file with the following format:
115115

116116
Save the file as **.splunkrc** in the current user's home directory.
117117

118-
* For example on OS X, save the file as:
118+
* For example on OS X, save the file as:
119119

120120
~/.splunkrc
121121

122-
* On Windows, save the file as:
122+
* On Windows, save the file as:
123123

124124
C:\Users\currentusername\.splunkrc
125125

126126
You might get errors in Windows when you try to name the file because
127127
".splunkrc" looks like a nameless file with an extension. You can use
128-
the command line to create this file—go to the
129-
**C:\Users\currentusername** directory and enter the following command:
128+
the command line to create this file—go to the
129+
**C:\Users\currentusername** directory and enter the following command:
130130

131131
Notepad.exe .splunkrc
132132

133133
Click **Yes**, then continue creating the file.
134134

135-
**Note**: Storing login credentials in the **.splunkrc** file is only for
136-
convenience during development. This file isn't part of the Splunk platform and
137-
shouldn't be used for storing user credentials for production. And, if you're
138-
at all concerned about the security of your credentials, just enter them at
139-
the command line rather than saving them in this file.
135+
**Note**: Storing login credentials in the **.splunkrc** file is only for
136+
convenience during development. This file isn't part of the Splunk platform and
137+
shouldn't be used for storing user credentials for production. And, if you're
138+
at all concerned about the security of your credentials, just enter them at
139+
the command line rather than saving them in this file.
140140

141141

142142
#### Examples
143143

144-
Examples are located in the **/splunk-sdk-python/examples** directory. To run
145-
the examples at the command line, use the Python interpreter and include any
144+
Examples are located in the **/splunk-sdk-python/examples** directory. To run
145+
the examples at the command line, use the Python interpreter and include any
146146
arguments that are required by the example:
147147

148148
python examplename.py --username="admin" --password="changeme"
149149

150-
If you saved your login credentials in the **.splunkrc** file, you can omit
150+
If you saved your login credentials in the **.splunkrc** file, you can omit
151151
those arguments:
152152

153153
python examplename.py
@@ -158,19 +158,26 @@ To get help for an example, use the `--help` argument with an example:
158158

159159
#### Unit tests
160160

161-
The Splunk SDK for Python contains a collection of unit tests. To run them, open a
161+
The Splunk SDK for Python contains a collection of unit tests. To run them, open a
162162
command prompt in the **/splunk-sdk-python** directory and enter:
163163

164-
python setup.py test
164+
make test
165165

166-
You can also run individual test files, which are located in
167-
**/splunk-sdk-python/tests**. For example, to run the apps test, open a command
168-
prompt in the **/splunk-sdk-python/tests** subdirectory and enter:
166+
You can also run individual test files, which are located in
167+
**/splunk-sdk-python/tests**. The following command explains how to run
168+
a specific test:
169169

170-
python test_app.py
170+
make test_specific
171171

172-
The test suite uses Python's standard library and the built-in `unittest`
173-
library.
172+
The test suite uses Python's standard library, the built-in `unittest`
173+
library, `pytest`, and `tox`.
174+
175+
**Important Note:** The test run will fail unless the
176+
[SDK App Collection](https://github.com/splunk/sdk-app-collection) is installed.
177+
178+
You can exclude app-specific tests with the following command:
179+
180+
make test_no_app
174181

175182
You can read more about our testing framework on
176183
[GitHub](https://github.com/splunk/splunk-sdk-python/tree/master/tests).
@@ -209,34 +216,34 @@ You can read more about our testing framework on
209216
### Changelog
210217

211218
The **CHANGELOG.md** file in the root of the repository contains a description
212-
of changes for each version of the SDK. You can also find it online at
219+
of changes for each version of the SDK. You can also find it online at
213220
[https://github.com/splunk/splunk-sdk-python/blob/master/CHANGELOG.md](https://github.com/splunk/splunk-sdk-python/blob/master/CHANGELOG.md).
214221

215222
### Branches
216223

217224
The **master** branch always represents a stable and released version of the SDK.
218-
You can read more about our branching model on our Wiki at
225+
You can read more about our branching model on our Wiki at
219226
[https://github.com/splunk/splunk-sdk-python/wiki/Branching-Model](https://github.com/splunk/splunk-sdk-python/wiki/Branching-Model).
220227

221228
## Documentation and resources
222-
If you need to know more:
229+
If you need to know more:
223230

224-
* For all things developer with Splunk, your main resource is the
231+
* For all things developer with Splunk, your main resource is the
225232
[Splunk Developer Portal](http://dev.splunk.com).
226233

227-
* For conceptual and how-to documentation, see the
234+
* For conceptual and how-to documentation, see the
228235
[Overview of the Splunk SDK for Python](http://dev.splunk.com/view/SP-CAAAEBB).
229236

230-
* For API reference documentation, see the
237+
* For API reference documentation, see the
231238
[Splunk SDK for Python Reference](http://docs.splunk.com/Documentation/PythonSDK).
232239

233-
* For more about the Splunk REST API, see the
240+
* For more about the Splunk REST API, see the
234241
[REST API Reference](http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI).
235242

236-
* For more about about Splunk in general, see
243+
* For more about about Splunk in general, see
237244
[Splunk>Docs](http://docs.splunk.com/Documentation/Splunk).
238245

239-
* For more about this SDK's repository, see our
246+
* For more about this SDK's repository, see our
240247
[GitHub Wiki](https://github.com/splunk/splunk-sdk-python/wiki/).
241248

242249
## Community
@@ -284,24 +291,24 @@ If you would like to contribute to the SDK, go here for more information:
284291

285292
### Support
286293

287-
1. You will be granted support if you or your company are already covered
288-
under an existing maintenance/support agreement.
289-
Submit a new case in the [Support Portal][contact] and include "Splunk SDK for Python"
290-
in the subject line.
291-
2. If you are not covered under an existing maintenance/support agreement, you
292-
can find help through the broader community at:
293-
<ul>
294-
<li><a href='http://splunk-base.splunk.com/answers/'>Splunk Answers</a> (use
295-
the <b>sdk</b>, <b>java</b>, <b>python</b>, and <b>javascript</b> tags to
296-
identify your questions)</li>
297-
</ul>
298-
3. Splunk will NOT provide support for SDKs if the core library (the
299-
code in the <b>/splunklib</b> directory) has been modified. If you modify an
300-
SDK and want support, you can find help through the broader community and
301-
Splunk answers (see above). We would also like to know why you modified the
302-
core library&mdash;please send feedback to devinfo@splunk.com.
294+
1. You will be granted support if you or your company are already covered
295+
under an existing maintenance/support agreement.
296+
Submit a new case in the [Support Portal][contact] and include "Splunk SDK for Python"
297+
in the subject line.
298+
2. If you are not covered under an existing maintenance/support agreement, you
299+
can find help through the broader community at:
300+
<ul>
301+
<li><a href='http://splunk-base.splunk.com/answers/'>Splunk Answers</a> (use
302+
the <b>sdk</b>, <b>java</b>, <b>python</b>, and <b>javascript</b> tags to
303+
identify your questions)</li>
304+
</ul>
305+
3. Splunk will NOT provide support for SDKs if the core library (the
306+
code in the <b>/splunklib</b> directory) has been modified. If you modify an
307+
SDK and want support, you can find help through the broader community and
308+
Splunk answers (see above). We would also like to know why you modified the
309+
core library&mdash;please send feedback to devinfo@splunk.com.
303310
4. File any issues on [GitHub](https://github.com/splunk/splunk-sdk-python/issues).
304-
311+
305312
### Contact Us
306313

307314
You can [contact support][contact] if you have Splunk related questions.

scripts/test_specific.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
echo "To run a specific test:"
2+
echo " tox -e py27,py37 [test_file_path]::[test_name]"

0 commit comments

Comments
 (0)