Skip to content

Commit

Permalink
Merge pull request #15 from gisce/circleci-project-setup
Browse files Browse the repository at this point in the history
CircleCI Integration
  • Loading branch information
francescpuig7 authored Apr 19, 2021
2 parents e172032 + eef9232 commit 6466436
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 38 deletions.
52 changes: 52 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2.1

orbs:
python: circleci/python@0.2.1

jobs:
test-template: &test-template
test-py37:
docker:
- image: circleci/python:3.7
executor: python/default
working_directory: ~/src
steps:
- checkout:
path: ~/src/mesures
- run:
command: |
export ROOT_DIR_SRC=~/src
name: Install requirements
- restore_cache:
keys:
- v1-dependencies-{{ checksum "~/src/mesures/requirements.txt"}}
- run:
command: |
cd ~/src/
virtualenv venv
. venv/bin/activate
cd mesures
pip install -r requirements.txt
name: Install dependencies
- save_cache:
paths:
- ~/src/venv
key: v1-dependencies-{{ checksum "~/src/mesures/requirements.txt"}}
- run:
command: |
cd ~/src/
. venv/bin/activate
cd mesures
mamba --enable-coverage
coverage report
coverage html
name: Test
- store_artifacts:
path: ~/src/mesures/htmlcov
destination: coverage
name: store_artifacts

workflows:
main:
jobs:
- test-py37
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pandas==0.23.4
mamba<0.11.0
expects
Empty file added spec/__init__.py
Empty file.
43 changes: 43 additions & 0 deletions spec/generation_files/files_spec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from mamba import description, context, it
from expects import expect, equal
from mesures.f1 import F1
from mesures.p1 import P1
from mesures.p1d import P1D
from spec.sample_data import get_sample_data


with description('An F1') as self:
with it('is instance of F1 Class'):
data = get_sample_data()
f = F1(data)
assert isinstance(f, F1)

with it('a zip of raw Files'):
data = get_sample_data()
f = F1(data)
res = f.writer()
import zipfile
assert zipfile.is_zipfile(res)

with it('has its class methods'):
data = get_sample_data()
f = F1(data)
res = f.writer()
import numpy as np
assert isinstance(f.total, (int, np.int64))
assert f.ai == f.total
assert isinstance(f.cups, list)
assert isinstance(f.number_of_cups, int)


with description('An P1') as self:
with it('instance of P1 Class'):
data = get_sample_data()
f = P1(data)
assert isinstance(f, P1)

with description('An P1D') as self:
with it('instance of P1D Class'):
data = get_sample_data()
f = P1D(data)
assert isinstance(f, P1D)
File renamed without changes.
3 changes: 0 additions & 3 deletions tests/__init__.py

This file was deleted.

14 changes: 0 additions & 14 deletions tests/test_f1.py

This file was deleted.

21 changes: 0 additions & 21 deletions tests/test_p1.py

This file was deleted.

0 comments on commit 6466436

Please sign in to comment.