Skip to content

Commit 96f2223

Browse files
mf2199c24t
authored andcommitted
feat: [WIP] The first stage of nox implementation (#468)
1 parent 47154d1 commit 96f2223

File tree

5 files changed

+58
-64
lines changed

5 files changed

+58
-64
lines changed

.gitignore

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
*.egg-info
21
*.py[co]
3-
build/
42
*.sw[op]
5-
.tox/
3+
4+
# Packages
5+
*.egg-info
6+
build
67
MANIFEST
7-
dist/
8+
dist
89
django_tests
10+
11+
# Unit test / coverage reports
12+
.coverage
13+
.nox
14+
15+
# JetBrains
16+
.idea

.kokoro/build.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
2929
# Setup project id.
3030
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3131

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

36-
python3.6 -m tox
37-
python3.6 -m isort --recursive --check-only --diff
38-
python3.6 -m flake8
35+
# Install nox
36+
python3.6 -m pip install --upgrade --quiet nox
37+
python3.6 -m nox --version
38+
39+
# If NOX_SESSION is set, it only runs the specified session,
40+
# otherwise run all the sessions.
41+
if [[ -n "${NOX_SESSION:-}" ]]; then
42+
python3.6 -m nox -s "${NOX_SESSION:-}"
43+
else
44+
python3.6 -m nox
45+
fi
3946

4047
# Export essential environment variables for Django tests.
4148
export RUNNING_SPANNER_BACKEND_TESTS=1

noxfile.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Use of this source code is governed by a BSD-style
6+
# license that can be found in the LICENSE file or at
7+
# https://developers.google.com/open-source/licenses/bsd
8+
9+
10+
from __future__ import absolute_import
11+
12+
import nox
13+
import os
14+
15+
16+
def default(session):
17+
# Install all test dependencies, then install this package in-place.
18+
session.install("mock", "pytest", "pytest-cov")
19+
session.install("-e", ".")
20+
21+
# Run py.test against the unit tests.
22+
session.run(
23+
"py.test",
24+
"--quiet",
25+
os.path.join("tests", "spanner_dbapi"),
26+
*session.posargs,
27+
)
28+
29+
30+
@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
31+
def unit(session):
32+
"""Run the unit test suite."""
33+
default(session)

runtests.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

tox.ini

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)