-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure to build on CircleCI (#11)
- Loading branch information
Showing
7 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
version: 2.1 | ||
|
||
commands: | ||
influxdb-restart: | ||
steps: | ||
- run: | ||
name: "Start InfluxDB service" | ||
command: ./scripts/influxdb-restart.sh | ||
prepare: | ||
description: "Prepare environment to tests" | ||
steps: | ||
- checkout | ||
- influxdb-restart | ||
client-test: | ||
description: "Run tests" | ||
parameters: | ||
python-version: | ||
type: string | ||
default: &default-python-version "3" | ||
steps: | ||
- restore_cache: | ||
name: Restoring Pip Cache | ||
keys: | ||
- &cache-key pip-cache-<< parameters.python-version >>-{{ checksum "requirements.txt" }}-{{ checksum "test-requirements.txt" }} | ||
- pip-cache-<< parameters.python-version >>- | ||
- run: | ||
name: "Running tests" | ||
command: | | ||
docker run -it --rm \ | ||
--volume ${PWD}:/usr/src/project \ | ||
--volume ${PWD}/.cache:/root/.cache/pip/ \ | ||
--workdir /usr/src/project \ | ||
--network influx_network \ | ||
--env INFLUXDB_IP=192.168.0.2 \ | ||
python:<< parameters.python-version >> /bin/bash -c "./scripts/ci-test.sh" | ||
- save_cache: | ||
name: Saving Pip Cache | ||
key: *cache-key | ||
paths: | ||
- ${PWD}/.cache | ||
when: always | ||
jobs: | ||
tests-python-3: | ||
machine: true | ||
steps: | ||
- prepare | ||
- client-test: | ||
python-version: *default-python-version | ||
- store_test_results: | ||
path: test-reports | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- tests-python-3 | ||
|
||
nightly: | ||
triggers: | ||
- schedule: | ||
cron: "0 0 * * *" | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
jobs: | ||
- tests-python-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# | ||
# Install requirements | ||
# | ||
python --version | ||
pip install -r requirements.txt | ||
pip install -r test-requirements.txt | ||
|
||
# | ||
# Prepare for test results | ||
# | ||
mkdir test-reports || true | ||
|
||
# | ||
# Test | ||
# | ||
pytest influxdb2_test --junitxml=test-reports/junit.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters