Skip to content

Commit

Permalink
feat: [WIP] The first stage of nox implementation (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
mf2199 authored and c24t committed Sep 15, 2020
1 parent 47154d1 commit 96f2223
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 64 deletions.
16 changes: 12 additions & 4 deletions .gitignore
@@ -1,8 +1,16 @@
*.egg-info
*.py[co]
build/
*.sw[op]
.tox/

# Packages
*.egg-info
build
MANIFEST
dist/
dist
django_tests

# Unit test / coverage reports
.coverage
.nox

# JetBrains
.idea
19 changes: 13 additions & 6 deletions .kokoro/build.sh
Expand Up @@ -29,13 +29,20 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
# Setup project id.
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Install tox
python3.6 -m pip install --upgrade --quiet tox flake8 isort
python3.6 -m tox --version
# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation

python3.6 -m tox
python3.6 -m isort --recursive --check-only --diff
python3.6 -m flake8
# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
else
python3.6 -m nox
fi

# Export essential environment variables for Django tests.
export RUNNING_SPANNER_BACKEND_TESTS=1
Expand Down
33 changes: 33 additions & 0 deletions noxfile.py
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd


from __future__ import absolute_import

import nox
import os


def default(session):
# Install all test dependencies, then install this package in-place.
session.install("mock", "pytest", "pytest-cov")
session.install("-e", ".")

# Run py.test against the unit tests.
session.run(
"py.test",
"--quiet",
os.path.join("tests", "spanner_dbapi"),
*session.posargs,
)


@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
def unit(session):
"""Run the unit test suite."""
default(session)
30 changes: 0 additions & 30 deletions runtests.py

This file was deleted.

24 changes: 0 additions & 24 deletions tox.ini

This file was deleted.

0 comments on commit 96f2223

Please sign in to comment.