Commit 9b658849 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-s/server_unit_tests' into 'dev'

Feature s/server unit tests

Closes #3061

See merge request !160
parents a6d5cb55 5e34eb60
Pipeline #18378 failed with stages
in 140 minutes and 6 seconds
......@@ -166,6 +166,28 @@ code_quality:
tags:
- web
# Server
test_server_unit:
stage: test_unit
script:
- virtualenv $CI_BUILD_REF_SLUG
- source $CI_BUILD_REF_SLUG/bin/activate
- pip install -r requirements.txt
- make -C server install_web2py_standalone
- make -C server launch_fuse_server
- make unit_server
- make -C server kill_fuse_server
only:
- /^feature-[sw]\/.*$/
- /^hotfix-[sw]\/.*$/
- prod-server
- dev
tags:
- web
# Deployment
deploy_review:
stage: deploy_review
script:
......
enum34==1.1.6
funcsigs==1.0.2
mock==2.0.0
pbr==3.1.1
requests==2.12.3
six==1.11.0
unittest-xml-reporting==2.1.1
uWSGI==2.0.14
......@@ -82,8 +82,8 @@ def init_db_form():
def init_db_helper(force=False, admin_email="plop@plop.com", admin_password="1234"):
if (force) or (db(db.auth_user.id > 0).count() == 0) :
#for table in db :
#table.truncate()
for table in db :
table.truncate()
id_first_user=""
......
#coding: utf-8
from gluon.tools import Auth
from gluon.dal import Row, Set, Query
from enum import Enum
......
......@@ -59,7 +59,7 @@ test_db = DAL('sqlite://testing1234.sqlite')
init_db_helper()
for tablename in db.tables: # Copy tables!
table_copy = [copy(f) for f in db[tablename]]
table_copy = [f.clone() for f in db[tablename]]
test_db.define_table(tablename, *table_copy)
db = test_db
......@@ -330,4 +330,6 @@ for test_file in test_files:
suite.addTest(unittest.makeSuite(globals()[filename+directory]))
#unittest.TextTestRunner(verbosity=2).run(suite)
xmlrunner.XMLTestRunner(output='test-reports', verbosity=1).run(suite)
result = xmlrunner.XMLTestRunner(output='test-reports', verbosity=1).run(suite)
sys.exit(not result.wasSuccessful())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment