Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [WIP] The first stage of nox implementation #468

Merged
merged 5 commits into from Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.