Skip to content

Commit

Permalink
Added compile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesp committed Dec 19, 2017
1 parent 6f64d11 commit 5cf4b52
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,31 @@ pipeline {
source activate jenkins
cd $GFDL_BASE/src/extra/python
pip install -r requirements.txt
conda install -y scipy xarray tqdm
conda install -y scipy xarray tqdm pytest
pip install -e .
"""
}
}

stage('Compile') {
steps {
sh """
module load python/anaconda
source activate jenkins
cd $GFDL_BASE/test
pytest --junitxml results.xml
"""
junit 'test/results.xml'
}
}

stage('Test') {
steps {
sh """
module load python/anaconda
source activate jenkins
cd $GFDL_BASE/exp/test_cases/trip_test
./trip_test_command_line -r ${env.GIT_URL} f3dd4ec6b3587de4fe5fcdb4d61003a8f499931d ${env.GIT_COMMIT} held_suarez
./trip_test_command_line -r ${env.GIT_URL} -e held_suarez f3dd4ec6b3587de4fe5fcdb4d61003a8f499931d ${env.GIT_COMMIT}
"""
}
}
Expand Down
15 changes: 15 additions & 0 deletions test/test_compile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest

from isca import GreyCodeBase, IscaCodeBase, DryCodeBase, GFDL_BASE

def test_grey_codebase():
cb = GreyCodeBase.from_directory(GFDL_BASE)
cb.compile()

def test_isca_codebase():
cb = IscaCodeBase.from_directory(GFDL_BASE)
cb.compile()

def test_dry_codebase():
cb = DryCodeBase.from_directory(GFDL_BASE)
cb.compile()

0 comments on commit 5cf4b52

Please sign in to comment.