@@ -18,82 +18,82 @@ commands:
18
18
type : string
19
19
default : latest
20
20
steps :
21
- - run :
22
- name : Downloading Example-TA
23
- command : |
24
- cd tests/deps/splunk-add-on-for-ucc-example
25
- mkdir output
26
- cd output
27
- pwd
28
- curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | grep "Splunk_TA.*tar.gz" | grep -v search_head | grep -v indexer | grep -v forwarder | cut -d : -f 2,3 | tr -d \" | wget -qi - || true
29
- ls
30
- tar -xzf *.tar.gz
31
- ls
32
- rm *.tar.gz
33
- ls
34
- - run :
35
- name : Setup for testing
36
- command : |
37
- echo "Setup for Testing..."
38
- pip install git+https://github.com/pixelb/crudini
39
- mkdir test-results
40
- cp -r /tmp/workspace/dist dist
41
- cp -r tests/deps/splunk-add-on-for-ucc-example/output output
42
- - run :
43
- name : Splunk Testing
44
- command : |
45
- export SPLUNK_VERSION=$(crudini --get tests/deps/build/addonfactory_test_matrix_splunk/splunk_matrix.conf "<<parameters.splunk_version>>" VERSION)
46
- export SPLUNK_APP_ID=$(crudini --get tests/deps/splunk-add-on-for-ucc-example/package/default/app.conf id name)
47
- export SPLUNK_APP_PACKAGE=tests/deps/splunk-add-on-for-ucc-example/output/$(ls tests/deps/splunk-add-on-for-ucc-example/output/)
48
- export TEST_SET=tests/ui
49
- export TEST_BROWSER="<<parameters.browser>>"
50
- export TEST_SUITE="-k <<parameters.test_suite>>"
51
- export JOB_NAME="CircleCI::$CIRCLE_PROJECT_REPONAME[$CIRCLE_BRANCH][$TEST_BROWSER] #$CIRCLE_BUILD_NUM"
52
- export SAUCE_IDENTIFIER=$SAUCE_IDENTIFIER-$(cat /proc/sys/kernel/random/uuid)
53
- echo "environment setup..."
54
- echo $SPLUNK_VERSION
55
- echo $SPLUNK_APP_ID
56
- echo $SPLUNK_APP_PACKAGE
57
- echo $TEST_SET
58
- echo $TEST_BROWSER
59
- echo $TEST_SUITE
60
- echo "Testing..."
61
- docker-compose -f docker-compose-ci.yml build
21
+ - run :
22
+ name : Downloading Example-TA
23
+ command : |
24
+ cd tests/deps/splunk-add-on-for-ucc-example
25
+ mkdir output
26
+ cd output
27
+ pwd
28
+ # curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | grep "Splunk_TA.*tar.gz" | grep -v search_head | grep -v indexer | grep -v forwarder | cut -d : -f 2,3 | tr -d \" | wget -qi - || true
29
+ ls
30
+ mv ../../Splunk_TA_UCCExample-8.0.1-R56b2ace.tar.gz ./
31
+ tar -xzf *.tar.gz
32
+ ls
33
+ rm *.tar.gz
34
+ ls
35
+ - run :
36
+ name : Setup for testing
37
+ command : |
38
+ echo "Setup for Testing..."
39
+ pip install git+https://github.com/pixelb/crudini
40
+ mkdir test-results
41
+ cp -r /tmp/workspace/dist dist
42
+ cp -r tests/deps/splunk-add-on-for-ucc-example/output output
43
+ - run :
44
+ name : Splunk Testing
45
+ command : |
46
+ export SPLUNK_VERSION=$(crudini --get tests/deps/build/addonfactory_test_matrix_splunk/splunk_matrix.conf "<<parameters.splunk_version>>" VERSION)
47
+ export SPLUNK_APP_ID=$(crudini --get tests/deps/splunk-add-on-for-ucc-example/package/default/app.conf id name)
48
+ export SPLUNK_APP_PACKAGE=tests/deps/splunk-add-on-for-ucc-example/output/$(ls tests/deps/splunk-add-on-for-ucc-example/output/)
49
+ export TEST_SET=tests/ui
50
+ export TEST_BROWSER="<<parameters.browser>>"
51
+ export TEST_SUITE="-k <<parameters.test_suite>>"
52
+ export JOB_NAME="CircleCI::$CIRCLE_PROJECT_REPONAME[$CIRCLE_BRANCH][$TEST_BROWSER] #$CIRCLE_BUILD_NUM"
53
+ export SAUCE_IDENTIFIER=$SAUCE_IDENTIFIER-$(cat /proc/sys/kernel/random/uuid)
54
+ echo "environment setup..."
55
+ echo $SPLUNK_VERSION
56
+ echo $SPLUNK_APP_ID
57
+ echo $SPLUNK_APP_PACKAGE
58
+ echo $TEST_SET
59
+ echo $TEST_BROWSER
60
+ echo $TEST_SUITE
61
+ echo "Testing..."
62
+ docker-compose -f docker-compose-ci.yml build
63
+
64
+ # Saucelab connection
65
+ docker-compose -f docker-compose-ci.yml up -d sauceconnect
62
66
63
- # Saucelab connection
64
- docker-compose -f docker-compose-ci.yml up -d sauceconnect
67
+ # Start Splunk
68
+ docker-compose -f docker-compose-ci.yml up -d splunk
69
+ until docker-compose -f docker-compose-ci.yml logs splunk | grep "Ansible playbook complete" ; do sleep 1; done
65
70
66
- # Start Splunk
67
- docker-compose -f docker-compose-ci.yml up -d splunk
68
- until docker-compose -f docker-compose-ci.yml logs splunk | grep "Ansible playbook complete" ; do sleep 1; done
71
+ # Normal Inspecting
72
+ docker-compose -f docker-compose-ci.yml logs sauceconnect
73
+ docker ps -a
69
74
70
- # Normal Inspecting
71
- docker-compose -f docker-compose-ci.yml logs sauceconnect
72
- docker ps -a
75
+ # Run the tests
76
+ test_exit_code=0
77
+ docker-compose -f docker-compose-ci.yml up --abort-on-container-exit test || test_exit_code=$?
73
78
74
- # Run the tests
75
- test_exit_code=0
76
- docker-compose -f docker-compose-ci.yml up --abort-on-container-exit test || test_exit_code=$?
77
-
78
- # Collect Results
79
- docker container create --name dummy \
80
- -v project_results:/home/circleci/work \
81
- registry.access.redhat.com/ubi7/ubi
82
- docker cp dummy:/home/circleci/work/test-results/test.xml test-results/ || true
83
- docker cp dummy:/home/circleci/work/assets test-results/assets || true
84
- docker cp dummy:/home/circleci/work/report.html test-results/report.html || true
85
-
86
- docker-compose -f docker-compose-ci.yml down || true
87
-
88
- echo exit code "$test_exit_code"
89
- exit "$test_exit_code"
79
+ # Collect Results
80
+ docker container create --name dummy \
81
+ -v project_results:/home/circleci/work \
82
+ registry.access.redhat.com/ubi7/ubi
83
+ docker cp dummy:/home/circleci/work/test-results/test.xml test-results/ || true
84
+ docker cp dummy:/home/circleci/work/assets test-results/assets || true
85
+ docker cp dummy:/home/circleci/work/report.html test-results/report.html || true
90
86
87
+ docker-compose -f docker-compose-ci.yml down || true
91
88
92
- - store_artifacts :
93
- path : test-results
94
- destination : test-results
95
- - store_test_results :
96
- path : test-results
89
+ echo exit code "$test_exit_code"
90
+ exit "$test_exit_code"
91
+
92
+ - store_artifacts :
93
+ path : test-results
94
+ destination : test-results
95
+ - store_test_results :
96
+ path : test-results
97
97
98
98
jobs :
99
99
build :
@@ -167,16 +167,16 @@ jobs:
167
167
- attach_workspace :
168
168
at : /tmp/workspace
169
169
- setup_remote_docker :
170
- docker_layer_caching : true
170
+ docker_layer_caching : true
171
171
- test_smartx :
172
- splunk_version : <<parameters.splunk_version>>
173
- browser : <<parameters.browser>>
174
- test_suite : <<parameters.test_suite>>
172
+ splunk_version : <<parameters.splunk_version>>
173
+ browser : <<parameters.browser>>
174
+ test_suite : <<parameters.test_suite>>
175
175
176
176
semgrep :
177
177
environment :
178
- SEMGREP_REPO_URL : << pipeline.project.git_url >>
179
- SEMGREP_BRANCH : << pipeline.git.branch >>
178
+ SEMGREP_REPO_URL : << pipeline.project.git_url >>
179
+ SEMGREP_BRANCH : << pipeline.git.branch >>
180
180
docker :
181
181
- image : returntocorp/semgrep-agent:v1
182
182
user : root
@@ -196,13 +196,13 @@ jobs:
196
196
export REPO_BRANCH=$(echo "<< pipeline.git.branch >>")
197
197
DASHBOARD_URL=$(python3 -c "from urllib.parse import quote; import os; print('https://semgrep.dev/manage/findings?repo=' + quote(os.environ['SEMGREP_REPO_NAME'], safe='') + '&tab=findings&ref_type=branch&ref=' + quote(os.environ['REPO_BRANCH'], safe=''))")
198
198
echo "View Result at Semgrep Dashboard: $DASHBOARD_URL"
199
-
199
+
200
200
# Semgrep Exclude files
201
201
dos2unix .semgrepignore
202
202
SEMGREP_EXCLUDE=$(sed "/^#/d" .semgrepignore | sed "/^:/d" | sed -r '/^\s*$/d' | sed ':a;N;$!ba;s/\n/ --exclude /g')
203
203
echo "Excluding Semgrep Files: --exclude $SEMGREP_EXCLUDE"
204
204
# Generate xml file
205
- semgrep --config="p/r2c-ci" --config="p/r2c-security-audit" --config="p/bandit" --error --strict --timeout=0 --junit-xml -o /root/project/test-results/semgrep-scan.xml --exclude $SEMGREP_EXCLUDE
205
+ semgrep --config="p/r2c-ci" --config="p/r2c-security-audit" --config="p/bandit" --error --strict --timeout=0 --junit-xml -o /root/project/test-results/semgrep-scan.xml --exclude $SEMGREP_EXCLUDE
206
206
- store_artifacts :
207
207
path : test-results
208
208
destination : test-results
@@ -260,7 +260,7 @@ workflows:
260
260
- build
261
261
- semgrep :
262
262
context :
263
- - gdi-semgrep
263
+ - gdi-semgrep
264
264
filters :
265
265
branches :
266
266
only : /.*/
@@ -274,7 +274,7 @@ workflows:
274
274
parameters :
275
275
splunk_version : ["8.1"]
276
276
browser : ["firefox", "chrome"]
277
- test_suite :
277
+ test_suite :
278
278
- " test_splunk_ta_example_addon_logging"
279
279
- " test_splunk_ta_example_addon_account"
280
280
- " test_splunk_ta_example_addon_input"
@@ -296,4 +296,4 @@ workflows:
296
296
branches :
297
297
ignore : /.*/
298
298
tags :
299
- only : /^v\d*\.\d*\.\d*.*$/
299
+ only : /^v\d*\.\d*\.\d*.*$/
0 commit comments