Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore: only run 2.7 tests for GAE #3116

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

Merged
merged 5 commits into from
Mar 27, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 .kokoro/python2.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ action {
# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py2"
value: "gae"
}
36 changes: 5 additions & 31 deletions 36 noxfile-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,28 +139,9 @@ def _setup_appengine_sdk(session):
"appengine/standard/"
)
]
PY3_ONLY_SAMPLES = [
sample
for sample in ALL_TESTED_SAMPLES
if (
str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith(
"appengine/standard_python37"
)
or str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith(
"appengine/flexible/django_cloudsql"
)
or str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith("functions/")
or str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith(
"bigquery/pandas-gbq-migration"
)
or str(Path(sample).absolute().relative_to(REPO_ROOT)).startswith(
"run/"
)
)
]
NON_GAE_STANDARD_SAMPLES_PY2 = sorted(
list((set(ALL_TESTED_SAMPLES) - set(GAE_STANDARD_SAMPLES)) - set(PY3_ONLY_SAMPLES))
)

PY2_ONLY_SAMPLES = GAE_STANDARD_SAMPLES

NON_GAE_STANDARD_SAMPLES_PY3 = sorted(
list(set(ALL_TESTED_SAMPLES) - set(GAE_STANDARD_SAMPLES))
)
Expand Down Expand Up @@ -189,7 +170,7 @@ def _session_tests(session, sample, post_install=None):


@nox.session(python="2.7")
@nox.parametrize("sample", GAE_STANDARD_SAMPLES)
@nox.parametrize("sample", PY2_ONLY_SAMPLES)
def gae(session, sample):
"""Runs py.test for an App Engine standard sample."""

Expand All @@ -199,14 +180,7 @@ def gae(session, sample):
os.mkdir(os.path.join(sample, "lib"))

_session_tests(session, sample, _setup_appengine_sdk)


@nox.session(python="2.7")
@nox.parametrize("sample", NON_GAE_STANDARD_SAMPLES_PY2)
def py2(session, sample):
"""Runs py.test for a sample using Python 2.7"""
_session_tests(session, sample)



@nox.session(python=["3.6", "3.7"])
@nox.parametrize("sample", NON_GAE_STANDARD_SAMPLES_PY3)
Expand Down
34 changes: 4 additions & 30 deletions 34 noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,11 @@ def _setup_appengine_sdk(session):
for sample in ALL_TESTED_SAMPLES
if sample.startswith("./appengine/standard/")
]
PY2_ONLY_SAMPLES = GAE_STANDARD_SAMPLES
PY3_ONLY_SAMPLES = [
sample
for sample in ALL_TESTED_SAMPLES
if (
sample.startswith("./appengine/standard_python37")
or sample.startswith("./functions/")
or sample.startswith("./bigquery/pandas-gbq-migration")
or sample.startswith("./run/system-package")
or sample.startswith("./run/hello-broken")
)
]
NON_GAE_STANDARD_SAMPLES_PY2 = sorted(
list((set(ALL_TESTED_SAMPLES) - set(GAE_STANDARD_SAMPLES)) - set(PY3_ONLY_SAMPLES))
)

NON_GAE_STANDARD_SAMPLES_PY3 = sorted(
list(set(ALL_TESTED_SAMPLES) - set(PY2_ONLY_SAMPLES))
list(set(ALL_TESTED_SAMPLES) - set(GAE_STANDARD_SAMPLES))
)


# Filter sample directories if on a CI like Travis or Circle to only run tests
# for changed samples.
CHANGED_FILES = _get_changed_files()
Expand All @@ -196,13 +181,9 @@ def _setup_appengine_sdk(session):
ALL_TESTED_SAMPLES = _filter_samples(ALL_TESTED_SAMPLES, CHANGED_FILES)
ALL_SAMPLE_DIRECTORIES = _filter_samples(ALL_SAMPLE_DIRECTORIES, CHANGED_FILES)
GAE_STANDARD_SAMPLES = _filter_samples(GAE_STANDARD_SAMPLES, CHANGED_FILES)
NON_GAE_STANDARD_SAMPLES_PY2 = _filter_samples(
NON_GAE_STANDARD_SAMPLES_PY2, CHANGED_FILES
NON_GAE_STANDARD_SAMPLES_PY3 = _filter_samples(
NON_GAE_STANDARD_SAMPLES_PY3, CHANGED_FILES
)
NON_GAE_STANDARD_SAMPLES_PY3 = _filter_samples(
NON_GAE_STANDARD_SAMPLES_PY3, CHANGED_FILES
)


def _session_tests(session, sample, post_install=None):
"""Runs py.test for a particular sample."""
Expand Down Expand Up @@ -239,13 +220,6 @@ def gae(session, sample):
_session_tests(session, sample, _setup_appengine_sdk)


@nox.session(python="2.7")
@nox.parametrize("sample", NON_GAE_STANDARD_SAMPLES_PY2)
def py27(session, sample):
"""Runs py.test for a sample using Python 2.7"""
_session_tests(session, sample)


@nox.session(python="3.6")
@nox.parametrize("sample", NON_GAE_STANDARD_SAMPLES_PY3)
def py36(session, sample):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.