Skip to content

Commit

Permalink
Merge pull request #56 from jmccreight/wrf_hydro_nwm_testing_update
Browse files Browse the repository at this point in the history
Tests on private repo working on docker
  • Loading branch information
jmccreight authored May 22, 2018
2 parents 854ade3 + 667d580 commit 3e63a7e
Show file tree
Hide file tree
Showing 1,407 changed files with 314 additions and 147,450 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
before_install:
- sudo chmod -R 777 $TRAVIS_BUILD_DIR
- docker pull wrfhydro/dev:conda

script:
- docker run -v $TRAVIS_BUILD_DIR:/home/docker/wrf_hydro_py wrfhydro/dev:conda bash -c "cd /home/docker/wrf_hydro_py/wrfhydropy/tests; pytest -v"
- docker run -v $TRAVIS_BUILD_DIR:/home/docker/wrf_hydro_py wrfhydro/dev:conda bash -c "pip uninstall -y wrfhydropy; cd /home/docker/wrf_hydro_py; python setup.py install; cd /home/docker/wrf_hydro_py/wrfhydropy/tests; pytest -v"

#deploy:
# provider: pypi
Expand Down
13 changes: 13 additions & 0 deletions wrfhydropy/core/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,19 @@ def is_pickle_locked(run_obj):


def get_git_revision_hash(the_dir):

# First test if this is even a git repo. (Have to allow for this unless the wrfhydropy
# testing brings in the wrf_hydro_code as a repo with a .git file.)
dir_is_repo = subprocess.call(
["git", "branch"],
stderr=subprocess.STDOUT,
stdout=open(os.devnull, 'w'),
cwd=the_dir
)
if dir_is_repo != 0:
warnings.warn('The source directory is NOT a git repo: ' + str(the_dir))
return 'not-a-repo'

dirty = subprocess.run(
['git', 'diff-index', 'HEAD'], # --quiet seems to give the wrong result.
stdout=subprocess.PIPE,
Expand Down
4 changes: 2 additions & 2 deletions wrfhydropy/core/wrfhydroclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ def __init__(
if self.run_dir.exists():
if rm_existing_run_dir:
shutil.rmtree(str(self.run_dir))
else:
self.run_dir.mkdir(parents=True)

self.run_dir.mkdir(parents=True)

# Check that compile object uid matches compile directory uid
# This is to ensure that a new model has not been compiled into that directory unknowingly
Expand Down
Loading

0 comments on commit 3e63a7e

Please sign in to comment.