Skip to content

Commit

Permalink
Merge pull request #3 from splunk/feature/auto-pr-dep-buld-pytest
Browse files Browse the repository at this point in the history
Update submodules
  • Loading branch information
Ryan Faircloth authored Mar 3, 2020
2 parents 8aabc14 + 178e366 commit f12997a
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 408 deletions.
22 changes: 19 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#COPYRIGHT SPLUNK, Inc 2020

version: 2.1
orbs:
go: circleci/[email protected]
Expand Down Expand Up @@ -157,18 +159,29 @@ orbs:
ls -l deps/build/addonfactory_test_matrix_splunk/splunk_matrix.conf
export SPLUNK_VERSION=$(crudini --get deps/build/addonfactory_test_matrix_splunk/splunk_matrix.conf "<<parameters.splunk_version>>" VERSION)
docker-compose -f docker-compose-ci.yml build
docker-compose -f docker-compose-ci.yml up -d splunk
sleep 90
docker-compose -f docker-compose-ci.yml up -d splunk
while [ $? -ne 0 ]; do docker logs c14f4fadf39a | grep "Ansible playbook complete" ; done
sleep 30
- run:
name: Run diag
when: always
command: |
mkdir /tmp/diag
diag=$(docker-compose -f docker-compose-ci.yml exec splunk sudo -u splunk /opt/splunk/bin/splunk diag | grep "Splunk diagnosis file created" | sed -n 's/.* \(\/.*\.gz\)/\1/p')
docker-compose -f docker-compose-ci.yml exec splunk sudo chmod +r ${diag//[$'\t\r\n']}
docker cp project_splunk_1:${diag//[$'\t\r\n']} /tmp/diag
- run:
name: Check btool
when: always
command: |
docker-compose -f docker-compose-ci.yml exec splunk sudo /opt/splunk/bin/splunk cmd btool check
docker-compose -f docker-compose-ci.yml up -d splunk
sleep 30
- run:
name: Test
when: always
command: |
docker-compose -f docker-compose-ci.yml up --abort-on-container-exit
docker-compose -f docker-compose-ci.yml up --abort-on-container-exit test
no_output_timeout: 1h
- run:
name: collect results
Expand All @@ -195,6 +208,9 @@ orbs:
docker_layer_caching: true
- test_aio:
splunk_version: <<parameters.splunk_version>>
- store_artifacts:
path: /tmp/diag
destination: test-diag
- store_artifacts:
path: test-results
destination: test-results
Expand Down
185 changes: 7 additions & 178 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,190 +31,19 @@ __pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

### Linux template
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Gradle template
.gradle
/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

.venv/
build/
test-reports
#Splunk Files

tests/model-conformance
tests/functional


.csms
.DS_Store
.env
src

!deps/build
1 change: 1 addition & 0 deletions Dockerfile-tests
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN pip3 install -r /tmp/requirements.txt
COPY deps/pypi/pytest-splunk-addon /tmp/pytest-splunk-addon
RUN pip install -r /tmp/pytest-splunk-addon/requirements.txt
RUN pip install /tmp/pytest-splunk-addon
RUN pip install pytest-xdist
RUN rm -Rf /work/tests/pytest-splunk-addon

RUN pip uninstall lovely-pytest-docker -y
Expand Down
25 changes: 2 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,12 @@ services:
splunk:
build:
context: .
dockerfile: Dockerfile-splunk
args:
SPLUNK_APP: SecKit_SA_geolocation
ports:
- "8000:8000"
- "8000"
- "8089"
environment:
- SPLUNK_PASSWORD=Changed@11
- SPLUNK_START_ARGS=--accept-license
volumes:
- splunk-var:/opt/splunk/var

aob:
image: splunk/splunk:latest
ports:
- "8001:8000"
environment:
- SPLUNK_PASSWORD=Changed@11
- SPLUNK_START_ARGS=--accept-license
volumes:
- aob-var:/opt/splunk/var
volumes:
- aob-etc:/opt/splunk/etc

volumes:
splunk-var:
external: false
aob-var:
external: false
aob-etc:
external: false
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

pytest
pytest-runner
requests
Expand Down
Loading

0 comments on commit f12997a

Please sign in to comment.