Commit c741d3585df1c35ff52c4da2a8779e36d36057e1

Authored by Sergio Oliveira
1 parent 83dc32cc
Exists in test

Added makefile

.travis.yml
1 1 language: python
2 2  
3   -cache: apt
4   -
5 3 python:
6 4 - "2.7"
7 5  
8   -env:
9   - global:
10   - - DJANGO_SETTINGS_MODULE=tests.settings
11   - - COLAB_SETTINGS=tests/settings.yaml
12   -
13 6 install:
14   - - pip install coveralls flake8
15   - - pip install .
16   - - psql -c "CREATE USER colab WITH PASSWORD 'colab' CREATEDB;" -U postgres
17   -
18   -before_script:
19   - - colab-admin build_solr_schema > /tmp/schema.xml
20   - - cat ci/install_solr.sh | SOLR_VERSION=4.10.3 SOLR_CONFS="/tmp/schema.xml" bash
  7 + - make travis_install
21 8  
22 9 script:
23   - - python setup.py test
24   - - flake8 colab
  10 + - make test
25 11  
26 12 after_success:
27   - - coveralls
28   - - ci/build_rpm.sh
  13 + - make coveralls
  14 + - make rpm
... ...
Makefile 0 → 100644
... ... @@ -0,0 +1,48 @@
  1 +
  2 +VIRTUALENV_PATH = /tmp/colab-venv
  3 +PATH := $(VIRTUALENV_PATH)/bin:${PATH}
  4 +
  5 +DJANGO_SETTINGS_MODULE = tests.settings
  6 +export DJANGO_SETTINGS_MODULE
  7 +COLAB_SETTINGS = tests/settings.yaml
  8 +export COLAB_SETTINGS
  9 +
  10 +ifndef RELEASE
  11 + RELEASE = 1
  12 +endif
  13 +
  14 +all:
  15 + echo $(RELEASE)
  16 +
  17 +install:
  18 + virtualenv $(VIRTUALENV_PATH)
  19 + pip install .
  20 + virtualenv --relocatable $(VIRTUALENV_PATH)
  21 +
  22 +test_install: install_solr
  23 + pip install flake8
  24 +
  25 +install_solr:
  26 + # Install java
  27 + which apt-get && sudo apt-get install default-jre -y || echo # deb
  28 + which yum && sudo yum install java -y || echo # rpm
  29 +
  30 + colab-admin build_solr_schema > /tmp/schema.xml
  31 + SOLR_VERSION=4.10.3 SOLR_CONFS="/tmp/schema.xml" ci/install_solr.sh
  32 +
  33 +travis_install: test_install
  34 + psql -c "CREATE USER colab WITH PASSWORD 'colab' CREATEDB;" -U postgres
  35 +
  36 +test:
  37 + python setup.py test
  38 + flake8 colab
  39 +
  40 +coveralls:
  41 + pip install coveralls
  42 + coveralls
  43 +
  44 +rpm:
  45 + ci/build_rpm.sh
  46 +
  47 +clean:
  48 + $(RM) -r $(VIRTUALENV_PATH)
... ...
setup.py
... ... @@ -54,8 +54,6 @@ REQUIREMENTS = [
54 54  
55 55 TEST_REQUIREMENTS = [
56 56 'coverage==3.7.1',
57   - 'coveralls==0.5',
58   - 'flake8==2.3.0',
59 57 'mock==1.0.1',
60 58 ]
61 59  
... ...
tests/settings.py
... ... @@ -28,12 +28,3 @@ LOGGING = {
28 28 },
29 29 },
30 30 }
31   -
32   -import os
33   -HAYSTACK_CONNECTIONS = {
34   - 'default': {
35   - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
36   - 'URL': 'http://127.0.0.1:8983/solr'
37   - },
38   -}
39   -
... ...