Permalink
Browse files

Merge pull request #52 from betatim/travisci

We don't have Travis, yet
  • Loading branch information...
2 parents 250fd09 + 9dfef96 commit b59f465978d31de03abfc79330d1afd3c276dfb3 @anaderi anaderi committed Mar 6, 2016
View
@@ -0,0 +1,32 @@
+language: python
+
+# Needed so we can spawn docker containers
+sudo: required
+services:
+ - docker
+
+addons:
+ apt:
+ packages:
+ - build-essential
+
+python:
+ - 3.5
+ - 3.4
+env:
+ - JHUB_VERSION=master
+ - JHUB_VERSION=latest # latest released version
+
+before_install:
+ - npm install
+ - npm install -g configurable-http-proxy
+ - git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
+install: ./build_tools/travis/install.sh
+
+script:
+ - nose2 -v --start-dir everware # unit tests live in everware/
+ - ./build_tools/travis/test_frontend.sh
+
+# Make travis quiet
+notifications:
+ email: false
View
@@ -0,0 +1,34 @@
+import os
+import everware
+import jupyterhub.handlers.pages
+import jupyterhub.handlers.base
+
+
+# TODO: find a way to change default handlers
+# instead of this shit
+jupyterhub.handlers.base.UserSpawnHandler.get = everware.UserSpawnHandler.get
+jupyterhub.handlers.pages.SpawnHandler.post = everware.SpawnHandler.post
+jupyterhub.handlers.pages.SpawnHandler.get = everware.SpawnHandler.get
+jupyterhub.handlers.pages.SpawnHandler._spawn = everware.SpawnHandler._spawn
+jupyterhub.handlers.pages.HomeHandler.get = everware.HomeHandler.get
+
+c = get_config()
+
+# spawn with custom docker containers
+c.JupyterHub.spawner_class = 'everware.CustomDockerSpawner'
+
+c.Spawner.tls = False
+c.Spawner.debug = True
+c.Spawner.start_timeout = 1000
+c.Spawner.remove_containers = True
+c.Spawner.tls_assert_hostname = False
+c.Spawner.use_docker_client_env = True
+
+# The docker containers need access to the Hub, so the default loopback
+# port doesn't work:
+from jupyter_client.localinterfaces import public_ips
+c.JupyterHub.hub_ip = public_ips()[0]
+c.JupyterHub.hub_api_ip = public_ips()[0]
+
+c.JupyterHub.data_files_path = 'share'
+c.JupyterHub.template_paths = ['share/static/html']
@@ -0,0 +1,4 @@
+c = get_config()
+load_subconfig('base_config.py')
+
+c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
@@ -0,0 +1,15 @@
+#! /usr/bin/env bash
+
+if [[ "$JHUB_VERSION" == "master" ]]; then
+ echo "Using jupyterhub master"
+ pushd /tmp
+ git clone --quiet --depth 1 https://github.com/jupyter/jupyterhub.git
+ cd jupyterhub
+ pip install -r requirements.txt -e.
+ python setup.py js
+ python setup.py css
+ popd
+ echo "Done installing jupyterhub master"
+fi
+
+pip install -f travis-wheels/wheelhouse -r requirements.txt .
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# This script is meant to be run from the script step in .travis.yml
+# The tests run by this script are "frontend" testing
+
+set -e
+echo "In" `pwd`
+
+# Start a hub that our tests can interact with
+echo "Starting everware"
+jupyterhub -f build_tools/travis/frontend_test_config.py \
+ --no-ssl --debug &
+sleep 3
+
+echo "Start running frontend tests"
+nose2 -v --start-dir frontend_tests
View
No changes.
@@ -0,0 +1,21 @@
+import os
+import everware
+
+
+c = get_config()
+load_subconfig('base_config.py')
+
+authenticator = everware.GitHubOAuthenticator
+c.JupyterHub.authenticator_class = 'everware.GitHubOAuthenticator'
+whitelist_file = 'whitelist.txt'
+whitelist_handler = everware.DefaultWhitelistHandler(whitelist_file,
+ c,
+ authenticator)
+c.GitHubOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL']
+c.GitHubOAuthenticator.client_id = os.environ['GITHUB_CLIENT_ID']
+c.GitHubOAuthenticator.client_secret = os.environ['GITHUB_CLIENT_SECRET']
+
+# change this to the ip that `boot2docker ip` or
+# `docker-machine ip <vm_name>`tells you if
+# you use boot2docker/a VM, otherwise remove the line
+c.Spawner.container_ip = '192.168.99.100'
View
@@ -1,7 +1,8 @@
ipython[notebook]
coveralls
-pytest-cov
-pytest
+nose2
+selenium
+jupyterhub-dummyauthenticator
jupyterhub
dockerspawner
GitPython==1.0.1

0 comments on commit b59f465

Please sign in to comment.