|  | 
|  | 1 | +# Copyright (c) Jupyter Development Team. | 
|  | 2 | +# Distributed under the terms of the Modified BSD License. | 
|  | 3 | + | 
|  | 4 | +.PHONY: help init clean test system-test | 
|  | 5 | + | 
| 1 | 6 | ROOT_REPO:=jupyter/all-spark-notebook:258e25c03cba | 
| 2 | 7 | CONTAINER_NAME:=declarativewidgets-explorer | 
| 3 | 8 | REPO:=jupyter/declarativewidgets-explorer:258e25c03cba | 
| @@ -40,10 +45,11 @@ node_modules: package.json | 
| 40 | 45 | bower_components: node_modules bower.json | 
| 41 | 46 | 	@npm run bower -- install $(BOWER_OPTS) | 
| 42 | 47 | 
 | 
|  | 48 | +run: SERVER_NAME?=urth_explorer_server | 
| 43 | 49 | run: PORT_MAP?=-p 8888:8888 | 
| 44 | 50 | run: CMD?=jupyter notebook --no-browser --port 8888 --ip="*" | 
| 45 | 51 | run: | 
| 46 |  | -	@docker $(DOCKER_OPTS) run --user root $(OPTIONS) \ | 
|  | 52 | +	@docker $(DOCKER_OPTS) run --user root $(OPTIONS) --name $(SERVER_NAME) \ | 
| 47 | 53 | 		$(PORT_MAP) \ | 
| 48 | 54 | 		-e USE_HTTP=1 \ | 
| 49 | 55 | 		-v `pwd`:/srv \ | 
|  | 
| 53 | 59 | 		$(REPO) bash -c '$(CMD)' | 
| 54 | 60 | 
 | 
| 55 | 61 | test: bower_components | 
| 56 |  | -	@bower install ../declarativewidgets/elements/urth-core-behaviors/ | 
| 57 |  | -	@bower install ../declarativewidgets/elements/urth-viz-behaviors/ | 
|  | 62 | +	@bower install ../widgets/elements/urth-core-behaviors/ | 
|  | 63 | +	@bower install ../widgets/elements/urth-viz-behaviors/ | 
| 58 | 64 | 	@npm test | 
| 59 | 65 | 
 | 
| 60 | 66 | clean: | 
| 61 | 67 | 	@-rm -rf bower_components node_modules | 
|  | 68 | + | 
|  | 69 | +### System integration tests | 
|  | 70 | +BASEURL?=http://192.168.99.100:8888 | 
|  | 71 | +BROWSER_LIST?=chrome | 
|  | 72 | +TEST_TYPE?=local | 
|  | 73 | +SPECS?=system-test/urth-viz-explorer-specs.js | 
|  | 74 | + | 
|  | 75 | +remove-server: | 
|  | 76 | +	-@docker $(DOCKER_OPTS) rm -f $(SERVER_NAME) | 
|  | 77 | + | 
|  | 78 | +sdist: | 
|  | 79 | + | 
|  | 80 | +run-test: SERVER_NAME?=urth_widgets_integration_test_server | 
|  | 81 | +run-test: sdist remove-server | 
|  | 82 | +	@echo $(TEST_MSG) | 
|  | 83 | +	@OPTIONS=-d SERVER_NAME=$(SERVER_NAME) $(MAKE) run | 
|  | 84 | +	@echo 'Waiting for server to start...' | 
|  | 85 | +	@LIMIT=60; while [ $$LIMIT -gt 0 ] && ! docker logs $(SERVER_NAME) 2>&1 | grep 'Notebook is running'; do echo waiting $$LIMIT...; sleep 1; LIMIT=$$(expr $$LIMIT - 1); done | 
|  | 86 | +	@$(foreach browser, $(BROWSER_LIST), echo 'Running system integration tests on $(browser)...'; npm run system-test -- $(SPECS) --baseurl $(BASEURL) --test-type $(TEST_TYPE) --browser $(browser) || exit) | 
|  | 87 | +	@SERVER_NAME=$(SERVER_NAME) $(MAKE) remove-server | 
|  | 88 | + | 
|  | 89 | +system-test-python3: TEST_MSG="Starting system tests for Python 3" | 
|  | 90 | +system-test-python3: | 
|  | 91 | +	TEST_MSG=$(TEST_MSG) TEST_TYPE=$(TEST_TYPE) BROWSER_LIST="$(BROWSER_LIST)" JUPYTER=$(JUPYTER) SPECS="$(SPECS)" BASEURL=$(BASEURL) $(MAKE) run-test | 
|  | 92 | + | 
|  | 93 | +system-test-all: system-test-python3 | 
|  | 94 | + | 
|  | 95 | +start-selenium: node_modules stop-selenium | 
|  | 96 | +	@echo "Installing and starting Selenium Server..." | 
|  | 97 | +	@node_modules/selenium-standalone/bin/selenium-standalone install >/dev/null | 
|  | 98 | +	@node_modules/selenium-standalone/bin/selenium-standalone start 2>/dev/null & echo $$! > SELENIUM_PID | 
|  | 99 | + | 
|  | 100 | +stop-selenium: | 
|  | 101 | +	-@kill `cat SELENIUM_PID` | 
|  | 102 | +	-@rm SELENIUM_PID | 
|  | 103 | + | 
|  | 104 | +system-test-all-local: TEST_TYPE:="local" | 
|  | 105 | +system-test-all-local: start-selenium system-test-all stop-selenium | 
|  | 106 | + | 
|  | 107 | +system-test-all-remote: TEST_TYPE:="remote" | 
|  | 108 | +system-test-all-remote: system-test-all | 
|  | 109 | + | 
|  | 110 | +system-test: | 
|  | 111 | +ifdef SAUCE_USER_NAME | 
|  | 112 | +	@echo 'Running system tests on Sauce Labs...' | 
|  | 113 | +	@BROWSER_LIST="$(BROWSER_LIST)" JUPYTER=$(JUPYTER) SPECS="$(SPECS)" BASEURL=$(BASEURL) $(MAKE) system-test-all-remote | 
|  | 114 | +else ifdef TRAVIS | 
|  | 115 | +	@echo 'Starting system integration tests locally on Travis...' | 
|  | 116 | +	@BROWSER_LIST="firefox" ALT_BROWSER_LIST="firefox" JUPYTER=$(JUPYTER) SPECS="$(SPECS)" BASEURL=$(BASEURL) $(MAKE) system-test-all-local | 
|  | 117 | +else | 
|  | 118 | +	@echo 'Starting system integration tests locally...' | 
|  | 119 | +	@BROWSER_LIST="$(BROWSER_LIST)" JUPYTER=$(JUPYTER) SPECS="$(SPECS)" BASEURL=$(BASEURL) $(MAKE) system-test-all-local | 
|  | 120 | +endif | 
|  | 121 | +	@echo 'System integration tests complete.' | 
0 commit comments