Skip to content

Commit 8a2d725

Browse files
Ian Childsfacebook-github-bot
Ian Childs
authored andcommitted
Add test for $declared_deps usage
Summary: This shouldn't be allowed, will remove in the next diff Reviewed By: iguridi Differential Revision: D71477141 fbshipit-source-id: 901941070f49a9b551c29ad4ba20f744a77cf7a2
1 parent f5d2ed7 commit 8a2d725

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

tests/core/query/cquery/test_cquery.py

+8
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,11 @@ async def test_disabling_of_execution_platforms(buck: Buck) -> None:
265265
query = "deps(set(tests/...))"
266266
await buck.cquery(query)
267267
await buck.cquery(query, "-c", "build.execution_platforms=")
268+
269+
270+
@buck_test(data_dir="deps_query")
271+
async def test_declared_deps_query(buck: Buck) -> None:
272+
# TODO(ianc) This should fail
273+
await buck.cquery(
274+
"root//:declared_deps",
275+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[buildfile]
2+
name=TARGETS.fixture
3+
4+
[cells]
5+
root = .
6+
nano_prelude = nano_prelude
7+
8+
[cell_aliases]
9+
prelude = nano_prelude
10+
11+
[external_cells]
12+
nano_prelude = bundled

tests/core/query/cquery/test_cquery_data/deps_query/.buckroot

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
load(":defs.bzl", "rule_with_query")
2+
3+
rule_with_query(
4+
name = "declared_deps",
5+
query = "$declared_deps",
6+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def _rule_with_query(ctx):
2+
return [DefaultInfo()]
3+
4+
rule_with_query = rule(
5+
impl = _rule_with_query,
6+
attrs = {"query": attrs.query()},
7+
)

0 commit comments

Comments
 (0)