diff --git a/.travis.yml b/.travis.yml index bbba64ed31e..368aa4d3ef6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,14 @@ env: # - DJANGO_SETTINGS_MODULE=test_setting TOXENV=django111-drflatest - DJANGO_SETTINGS_MODULE=test_setting TOXENV=quality - DJANGO_SETTINGS_MODULE=test_setting TOXENV=pii_check +- TOXENV=version_check - TOXENV=translations +matrix: + exclude: + - python: 2.7 + env: TOXENV=version_check + before_install: - export DISPLAY=:99.0 diff --git a/edx_proctoring/scripts/version_check.py b/edx_proctoring/scripts/version_check.py new file mode 100755 index 00000000000..f976c6355b7 --- /dev/null +++ b/edx_proctoring/scripts/version_check.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +""" +Scripts to ensure that the Python and npm versions match. +""" +import json +import sys +from edx_proctoring import __version__ as python_version + +with open('package.json') as json_file: + data = json.load(json_file) + if data['version'] != python_version: + print("\n\n\n") + print("ERROR: Version mismatch. Please update version in edx_proctoring/__init__.py or edx_proctoring/package.json.\n") # noqa E501 line too long + sys.exit(1) + else: + print("Version check success!") diff --git a/tox.ini b/tox.ini index c13adcf5af7..416ae4abfb5 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = py36-django111-drflatest, docs, quality, + version_check, pii_check, translations @@ -16,7 +17,7 @@ deps = drflatest: djangorestframework -rrequirements/test.txt commands = - py.test -rfe --cov=edx_proctoring --cov-report=html --ds=test_settings -n 3 {posargs} + py.test -rfe --cov=edx_proctoring --cov-report=html --ds=test_settings {posargs:-n 3} [testenv:docs] setenv = @@ -48,6 +49,12 @@ commands = pylint edx_proctoring pycodestyle edx_proctoring +[testenv:version_check] +deps = + -r{toxinidir}/requirements/base.txt +commands = + {toxinidir}/edx_proctoring/scripts/version_check.py + [testenv:pii_check] whitelist_externals = make