Skip to content

Commit

Permalink
info
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Feb 5, 2020
1 parent 34d24ee commit dfa8945
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 29 deletions.
41 changes: 33 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ build-splunk: &build-splunk
docker.pkg.github.com/splunk/splunk-connect-for-syslog/stg-splunk-connect-for-syslog:splunk-${SPLUNK}-<< pipeline.id >>
test: &test
steps:
- checkout
Expand All @@ -69,15 +70,9 @@ test: &test
- run:
name: test
command: |
pytest \
-v \
--splunk_type=docker --splunk_password=${SPLUNK_PASSWORD}
--junitxml=test-results/apptest-${SYSLOG}-${SPLUNK}.xml
docker-compose -f tests/docker-compose.yml up --abort-on-container-exit
docker cp results/* test-results/
no_output_timeout: 1h
- run:
name: get logs
command: docker-compose -f test/docker-compose.yml logs
when: always
- store_artifacts:
path: test-results
destination: apptest-${SYSLOG}-${SPLUNK}
Expand All @@ -93,6 +88,31 @@ orbs:


jobs:
build-tests:
docker:
- image: circleci/buildpack-deps:18.04
environment:
SYSLOG: '3.25.1'
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Docker Login
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker login -u $GITHUB_USER -p $GITHUB_TOKEN docker.pkg.github.com
- run:
name: Build Splunk
command: |
docker build tests \
-t docker.pkg.github.com/splunk/splunk-connect-for-syslog/stg-splunk-connect-for-syslog:tests-<< pipeline.id >>
- run:
name: Push Splunk
command: |
docker push \
docker.pkg.github.com/splunk/splunk-connect-for-syslog/stg-splunk-connect-for-syslog:tests-<< pipeline.id >>
#JOB SC4S
build-sc4s-3-25-1:
docker:
Expand Down Expand Up @@ -159,6 +179,7 @@ workflows:
version: 2
build_and_deploy:
jobs:
- build-tests
- build-sc4s-3-25-1
- build-sc4s-master
- build-splunk-7-2
Expand All @@ -168,15 +189,19 @@ workflows:
requires:
- build-sc4s-3-25-1
- build-splunk-8-0
- build-tests
- test-sc4s-master-splunk-8-0:
requires:
- build-sc4s-master
- build-splunk-8-0
- build-tests
- test-sc4s-3-25-1-splunk-7-3:
requires:
- build-sc4s-3-25-1
- build-splunk-7-3
- build-tests
- test-sc4s-3-25-1-splunk-7-2:
requires:
- build-sc4s-3-25-1
- build-splunk-7-2
- build-tests
16 changes: 16 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ version: "3.7"


services:
test:
build: ./tests
image: docker.pkg.github.com/splunk/splunk-connect-for-syslog/stg-splunk-connect-for-syslog:tests-${CIRCLE_SHA1}
links:
- splunk
- sc4s
environment:
- SPLUNK_USER=admin
- SPLUNK_PASSWORD=${SPLUNK_PASSWORD}
- SPLUNK_HOST=splunk
- SYSLOG_HOST=sc4s
volumes:
- results:/work/test-results

sc4s:
build:
Expand Down Expand Up @@ -58,3 +71,6 @@ services:
- SPLUNK_PASSWORD=${SPLUNK_PASSWORD}
- SPLUNK_START_ARGS=--accept-license

volumes:
results:
external: false
26 changes: 5 additions & 21 deletions tests/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
#!/bin/sh
echo Check for sc4s
wait-for sc4s:514 -t 0 -- echo scs is up
echo check for splunk web
wait-for splunk:8000 -t 0 -- echo splunkweb is up
echo check for splunk mgmt
wait-for splunk:8089 -t 0 -- echo splunkmgmt is up
echo check for splunk hec
wait-for splunk:8088 -t 0 -- echo splunkhec is up

sleep 30

echo Check for sc4s
wait-for sc4s:514 -t 0 -- echo scs is up
echo check for splunk web
wait-for splunk:8000 -t 0 -- echo splunkweb is up
echo check for splunk mgmt
wait-for splunk:8089 -t 0 -- echo splunkmgmt is up
echo check for splunk hec
wait-for splunk:8088 -t 0 -- echo splunkhec is up


cd /work;python -m pytest --junitxml=/work/test-results/functional/functional.xml $@
cd /work
pytest -v \
--splunk_test=external \
--splunk_password=${SPLUNK_PASSWORD} \
--junitxml=/work/test-results/functional/functional.xml $@

0 comments on commit dfa8945

Please sign in to comment.