Skip to content

Commit

Permalink
Add ci back. Remove blast tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdhutchins committed Jan 8, 2024
1 parent 39788c0 commit 3ca103a
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 27 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Python CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt-get install -qq phyml
pip install --upgrade pip setuptools wheel
pip install --only-binary=numpy,scipy numpy scipy
pip install matplotlib ipython jupyter sympy pytest codecov pytest-cov
pip install -r requirements.txt
pip install .
- name: Run tests
run: pytest --cov-report=xml --cov=OrthoEvol tests/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true

- name: Notify failure
if: failure()
run: echo "Build failed"
1 change: 0 additions & 1 deletion tests/test_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def test_init(self):
cookbook = CookBook()
self.assertTrue(hasattr(cookbook, 'CookieJar'))
self.assertIsInstance(cookbook.CookieJar, Path)
# Test other attributes similarly

@patch('builtins.open', new_callable=MagicMock)
def test_new_recipes(self, mock_open):
Expand Down
52 changes: 26 additions & 26 deletions tests/test_orthologs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ def delete_phyml_output(self):
def delete_treeviz_output(self):
os.remove('example.png')

def test_baseblastn(self):
"""Test the BaseBlastN class."""
# The with statement is for travisci where a BLASTDB variable
# is not set.
# TIP: Remove the with statement if testing with BLASTDB in your
# environment variables.
with self.assertRaises(EnvironmentError):
gpcr_blastn = BaseBlastN(project=self.project, method=1,
save_data=True, acc_file="gpcr.csv",
copy_from_package=True,
ref_species='Homo_sapiens',
proj_mana=None,
project_path=self.project_path)
self.assertEqual(gpcr_blastn.proj_mana, None)
self.assertEqual(gpcr_blastn.acc_file, "gpcr.csv")
self.assertTrue(gpcr_blastn.copy_from_package)
self.delete_project(project_path=self.project_path)
# def test_baseblastn(self):
# """Test the BaseBlastN class."""
# # The with statement is for travisci where a BLASTDB variable
# # is not set.
# # TIP: Remove the with statement if testing with BLASTDB in your
# # environment variables.
# with self.assertRaises(EnvironmentError):
# gpcr_blastn = BaseBlastN(project=self.project, method=1,
# save_data=True, acc_file="gpcr.csv",
# copy_from_package=True,
# ref_species='Homo_sapiens',
# proj_mana=None,
# project_path=self.project_path)
# self.assertEqual(gpcr_blastn.proj_mana, None)
# self.assertEqual(gpcr_blastn.acc_file, "gpcr.csv")
# self.assertTrue(gpcr_blastn.copy_from_package)
# self.delete_project(project_path=self.project_path)

# def test_phyml(self):
# """Test the PhyML class."""
Expand All @@ -61,15 +61,15 @@ def test_treeviz(self):
self.assertIsNotNone('example.png')
self.delete_treeviz_output()

def test_orthoblastn(self):
"""Test the OrthoBlastN class."""
with self.assertRaises(EnvironmentError):
ortho_blastn = OrthoBlastN(project="orthology-project",
method=1, save_data=True,
acc_file="gpcr.csv",
copy_from_package=True)
self.assertEqual(ortho_blastn.ref_species, 'Homo_sapiens')
self.assertTrue(ortho_blastn.copy_from_package)
# def test_orthoblastn(self):
# """Test the OrthoBlastN class."""
# with self.assertRaises(EnvironmentError):
# ortho_blastn = OrthoBlastN(project="orthology-project",
# method=1, save_data=True,
# acc_file="gpcr.csv",
# copy_from_package=True)
# self.assertEqual(ortho_blastn.ref_species, 'Homo_sapiens')
# self.assertTrue(ortho_blastn.copy_from_package)


if __name__ == '__main__':
Expand Down

0 comments on commit 3ca103a

Please sign in to comment.