mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-23 23:18:11 +08:00
Add a root test target that calls sub-tests
This commit is contained in:
+5
-8
@@ -8,24 +8,21 @@ cache:
|
||||
- npm
|
||||
install:
|
||||
- set -eo pipefail
|
||||
- pip install yapf flake8
|
||||
- make pydist
|
||||
- make install-dist
|
||||
- pip install -r server/requirements-dev.txt
|
||||
- pip install flake8
|
||||
- make pydist install-dist dev-env
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- name: "Branch Tests 3.7"
|
||||
python: "3.7"
|
||||
script: ./travis-build.sh
|
||||
script: make build-client lint unit-test
|
||||
- name: "Branch Tests 3.6"
|
||||
python: "3.6"
|
||||
script: ./travis-build.sh
|
||||
script: make build-client lint unit-test
|
||||
- name: "Docker Build"
|
||||
install: skip
|
||||
python: "3.6"
|
||||
script: docker build .
|
||||
- name: "Smoke Tests"
|
||||
python: "3.6"
|
||||
script:
|
||||
- npm run --prefix client/ smoke-test
|
||||
script: make smoke-test
|
||||
|
||||
@@ -54,6 +54,17 @@ build-for-server-dev: clean-server build-client
|
||||
cp client/build/service-worker.js server/app/web/static/js/
|
||||
|
||||
|
||||
# TESTING
|
||||
.PHONY: unit-test
|
||||
unit-test: unit-test-server unit-test-client
|
||||
|
||||
unit-test-%:
|
||||
cd $(*) && $(MAKE) unit-test
|
||||
|
||||
.PHONY: smoke-test
|
||||
smoke-test:
|
||||
cd client && $(MAKE) smoke-test
|
||||
|
||||
# FORMATTING CODE
|
||||
|
||||
.PHOHY: fmt
|
||||
|
||||
@@ -14,3 +14,10 @@ fmt:
|
||||
clean:
|
||||
rm -rf node_modules
|
||||
|
||||
.PHONY: unit-test
|
||||
unit-test:
|
||||
npm run unit-test
|
||||
|
||||
.PHONY: smoke-test
|
||||
smoke-test:
|
||||
npm run smoke-test
|
||||
|
||||
@@ -10,3 +10,7 @@ lint:
|
||||
clean:
|
||||
rm -f app/web/templates/index.html
|
||||
rm -rf app/web/static
|
||||
|
||||
.PHONY: unit-test
|
||||
unit-test:
|
||||
pytest -s test
|
||||
|
||||
@@ -19,7 +19,7 @@ class EndPoints(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.ps = Popen(["cellxgene", "launch", "example-dataset/pbmc3k.h5ad", "--verbose", "--port", "5005"])
|
||||
cls.ps = Popen(["cellxgene", "launch", "../example-dataset/pbmc3k.h5ad", "--verbose", "--port", "5005"])
|
||||
session = requests.Session()
|
||||
for i in range(90):
|
||||
try:
|
||||
|
||||
@@ -21,7 +21,7 @@ class WithNaNs(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.ps = Popen(
|
||||
["cellxgene", "launch", "server/test/test_datasets/nan.h5ad", "--verbose", "--port", "5006"]
|
||||
["cellxgene", "launch", "test/test_datasets/nan.h5ad", "--verbose", "--port", "5006"]
|
||||
)
|
||||
session = requests.Session()
|
||||
for i in range(90):
|
||||
|
||||
@@ -21,12 +21,12 @@ class NaNTest(unittest.TestCase):
|
||||
}
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", category=UserWarning)
|
||||
self.data = ScanpyEngine(DataLocator("server/test/test_datasets/nan.h5ad"), self.args)
|
||||
self.data = ScanpyEngine(DataLocator("test/test_datasets/nan.h5ad"), self.args)
|
||||
self.data._create_schema()
|
||||
|
||||
def test_load(self):
|
||||
with self.assertWarns(UserWarning):
|
||||
ScanpyEngine(DataLocator("server/test/test_datasets/nan.h5ad"), self.args)
|
||||
ScanpyEngine(DataLocator("test/test_datasets/nan.h5ad"), self.args)
|
||||
|
||||
def test_init(self):
|
||||
self.assertEqual(self.data.cell_count, 100)
|
||||
|
||||
@@ -19,13 +19,13 @@ Test the scanpy engine using the pbmc3k data set.
|
||||
|
||||
|
||||
@parameterized_class(("data_locator", "backed"), [
|
||||
("example-dataset/pbmc3k.h5ad", False),
|
||||
("server/test/test_datasets/pbmc3k-CSC-gz.h5ad", False),
|
||||
("server/test/test_datasets/pbmc3k-CSR-gz.h5ad", False),
|
||||
("../example-dataset/pbmc3k.h5ad", False),
|
||||
("test/test_datasets/pbmc3k-CSC-gz.h5ad", False),
|
||||
("test/test_datasets/pbmc3k-CSR-gz.h5ad", False),
|
||||
|
||||
("example-dataset/pbmc3k.h5ad", True),
|
||||
("server/test/test_datasets/pbmc3k-CSC-gz.h5ad", True),
|
||||
("server/test/test_datasets/pbmc3k-CSR-gz.h5ad", True),
|
||||
("../example-dataset/pbmc3k.h5ad", True),
|
||||
("test/test_datasets/pbmc3k-CSC-gz.h5ad", True),
|
||||
("test/test_datasets/pbmc3k-CSR-gz.h5ad", True),
|
||||
])
|
||||
class EngineTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -11,7 +11,7 @@ class DataLoadEngineTest(unittest.TestCase):
|
||||
Test file loading, including deferred loading/update.
|
||||
"""
|
||||
def setUp(self):
|
||||
self.data_file = DataLocator("example-dataset/pbmc3k.h5ad")
|
||||
self.data_file = DataLocator("../example-dataset/pbmc3k.h5ad")
|
||||
self.data = ScanpyEngine()
|
||||
|
||||
def test_init(self):
|
||||
@@ -76,7 +76,7 @@ class DataLocatorEngineTest(unittest.TestCase):
|
||||
self.assertEqual(data.gene_count, 1838)
|
||||
|
||||
def test_posix_file(self):
|
||||
locator = DataLocator("example-dataset/pbmc3k.h5ad")
|
||||
locator = DataLocator("../example-dataset/pbmc3k.h5ad")
|
||||
data = ScanpyEngine(locator, self.args)
|
||||
self.stdAsserts(data)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class WritableAnnotationTest(unittest.TestCase):
|
||||
"annotations_file": self.annotations_file,
|
||||
"annotations_output_dir": None
|
||||
}
|
||||
self.data = ScanpyEngine(DataLocator("example-dataset/pbmc3k.h5ad"), args)
|
||||
self.data = ScanpyEngine(DataLocator("../example-dataset/pbmc3k.h5ad"), args)
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.tmpDir)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
set -eo pipefail
|
||||
make lint
|
||||
npm run --prefix client/ build
|
||||
npm run --prefix client/ unit-test
|
||||
pytest -s server/test
|
||||
Reference in New Issue
Block a user