Skip to content

Commit

Permalink
Merge pull request #53 from spacetelescope/testing_setup
Browse files Browse the repository at this point in the history
This PR adds several updates to stistools.  Removes distutils dependency, removes Python 2 support, pep 8 fixes, and adds artifactory unit tests.
  • Loading branch information
SaOgaz authored Sep 21, 2018
2 parents 4b0324b + acae126 commit a72338c
Show file tree
Hide file tree
Showing 50 changed files with 2,166 additions and 1,232 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
RELIC-INFO
relic/
*/version.py
build/
dist/
*.pyc
*.o
*.so
*.egg-info
*.swp
22 changes: 22 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if (utils.scm_checkout()) return


data_config = new DataConfig()
data_config.server_id = "bytesalad"
data_config.root = 'tests_output'
data_config.match_prefix = '(.*)_result' // .json is appended automatically


bc0 = new BuildConfig()
bc0.nodetype = "linux"
bc0.name = "Install"
bc0.test_configs = [data_config]
bc0.build_cmds = ["conda env update --file=doc/environment.yml -q",
"with_env -n stistools python setup.py install",
"with_env -n stistools conda install -q -y -c http://ssb.stsci.edu/astroconda hstcal",
"with_env -n stistools conda install -q -y -c http://ssb.stsci.edu/astroconda crds"]
bc0.test_cmds = ["with_env -n stistools conda install -q -y pytest",
"with_env -n stistools conda install -q -y pytest-remotedata",
"with_env -n stistools pytest --basetemp=tests_output --junitxml results.xml --bigdata"]

utils.run([bc0])
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include RELIC-INFO
exclude stistools/version.py
recursive-include stistools/pars *.cfg*

50 changes: 50 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Project default for pytest"""
import os
import pytest

from astropy.tests.plugins.display import PYTEST_HEADER_MODULES
from astropy.tests.helper import enable_deprecations_as_exceptions


# Uncomment the following line to treat all DeprecationWarnings as exceptions
enable_deprecations_as_exceptions()

def pytest_addoption(parser):
# Add option to run slow tests
parser.addoption(
"--runslow",
action="store_true",
help="run slow tests"
)

parser.addoption(
"--slow",
action="store_true",
help="run slow tests"
)

# Add option to use big data sets
parser.addoption(
"--bigdata",
action="store_true",
help="use big data sets (intranet)"
)

parser.addoption(
"--env",
choices=['dev', 'stable', ''],
default='',
help="specify what environment to test"
)


@pytest.fixture(scope='function', autouse=True)
def _jail(tmpdir):
""" Perform test in a pristine temporary working directory
"""
os.chdir(tmpdir.strpath)
yield

@pytest.fixture
def envopt(request):
return request.config.getoption("env")
16 changes: 0 additions & 16 deletions defsetup.py

This file was deleted.

Loading

0 comments on commit a72338c

Please sign in to comment.