Skip to content

Commit 23b33e1

Browse files
authored
Update testing/README.md with testing instructions(#229)
1 parent b5ad3d5 commit 23b33e1

File tree

2 files changed

+76
-3
lines changed

2 files changed

+76
-3
lines changed

testing/integration/README.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,77 @@
1-
## PCL Integration Tests Environment Setup
1+
## PCF Nozzle Integration Tests Environment Setup
22

3-
## Using remote environment
3+
#### Setup PCF Nozzle
4+
- Using remote nozzle environment
45

6+
Deploy nozzle to PCF env via `cf push`
7+
```
8+
cf login --skip-ssl-validation -a https://api.<your cf sys domain> -u <your cf user name> -p <your cf password>
9+
10+
make deploy-nozzle
11+
```
12+
- Run nozzle binary locally
13+
14+
Create a `env.sh` file to export all configuration env variables locally.
15+
``````
16+
#!/usr/bin/env bash
17+
18+
export SKIP_SSL_VALIDATION_CF=true
19+
export SKIP_SSL_VALIDATION_SPLUNK=true
20+
export ADD_APP_INFO=true
21+
export API_ENDPOINT=<CF-ENDPOINT>
22+
export EVENTS=ValueMetric,CounterEvent,Error,LogMessage,HttpStartStop,ContainerMetric
23+
export SPLUNK_TOKEN=<HEC-TOKEN>
24+
export SPLUNK_HOST=<HEC-ENDPOINT>
25+
export SPLUNK_INDEX=<TARGET-SPLUNK-INDEX>
26+
export FIREHOSE_SUBSCRIPTION_ID=splunk-nozzle
27+
export FIREHOSE_KEEP_ALIVE=25s
28+
export CLIENT_ID=<PCF CLIENT ID>
29+
export CLIENT_SECRET=<PCF CLIENT SECRET>
30+
``````
31+
Start nozzle binary
32+
```
33+
cf login --skip-ssl-validation -a https://api.<your cf sys domain> -u <your cf user name> -p <your cf password>
34+
35+
source env.sh
36+
37+
./splunk-firehose-nozzle
38+
```
39+
#### Install python 3
40+
41+
sudo apt-get install python3.7
42+
sudo apt-get install python3-pip
43+
44+
#### Install python virtualenv
45+
46+
pip3 install virtualenv
47+
virtualenv venv
48+
source venv/bin/activate
49+
50+
#### Install Dependencies
51+
52+
pip3 install -r requirements.txt
53+
54+
#### Run Automation tests
55+
56+
- Run all the test cases
57+
```
58+
pytest testing/integration/
59+
```
60+
61+
- Run all the critical test cases tagged with Critical
62+
```
63+
pytest testing/integration -v -m Critical
64+
```
65+
66+
- Run specific test case
67+
```
68+
pytest testing/integration/test_method.py::test_func
69+
```
70+
or
71+
```
72+
pytest testing/integration/test_method.py::TestClass::test_func
73+
```
74+
or (if test_func is unique)
75+
```
76+
pytest -k test_func
77+
```

testing/integration/testcases/test_nozzle_configurations_local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def setup_class(self, test_env, splunk_logger, nozzle_logger, test_setup):
3232
("index={0} test_tag::{1} event_type=HttpStartStop", True),
3333
("index={0} test_tag::{1} event_type=ContainerMetric", True)
3434
])
35-
def test_search_event_on_splunk_is_not_empty(self, query_input, is_result_empty, test_env, splunk_logger, nozzle_logger):
35+
def test_search_event_by_event_type(self, query_input, is_result_empty, test_env, splunk_logger, nozzle_logger):
3636
self.splunk_api = SplunkApi(test_env, splunk_logger)
3737
search_results = self.splunk_api.check_events_from_splunk(
3838
query=query_input.format(test_env['splunk_index'], _tag),

0 commit comments

Comments
 (0)