Created
October 31, 2017 19:53
-
-
Save WillianFuks/6d7a76c84da343db9ea6c504acb377f7 to your computer and use it in GitHub Desktop.
Example Nox file for system testing
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
import os | |
def session_system_gae(session): | |
"""Runs integration tests. As this runs a real query against BigQuery, | |
the environemnt must have ``GOOGLE_APPLICATION_CREDENTIALS`` set pointing | |
to ``/key.json`` where the secrets service json must be located. | |
""" | |
session.interpreter = 'python2.7' | |
session.virtualenv_dirname = 'system-gae' | |
session.install('-r', 'gae/exporter/requirements.txt') | |
session.install('--upgrade', 'google-cloud-bigquery') | |
session.install('pytest', 'pytest-cov', 'mock') | |
if not os.path.isfile: | |
raise RuntimeError("File /key.json not found. Please make sure " | |
"to create this file with the service credentials " | |
"in order to run the integration tests") | |
session.env = {'PYTHONPATH': ':./', | |
'GOOGLE_APPLICATION_CREDENTIALS': '/key.json'} | |
session.run( | |
'py.test', | |
'tests/system/gae/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment