Skip to content

Commit

Permalink
Move tests > 50 seconds to jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleswing committed May 12, 2017
1 parent c0b143b commit 23d9245
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install:
- pip install coveralls
- python setup.py install
script:
- nosetests --with-timer --with-coverage --cover-package=deepchem -v deepchem --nologcapture
- nosetests -a '!slow' --with-timer --with-coverage --cover-package=deepchem -v deepchem --nologcapture
- find ./deepchem | grep .py$ |xargs python -m doctest -v
- bash devtools/travis-ci/test_format_code.sh
after_success:
Expand Down
7 changes: 3 additions & 4 deletions deepchem/dock/tests/test_docking.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
"""
Tests for Docking
"""
from __future__ import print_function
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"

import unittest
import tempfile
import os
import shutil
import numpy as np
from nose.tools import attr
import sys
import deepchem as dc

Expand Down Expand Up @@ -117,6 +115,7 @@ def test_vina_grid_dnn_docker_dock(self):
assert os.path.exists(protein_docked)
assert os.path.exists(ligand_docked)

@attr('slow')
def test_pocket_vina_grid_dnn_docker_dock(self):
"""Test that VinaGridDNNDocker can dock."""
if sys.version_info >= (3, 0):
Expand Down
6 changes: 2 additions & 4 deletions deepchem/dock/tests/test_pose_generation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Tests for Pose Generation
"""
from __future__ import print_function
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

__author__ = "Bharath Ramsundar"
Expand All @@ -12,9 +12,6 @@
import os
import sys
import unittest
import tempfile
import shutil
import numpy as np
import deepchem as dc


Expand Down Expand Up @@ -50,6 +47,7 @@ def test_vina_poses(self):
assert os.path.exists(protein_pose_file)
assert os.path.exists(ligand_pose_file)

@attr('slow')
def test_pocket_vina_poses(self):
"""Test that VinaPoseGenerator creates pose files."""
if sys.version_info >= (3, 0):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import TestCase

from nose.tools import assert_equals
from nose.tools import assert_equals, attr
from rdkit import Chem

import deepchem as dc
Expand All @@ -11,6 +11,7 @@

class TestTensorflowEncoders(TestCase):

@attr('slow')
def test_fit(self):
tf_enc = TensorflowMoleculeEncoder.zinc_encoder()

Expand Down
14 changes: 9 additions & 5 deletions deepchem/molnet/tests/test_molnet.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
"""
Tests for molnet function
"""
from __future__ import print_function
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import os
import csv
import tempfile
import unittest

import numpy as np
import pandas as pd
import os
from nose.tools import attr

import deepchem as dc
import tempfile
import csv


class TestMolnet(unittest.TestCase):
Expand All @@ -23,6 +25,7 @@ def setUp(self):
super(TestMolnet, self).setUp()
self.current_dir = os.path.dirname(os.path.abspath(__file__))

@attr('slow')
def test_delaney_graphconvreg(self):
"""Tests molnet benchmarking on delaney with graphconvreg."""
datasets = ['delaney']
Expand All @@ -45,6 +48,7 @@ def test_delaney_graphconvreg(self):
assert float(lastrow[-3]) > 0.75
os.remove(os.path.join(out_path, 'results.csv'))

@attr('slow')
def test_qm7_multitask(self):
"""Tests molnet benchmarking on qm7 with multitask network."""
datasets = ['qm7']
Expand Down
4 changes: 0 additions & 4 deletions deepchem/utils/test/test_generator_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class TestGeneratorEvaluator(TestCase):

@attr('slow')
def test_compute_model_performance_multitask_classifier(self):
n_data_points = 20
n_features = 2
Expand Down Expand Up @@ -65,7 +64,6 @@ def test_compute_model_performance_multitask_classifier(self):
# Loosening atol to see if tests stop failing sporadically
assert_true(np.all(np.isclose(scores, [1.0, 1.0], atol=0.50)))

@attr('slow')
def test_compute_model_performance_singletask_classifier(self):
n_data_points = 20
n_features = 10
Expand Down Expand Up @@ -116,7 +114,6 @@ def test_compute_model_performance_singletask_classifier(self):
scores = list(scores[1].values())
assert_true(np.isclose(scores, [1.0], atol=0.05))

@attr('slow')
def test_compute_model_performance_multitask_regressor(self):
random_seed = 42
n_data_points = 20
Expand Down Expand Up @@ -170,7 +167,6 @@ def test_compute_model_performance_multitask_regressor(self):
scores = list(scores[1].values())
assert_true(np.all(np.isclose(scores, [0.0, 0.0], atol=1.0)))

@attr('slow')
def test_compute_model_performance_singletask_regressor(self):
n_data_points = 20
n_features = 2
Expand Down
4 changes: 3 additions & 1 deletion devtools/jenkins/jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ export retval1=$?
cd ..
nosetests -v devtools/jenkins/compare_results.py --with-xunit || true
export retval2=$?
nosetests -a 'slow' --with-timer deepchem --with-xunit -unit-file=slow_tests.xml|| true
export retval3=$?

source deactivate
conda remove --name $envname --all
export retval=$(($retval1 + $retval2))
export retval=$(($retval1 + $retval2 + $retval3))
exit ${retval}

0 comments on commit 23d9245

Please sign in to comment.