Skip to content

Commit

Permalink
Do not run tests on code in the source directory
Browse files Browse the repository at this point in the history
We want to use the beam package installed into our tox virtualenv
  • Loading branch information
chadrik committed Nov 27, 2019
1 parent f59cda2 commit 0b3febb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 59 deletions.
41 changes: 0 additions & 41 deletions sdks/python/scripts/run_tox_cleanup.sh

This file was deleted.

37 changes: 19 additions & 18 deletions sdks/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ select = E3

# Shared environment options.
[testenv]
# Ensure that we use the beam installed into our virtual env
changedir = {envsitepackagesdir}
args_are_paths = false
# Set [] options for pip installation of apache-beam tarball.
extras = test
# Don't warn that these commands aren't installed.
Expand All @@ -48,15 +51,13 @@ commands_pre =
python --version
pip --version
pip check
{toxinidir}/scripts/run_tox_cleanup.sh
commands_post =
{toxinidir}/scripts/run_tox_cleanup.sh

commands = false {envname} is misconfigured

[testenv:py27]
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3\d?\.py$' {posargs}
nosetests --ignore-files '.*py3\d?\.py$' {posargs}

[testenv:py27-pytest]
commands =
Expand All @@ -68,7 +69,7 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3[6-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[6-9]\.py$' {posargs}

[testenv:py35-pytest]
setenv =
Expand All @@ -82,7 +83,7 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3[7-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[7-9]\.py$' {posargs}

[testenv:py36-pytest]
setenv =
Expand All @@ -96,7 +97,7 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3[8-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[8-9]\.py$' {posargs}

[testenv:py37-pytest]
setenv =
Expand All @@ -115,7 +116,7 @@ setenv =
BEAM_TESTS_USING_CYTHON=1
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3\d?\.py$' {posargs}
nosetests --ignore-files '.*py3\d?\.py$' {posargs}

[testenv:py27-cython-pytest]
# cython tests are only expected to work in linux (2.x and 3.x)
Expand All @@ -140,7 +141,7 @@ setenv =
BEAM_TESTS_USING_CYTHON=1
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3[5-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[5-9]\.py$' {posargs}

[testenv:py35-cython-pytest]
# cython tests are only expected to work in linux (2.x and 3.x)
Expand All @@ -166,7 +167,7 @@ setenv =
BEAM_TESTS_USING_CYTHON=1
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3[7-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[7-9]\.py$' {posargs}

[testenv:py36-cython-pytest]
# cython tests are only expected to work in linux (2.x and 3.x)
Expand All @@ -192,7 +193,7 @@ setenv =
BEAM_TESTS_USING_CYTHON=1
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3[8-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[8-9]\.py$' {posargs}

[testenv:py37-cython-pytest]
# cython tests are only expected to work in linux (2.x and 3.x)
Expand All @@ -211,13 +212,13 @@ commands =
extras = test,gcp
commands =
python apache_beam/examples/complete/autocomplete_test.py
python run_nose.py --ignore-files '.*py3\d?\.py$' {posargs}
nosetests --ignore-files '.*py3\d?\.py$' {posargs}
# Old and new Datastore client unit tests cannot be run in the same process
# due to conflicting protobuf modules.
# TODO(BEAM-4543): Remove these separate nosetests invocations once the
# googledatastore dependency is removed.
python run_nose.py {posargs} --tests apache_beam.io.gcp.datastore.v1
python run_nose.py {posargs} --tests apache_beam.io.gcp.datastore.v1new
nosetests {posargs} --tests apache_beam.io.gcp.datastore.v1
nosetests {posargs} --tests apache_beam.io.gcp.datastore.v1new

[testenv:py27-gcp-pytest]
extras = test,gcp
Expand All @@ -230,7 +231,7 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
extras = test,gcp
commands =
python run_nose.py --ignore-files '.*py3[6-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[6-9]\.py$' {posargs}

[testenv:py35-gcp-pytest]
setenv =
Expand All @@ -244,7 +245,7 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
extras = test,gcp
commands =
python run_nose.py --ignore-files '.*py3[7-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[7-9]\.py$' {posargs}

[testenv:py36-gcp-pytest]
setenv =
Expand All @@ -258,7 +259,7 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
extras = test,gcp
commands =
python run_nose.py --ignore-files '.*py3[8-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[8-9]\.py$' {posargs}

[testenv:py37-gcp-pytest]
setenv =
Expand Down Expand Up @@ -329,4 +330,4 @@ setenv =
RUN_SKIPPED_PY3_TESTS=0
extras = test,interactive
commands =
python run_nose.py --ignore-files '.*py3[8-9]\.py$' {posargs}
nosetests --ignore-files '.*py3[8-9]\.py$' {posargs}

0 comments on commit 0b3febb

Please sign in to comment.