Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 440114f0 authored by Gaël Duval's avatar Gaël Duval 🏄🏼
Browse files

Merge branch 'nicofonk/gitlabci' into 'master'

fix tests and enable gitlab CI

See merge request e/cloud/my-spot!19
parents d27ed7ff a29854ab
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+29 −0
Original line number Original line Diff line number Diff line
image: $CI_REGISTRY_IMAGE/env:latest

stages:
 - build
 - test

front-end:
  stage: build
  before_script:
    - ./manage.sh npm_packages
    - ./manage.sh update_dev_packages
  script:
    - ./manage.sh locales
    - ./manage.sh styles
    - ./manage.sh grunt_build

coding-rules:
  stage: build
  before_script:
    - ./manage.sh update_dev_packages
  script:
    - ./manage.sh pep8_check

unittest:
  stage: test
  before_script:
    - ./manage.sh update_dev_packages
  script:
    - ./manage.sh unit_tests

Dockerfile.env

0 → 100644
+8 −0
Original line number Original line Diff line number Diff line
FROM fedora

RUN dnf install -y\
 wget\
 python2-pip\
 npm\
&& dnf groupinstall -y "Development Tools" \
&& pip install pytest ipdb ipython \
+2 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ tests() {
#
#


npm_path_setup() {
npm_path_setup() {
    which npm || (printf 'Error: npm is not found\n'; exit 1)
    which npm &>/dev/null || whereis npm &>/dev/null || (printf 'Error: npm is not found\n'; exit 1)
    export PATH="$(npm bin)":$PATH
    export PATH="$(npm bin)":$PATH
}
}


@@ -152,6 +152,7 @@ styles() {
}
}


grunt_build() {
grunt_build() {
    npm_path_setup
    echo '[!] Grunt build : oscar theme'
    echo '[!] Grunt build : oscar theme'
    grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
    grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
    echo '[!] Grunt build : simple theme'
    echo '[!] Grunt build : simple theme'
+1 −0
Original line number Original line Diff line number Diff line
@@ -9,3 +9,4 @@ transifex-client==0.12.2
unittest2==1.1.0
unittest2==1.1.0
zope.testrunner==4.5.1
zope.testrunner==4.5.1
selenium==3.5.0
selenium==3.5.0
mockredispy==2.9.3
+2 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,8 @@ class SearchData(object):




def _get_connection(host):
def _get_connection(host):
    return redis.StrictRedis(host if host else settings['redis']['host'], decode_responses=True)
    host = host if host else settings['redis']['host']
    return redis.StrictRedis(host=host, decode_responses=True)




def read(q, host):
def read(q, host):
Loading