Skip to content

Commit 6d0e0cd

Browse files
author
Ryan Faircloth
authored
Setup unit test build in circleci (#1)
Perform unit test matrix with the two supported versions python for Splunk Enterprise
1 parent 088986c commit 6d0e0cd

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

.circleci/config.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: 2.1
2+
3+
orbs:
4+
python: circleci/python@0.2.1
5+
6+
executors:
7+
linux:
8+
machine:
9+
image: ubuntu-1604:201903-01
10+
macos:
11+
macos:
12+
xcode: 11.4
13+
jobs:
14+
test-unit:
15+
parameters:
16+
os:
17+
type: executor
18+
python-version:
19+
type: string
20+
executor: << parameters.os >>
21+
steps:
22+
- checkout
23+
- python/load-cache
24+
- run:
25+
name: install deps
26+
command: |
27+
pip install --upgrade pip
28+
pip install --upgrade virtualenv
29+
unset PYENV_ROOT
30+
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
31+
export PATH="$HOME/.pyenv/bin:$PATH"
32+
eval "$(pyenv init -)"
33+
pyenv install << parameters.python-version >>
34+
pyenv global << parameters.python-version >>
35+
virtualenv .venv
36+
pip install --upgrade virtualenv
37+
source .venv/bin/activate
38+
pip install -r requirements.txt
39+
pip install -e .
40+
mkdir test-results || true
41+
- python/save-cache
42+
- run:
43+
command: |
44+
source .venv/bin/activate
45+
python -m pytest --junitxml=test-results/results.xml --cov=solnlib --cov-report=html tests
46+
name: Test
47+
- store_test_results:
48+
path: test-results
49+
- store_artifacts:
50+
path: test-results
51+
- store_artifacts:
52+
path: htmlcov
53+
workflows:
54+
main:
55+
jobs:
56+
- test-unit:
57+
matrix:
58+
parameters:
59+
os: [linux]
60+
python-version: ["2.7.17", "3.7.4"]

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
setuptools-lint==0.4.1
22
pytest==2.9.1
33
pytest-cov==2.2.1
4-
mock==2.0.0
4+
mock==2.0.0
5+
requests==2.24.0

0 commit comments

Comments
 (0)