Commit 2f117b56 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[tests][experiments] Index databases before running tests using them

parent 21eec6b3
......@@ -33,10 +33,16 @@ import sys
import nose.tools
from . import platform, disconnected, prefix, tmp_prefix, user, token
from .utils import index_experiment_dbs
from ..common import Selector
from ..scripts.beat import main
from beat.core.test.utils import slow, cleanup, skipif
from beat.core.experiment import Storage, Experiment
from beat.core.experiment import Storage
def setup_experiments():
index_experiment_dbs('user/user/double_triangle/1/double_triangle')
index_experiment_dbs('user/user/integers_addition/1/integers_addition')
def call(*args, **kwargs):
......@@ -144,14 +150,15 @@ def test_delete_local():
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_run_integers_addition_1():
obj = 'user/user/integers_addition/1/integers_addition'
# index_db_for_exp(obj)
nose.tools.eq_(call('run', obj, cache=tmp_prefix), 0)
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_list_integers_addition_1_cache():
obj = 'user/user/integers_addition/1/integers_addition'
nose.tools.eq_(call('run', obj, cache=tmp_prefix), 0)
......@@ -159,7 +166,7 @@ def test_list_integers_addition_1_cache():
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_checksum_integers_addition_1_cache():
obj = 'user/user/integers_addition/1/integers_addition'
nose.tools.eq_(call('run', obj, cache=tmp_prefix), 0)
......@@ -167,7 +174,7 @@ def test_checksum_integers_addition_1_cache():
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_delete_integers_addition_1_cache():
obj = 'user/user/integers_addition/1/integers_addition'
nose.tools.eq_(call('run', obj, cache=tmp_prefix), 0)
......@@ -175,14 +182,14 @@ def test_delete_integers_addition_1_cache():
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_run_double_triangle_1():
obj = 'user/user/double_triangle/1/double_triangle'
nose.tools.eq_(call('run', obj, cache=tmp_prefix), 0)
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_run_single_error_1_local():
# When running locally, the module with the error is loaded
# inside the currently running process and will return '1'.
......@@ -200,7 +207,7 @@ def test_run_single_error_1_docker():
@slow
@nose.tools.with_setup(teardown=cleanup)
@nose.tools.with_setup(setup=setup_experiments, teardown=cleanup)
def test_run_single_error_twice_local():
# This one makes sure our output reset is working properly. Both tries should
# give out the same error.
......
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