forked from plotly/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump archetype version * install eslint globally, fix tabs * install requirements * clean up tests * unittest instead of implicit nosetest, all versions of python * rm 36 for now * just python 2 for now * typo * increase length of timeout * log the layout * remove duplicate visit
- Loading branch information
Showing
9 changed files
with
317 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
machine: | ||
node: | ||
version: 4.4.7 | ||
node: | ||
version: 6.9.2 | ||
post: | ||
- pyenv global 2.7.10 | ||
environment: | ||
TOX_PYTHON_27: python2.7 | ||
|
||
dependencies: | ||
pre: | ||
- npm install -g eslint | ||
- pip install tox | ||
- pip install -r dev-requirements.txt | ||
- npm install | ||
- node_modules/.bin/builder run build-dist | ||
- node_modules/.bin/builder run copy-lib | ||
|
||
test: | ||
post: | ||
# Ensure steps leading up to publishing work. | ||
- node_modules/.bin/builder run build-dist | ||
override: | ||
- tox | ||
- npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
dash_html_components | ||
dash_renderer | ||
dash | ||
percy | ||
selenium | ||
mock | ||
tox | ||
tox-pyenv | ||
six | ||
plotly>=2.0.8 | ||
requests[security] | ||
ipdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from __future__ import absolute_import | ||
from selenium import webdriver | ||
from selenium.webdriver.common.keys import Keys | ||
import importlib | ||
import multiprocessing | ||
import percy | ||
import time | ||
import unittest | ||
|
||
|
||
class IntegrationTests(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
super(IntegrationTests, cls).setUpClass() | ||
cls.driver = webdriver.Chrome() | ||
|
||
loader = percy.ResourceLoader(webdriver=cls.driver) | ||
cls.percy_runner = percy.Runner(loader=loader) | ||
cls.percy_runner.initialize_build() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
super(IntegrationTests, cls).tearDownClass() | ||
cls.driver.quit() | ||
cls.percy_runner.finalize_build() | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def tearDown(self): | ||
time.sleep(3) | ||
self.server_process.terminate() | ||
time.sleep(3) | ||
|
||
if hasattr(self, 'driver'): | ||
self.driver.quit() | ||
|
||
|
||
def startServer(self, app): | ||
def run(): | ||
app.scripts.config.serve_locally = True | ||
app.run_server( | ||
port=8050, | ||
debug=False, | ||
processes=4 | ||
) | ||
|
||
# Run on a separate process so that it doesn't block | ||
self.server_process = multiprocessing.Process(target=run) | ||
self.server_process.start() | ||
time.sleep(0.5) | ||
|
||
# Visit the dash page | ||
self.driver.get('http://localhost:8050') | ||
time.sleep(0.5) | ||
|
||
# Inject an error and warning logger | ||
logger = ''' | ||
window.tests = {}; | ||
window.tests.console = {error: [], warn: [], log: []}; | ||
var _log = console.log; | ||
var _warn = console.warn; | ||
var _error = console.error; | ||
console.log = function() { | ||
window.tests.console.log.push({method: 'log', arguments: arguments}); | ||
return _log.apply(console, arguments); | ||
}; | ||
console.warn = function() { | ||
window.tests.console.warn.push({method: 'warn', arguments: arguments}); | ||
return _warn.apply(console, arguments); | ||
}; | ||
console.error = function() { | ||
window.tests.console.error.push({method: 'error', arguments: arguments}); | ||
return _error.apply(console, arguments); | ||
}; | ||
''' | ||
self.driver.execute_script(logger) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
from os.path import dirname, basename, isfile | ||
import glob | ||
modules = glob.glob(dirname(__file__)+"/*.py") | ||
__all__ = [basename(f)[:-3] for f in modules if isfile(f)] | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +0,0 @@ | ||
/* eslint-disable import/default */ | ||
/* global require:false */ | ||
import karmaRunner from 'dash-components-archetype-dev/karma-runner'; | ||
|
||
karmaRunner.setupEnvironment(); | ||
|
||
// Use webpack to infer and `require` tests automatically. | ||
var testsReq = require.context('../src', true, /\.test.js$/); | ||
testsReq.keys().map(testsReq); | ||
|
||
karmaRunner.startKarma(); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.