Skip to content

Commit

Permalink
Move V2 rules tests from tests to src (pantsbuild#8667)
Browse files Browse the repository at this point in the history
Currently, some of these tests live in `src` and some in `tests`. They should all live together in `src`.

This also renames the files to use the convention `foo_test.py` and `foo_integration_test.py`, along with changing the BUILD entries to be less granular.
  • Loading branch information
Eric-Arellano authored Nov 20, 2019
1 parent 038b793 commit c25ed38
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 140 deletions.
39 changes: 39 additions & 0 deletions src/python/pants/backend/python/rules/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_library(
dependencies=[
'3rdparty/python:dataclasses',
Expand All @@ -12,3 +15,39 @@ python_library(
'src/python/pants/source:source',
],
)

python_tests(
name='tests',
sources=globs('*_test.py', exclude=[globs('*_integration_test.py')]),
dependencies=[
':rules',
'src/python/pants/backend/python/subsystems',
'src/python/pants/build_graph',
'src/python/pants/engine:fs',
'src/python/pants/engine:isolated_process',
'src/python/pants/engine:rules',
'src/python/pants/engine:selectors',
'src/python/pants/engine/legacy:graph',
'src/python/pants/engine/legacy:structs',
'src/python/pants/rules/core',
'src/python/pants/testutil:test_base',
'src/python/pants/testutil/engine:util',
'src/python/pants/testutil/subsystem',
'src/python/pants/util:collections',
'src/python/pants/util:contextutil',
],
)


python_tests(
name='integration',
sources=globs('*_integration_test.py'),
dependencies=[
'src/python/pants/testutil:int-test',
'examples/src/python/example:hello_directory',
'testprojects/src/python:unicode_directory',
'testprojects/tests/python/pants:dummies_directory',
],
tags = {'integration'},
timeout = 180,
)
19 changes: 19 additions & 0 deletions src/python/pants/rules/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,31 @@ python_library(

python_tests(
name = "tests",
sources=globs('*_test.py', exclude=[globs('*_integration_test.py')]),
dependencies = [
':core',
'src/python/pants/backend/codegen/thrift/java',
'src/python/pants/backend/jvm/targets:all',
'src/python/pants/backend/python/targets',
'src/python/pants/build_graph',
'src/python/pants/engine/legacy:graph',
'src/python/pants/engine/legacy:structs',
'src/python/pants/testutil:test_base',
'src/python/pants/testutil:console_rule_test_base',
'src/python/pants/testutil/engine:util',
'src/python/pants/testutil/subsystem',
]
)

python_tests(
name='integration',
sources=globs('*_integration_test.py'),
dependencies=[
'src/python/pants/testutil:int-test',
'examples/src/java/org/pantsbuild/example:hello_directory',
'examples/src/scala/org/pantsbuild/example:hello_directory',
'examples/src/resources/org/pantsbuild/example:hello_directory',
'testprojects/tests/java/org/pantsbuild/testproject:dummies_directory',
],
tags = {'integration'},
)
File renamed without changes.
File renamed without changes.
74 changes: 0 additions & 74 deletions tests/python/pants_test/backend/python/rules/BUILD

This file was deleted.

66 changes: 0 additions & 66 deletions tests/python/pants_test/rules/BUILD

This file was deleted.

0 comments on commit c25ed38

Please sign in to comment.