Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 69 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,41 @@ executors:
macos:
xcode: 11.4
jobs:
build:
docker:
- image: circleci/python:3.7
steps:
- checkout
- restore_cache:
keys:
- poetry-{{ checksum "poetry.lock" }}
- run:
name: Install Tools
command: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
- run:
name: Build
command: |
source $HOME/.poetry/env
poetry install
poetry run poetry-dynamic-versioning
poetry build
- save_cache:
key: poetry-{{ checksum "poetry.lock" }}
paths:
- ~/.poetry
- store_artifacts:
path: dist
- store_artifacts:
path: output
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory on the container which is
# taken to be the root directory of the workspace.
root: .
# Must be relative path from root
paths:
- dist
- output
test-unit:
parameters:
os:
Expand All @@ -97,7 +132,8 @@ jobs:
executor: << parameters.os >>
steps:
- checkout
#- python/load-cache
- attach_workspace:
at: /tmp/workspace
- run:
name: install deps
command: |
Expand All @@ -109,18 +145,15 @@ jobs:
eval "$(pyenv init -)"
pyenv install << parameters.python-version >>
pyenv global << parameters.python-version >>
virtualenv .venv
pip install --upgrade virtualenv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
pyenv local << parameters.python-version >>
pip install /tmp/workspace/dist/*
pip install pytest
pip install pytest-cov
pip install pytest-expect
pip install pyaml
pip install mock
mkdir test-results || true
- python/save-cache
- run:
command: |
source .venv/bin/activate
python -m pytest --junitxml=test-results/results.xml --cov=solnlib --cov-report=html tests
name: Test
- store_test_results:
path: test-results
- store_artifacts:
Expand Down Expand Up @@ -166,6 +199,8 @@ jobs:
echo PASSWORD=Chang3d! >>$SPLUNK_HOME/etc/system/local/user-seed.conf
/opt/splunk/bin/splunk start --accept-license
#- python/load-cache
- attach_workspace:
at: /tmp/workspace
- run:
name: Install deps
command: |
Expand All @@ -177,18 +212,14 @@ jobs:
eval "$(pyenv init -)"
pyenv install << parameters.python-version >>
pyenv global << parameters.python-version >>
virtualenv .venv
pip install --upgrade virtualenv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
pyenv local << parameters.python-version >>
pip install /tmp/workspace/dist/*
pip install pytest
pip install pytest-cov
pip install pytest-expect
pip install pyaml
mkdir test-results || true
- python/save-cache
- run:
command: |
source .venv/bin/activate
SPLUNK_HOME=/opt/splunk/ python -m pytest --junitxml=test-results/results.xml -v examples
name: Test
- store_test_results:
path: test-results
- store_artifacts:
Expand All @@ -202,21 +233,29 @@ jobs:
steps:
- setup_remote_docker:
docker_layer_caching: true
- attach_workspace:
at: /tmp/workspace
- checkout
- restore_cache:
keys:
- poetry-{{ checksum "poetry.lock" }}
- run:
name: Install Tools
command: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
- run:
name: "Publish on PyPI"
name: Build
command: |
PATH=$PATH:/usr/local/go/bin
pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*
source $HOME/.poetry/env
poetry install
poetry run poetry-dynamic-versioning
poetry publish --build -u ${TWINE_USERNAME} -p ${TWINE_PASSWORD}

workflows:
main:
jobs:
- build
- test-unit:
requires:
- build
matrix:
parameters:
os: [linux]
Expand All @@ -225,6 +264,8 @@ workflows:
branches:
only: /.*/
- test-splunk:
requires:
- build
matrix:
parameters:
os: [linux]
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# README

Splunk Solutions SDK is an open source packaged solution for getting data into Splunk using modular inputs.
This SDK is used by Splunk Add-on builder, and Splunk UCC based add-ons and is intended for use by partner
developers. This SDK/Library extends the Splunk SDK for python

## Support

Splunk Solutions SDK is an open source product developed by Splunkers. This SDK is not "Supported Software" by Splunk, Inc. issues and defects can be reported
via the public issue tracker

## Contributing

We do not accept external contributions at this time

## License

* Configuration and documentation licensed subject to [APACHE-2.0](LICENSE)
Empty file removed README.txt
Empty file.
6 changes: 3 additions & 3 deletions examples/test__kvstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
sys.path.insert(0, op.dirname(op.dirname(op.abspath(__file__))))
from solnlib.credentials import get_session_key
import context
from solnlib.packages.splunklib import binding
from solnlib.packages.splunklib import client
from solnlib.packages.splunklib.binding import HTTPError
from splunklib import binding
from splunklib import client
from splunklib.binding import HTTPError


def test_kvstore():
Expand Down
Loading