<commit_before>VIRTUALENV=~/.venvs/pixua

.PHONY: setup requirements install requirements_py install_py requirements_js install_js create_virtualenv
.PHONY: test test_py test_js test_all linters linters_py linters_js coverage unit_tests_py unit_tests_js
.PHONY: integration_tests_py functional_tests functional_tests_ci ensure_virtualenv_installed clean
.PHONY: clean_all clean_py clean_js clean_cache remove_virtualenv remove_javascript_packages
setup: install

requirements: requirements_py requirements_js

install: requirements install_py install_js

requirements_py: create_virtualenv
	@. $(VIRTUALENV)/bin/activate;\
	pip install --upgrade pip setuptools

install_py: service/requirements.txt service/test_requirements.txt
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	pip install pysqlcipher --upgrade --force-reinstall --install-option="--bundled";\
	pip install --exists-action s -r requirements.txt -r test_requirements.txt

requirements_js:
	@cd web-ui;\
	npm install;\
	node_modules/.bin/bower install

install_js:
	@cd web-ui;\
	npm rebuild node-sass;\
	npm run build

create_virtualenv: ensure_virtualenv_installed
	@if [ ! -e $(VIRTUALENV)/bin/activate ]; then\
		echo "Pixelated virtualenv doesn't exist, creating now";\
		virtualenv --python=python2 $(VIRTUALENV);\
	fi

test: clean install test_py test_js coverage
test_py: linters_py unit_tests_py integration_tests_py
test_js: linters_js unit_tests_js
test_all: test functional_tests
linters: clean install linters_py linters_js

linters_py:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	pep8 --ignore=E501 pixelated test

linters_js:
	@cd web-ui;\
	npm run lint

coverage:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	export PYTHONPATH=$(PYTHONPATH):`pwd`;\
	coverage run -p --source=pixelated `which trial` test.unit;\
	coverage run -p --source=pixelated `which trial` test.integration;\
	coverage combine;\
	coverage html

unit_tests_py:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	export PYTHONPATH=$(PYTHONPATH):`pwd`;\
	trial --reporter=text test.unit

unit_tests_js:
	@cd web-ui;\
	npm run test

integration_tests_py:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	export PYTHONPATH=$(PYTHONPATH):`pwd`;\
	trial --reporter=text test.integration

functional_tests: clean requirements install
	@. $(VIRTUALENV)/bin/activate;\
	export PATH=$(PATH):/usr/lib/chromium/;\
	cd service;\
	xvfb-run --server-args="-screen 0 1280x1024x24" behave --tags ~@wip --tags ~@smoke test/functional/features

functional_tests_ci: clean requirements install
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	behave --tags ~@wip --tags ~@smoke test/functional/features

functional_tests_wip:
	@. $(VIRTUALENV)/bin/activate;\
	export PATH=$(PATH):/usr/lib/chromium/;\
	cd service;\
	xvfb-run --server-args="-screen 0 1280x1024x24" behave --tags @wip test/functional/features

ensure_virtualenv_installed:
	@if [ ! `which virtualenv` ]; then\
		echo "Virtualenv must be installed";\
		exit 1;\
	fi

clean: clean_py clean_js clean_cache
clean_all: clean remove_javascript_packages remove_virtualenv

clean_py:
	rm -rf service/_trial_temp
	find . -name "*.pyc" -delete
	rm -rf service/.coverage<commit_msg>Adds step do run smoke tests<commit_after>VIRTUALENV=~/.venvs/pixua

.PHONY: setup requirements install requirements_py install_py requirements_js install_js create_virtualenv
.PHONY: test test_py test_js test_all linters linters_py linters_js coverage unit_tests_py unit_tests_js
.PHONY: integration_tests_py functional_tests functional_tests_ci ensure_virtualenv_installed clean
.PHONY: clean_all clean_py clean_js clean_cache remove_virtualenv remove_javascript_packages
setup: install

requirements: requirements_py requirements_js

install: requirements install_py install_js

requirements_py: create_virtualenv
	@. $(VIRTUALENV)/bin/activate;\
	pip install --upgrade pip setuptools

install_py: service/requirements.txt service/test_requirements.txt
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	pip install pysqlcipher --upgrade --force-reinstall --install-option="--bundled";\
	pip install --exists-action s -r requirements.txt -r test_requirements.txt

requirements_js:
	@cd web-ui;\
	npm install;\
	node_modules/.bin/bower install

install_js:
	@cd web-ui;\
	npm rebuild node-sass;\
	npm run build

create_virtualenv: ensure_virtualenv_installed
	@if [ ! -e $(VIRTUALENV)/bin/activate ]; then\
		echo "Pixelated virtualenv doesn't exist, creating now";\
		virtualenv --python=python2 $(VIRTUALENV);\
	fi

test: clean install test_py test_js coverage
test_py: linters_py unit_tests_py integration_tests_py
test_js: linters_js unit_tests_js
test_all: test functional_tests
linters: clean install linters_py linters_js

linters_py:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	pep8 --ignore=E501 pixelated test

linters_js:
	@cd web-ui;\
	npm run lint

coverage:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	export PYTHONPATH=$(PYTHONPATH):`pwd`;\
	coverage run -p --source=pixelated `which trial` test.unit;\
	coverage run -p --source=pixelated `which trial` test.integration;\
	coverage combine;\
	coverage html

unit_tests_py:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	export PYTHONPATH=$(PYTHONPATH):`pwd`;\
	trial --reporter=text test.unit

unit_tests_js:
	@cd web-ui;\
	npm run test

integration_tests_py:
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	export PYTHONPATH=$(PYTHONPATH):`pwd`;\
	trial --reporter=text test.integration

functional_tests: clean requirements install
	@. $(VIRTUALENV)/bin/activate;\
	export PATH=$(PATH):/usr/lib/chromium/;\
	cd service;\
	xvfb-run --server-args="-screen 0 1280x1024x24" behave --tags ~@wip --tags ~@smoke test/functional/features

smoke_tests: clean install
	@. $(VIRTUALENV)/bin/activate;\
	export PATH=$(PATH):/usr/lib/chromium/;\
	cd service;\
	xvfb-run --server-args="-screen 0 1280x1024x24" behave --tags ~@wip --tags @smoke test/functional/features -k -D host=$(provider)

functional_tests_ci: clean requirements install
	@. $(VIRTUALENV)/bin/activate;\
	cd service;\
	behave --tags ~@wip --tags ~@smoke test/functional/features

functional_tests_wip:
	@. $(VIRTUALENV)/bin/activate;\
	export PATH=$(PATH):/usr/lib/chromium/;\
	cd service;\
	xvfb-run --server-args="-screen 0 1280x1024x24" behave --tags @wip test/functional/features

ensure_virtualenv_installed:
	@if [ ! `which virtualenv` ]; then\
		echo "Virtualenv must be installed";\
		exit 1;\
	fi

clean: clean_py clean_js clean_cache
clean_all: clean remove_javascript_packages remove_virtualenv

clean_py:
	rm -rf service/_trial_temp
	find . -name "*.pyc" -delete
	rm -rf service/.coverage
{'fraction_non_alphanumeric': 0.11729049856038794, 'fraction_numerical': 0.010153053492953477, 'mean_word_length': 4.9352517985611515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2285472', 'n_tokens_mistral': 2415, 'n_tokens_neox': 2266, 'n_words': 555}