Test some external repositories we care about
So we know if we break something!
These all need better verification scripts tho.
MODIFY
.travis.yml
.travis.yml
@@ -7,7 +7,7 @@ python:
install:
- pip install -e .
- - pip install pytest-xdist
+ - pip install pytest-xdist pyyaml
script:
# Run at least 4 tests in parallel. These tests are all fully
@@ -19,3 +19,5 @@ env:
- REPO_TYPE=venv
- REPO_TYPE=julia
- REPO_TYPE=dockerfile
+ - REPO_TYPE=external/datasci.repos.yaml
+ - REPO_TYPE=external/reproductions.repos.yaml

MODIFY
tests/conftest.py
tests/conftest.py
@@ -9,17 +9,20 @@ success.
"""
import pytest
import subprocess
+import yaml
+import shlex
def pytest_collect_file(parent, path):
if path.basename == 'verify':
- return Repo(path, parent)
+ return LocalRepo(path, parent)
+ elif path.basename.endswith('.repos.yaml'):
+ return RemoteRepoList(path, parent)
-class Repo(pytest.File):
+class LocalRepo(pytest.File):
def collect(self):
- yield RepoTest(self.fspath.basename, self, self.fspath)
+ yield LocalRepoTest(self.fspath.basename, self, self.fspath)
-
-class RepoTest(pytest.Item):
+class LocalRepoTest(pytest.Item):
def __init__(self, name, parent, path):
super().__init__(name, parent)
self.path = path
@@ -30,3 +33,27 @@ class RepoTest(pytest.Item):
str(self.path.dirname),
'./verify'
])
+
+
+class RemoteRepoList(pytest.File):
+ def collect(self):
+ with self.fspath.open() as f:
+ repos = yaml.safe_load(f)
+ for repo in repos:
+ yield RemoteRepoTest(repo['name'], self, repo['url'], repo['ref'], repo['verify'])
+
+
+class RemoteRepoTest(pytest.Item):
+ def __init__(self, name, parent, url, ref, verify):
+ super().__init__(name, parent)
+ self.url = url
+ self.ref = ref
+ self.verify = verify
+
+ def runtest(self):
+ subprocess.check_call([
+ 'jupyter-repo2docker',
+ '--ref', self.ref,
+ self.url,
+ '--',
+ ] + shlex.split(self.verify))

ADD
tests/external/datasci.repos.yaml
+# A bunch of external datascience related repos we care about!
+- name: Jake's Data Science Book
+ url: https://github.com/jakevdp/PythonDataScienceHandbook
+ ref: de0cc6bd31
+ verify: python -c 'import matplotlib'

ADD
tests/external/reproductions.repos.yaml
+# A bunch of external repos that reproduce something cool we care about
+- name: LIGO Gravitational Waves
+ url: https://github.com/minrk/ligo-binder/
+ ref: b8259dac9eb
+ verify: python -c 'import matplotlib'

Test some external repositories we care about

So we know if we break something!

These all need better verification scripts tho.