Skip to content

Commit

Permalink
tests: Remove deps on the prelude and ovr_config
Browse files Browse the repository at this point in the history
Summary: I didn't notice until after the previous diff that some of these tests are not actually isolated. These ones were easy to fix, and almost certainly the result of copy + paste

Reviewed By: IanChilds

Differential Revision: D63972133

fbshipit-source-id: 03a1fdb2fa63b81d0bcb3e9d77b07df9bb72eef0
  • Loading branch information
JakobDegen authored and facebook-github-bot committed Oct 7, 2024
1 parent e443eed commit 37c2413
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 85 deletions.
24 changes: 0 additions & 24 deletions tests/core/build/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ buck2_e2e_test(
name = "test_build_output_file_hashes",
srcs = ["test_build_output_file_hashes.py"],
data_dir = "test_build_output_file_hashes_data",
env = {
"OVR_CONFIG": "1",
"PRELUDE": "$(location prelude//:prelude)",
},
serialize_test_cases = False,
)

Expand Down Expand Up @@ -88,30 +84,18 @@ buck2_e2e_test(
name = "test_out_flag",
srcs = ["test_out_flag.py"],
data_dir = "test_out_flag_data",
env = {
"OVR_CONFIG": "1",
"PRELUDE": "$(location prelude//:prelude)",
},
)

buck2_e2e_test(
name = "test_nested_subtargets",
srcs = ["test_nested_subtargets.py"],
data_dir = "test_nested_subtargets_data",
env = {
"OVR_CONFIG": "1",
"PRELUDE": "$(location prelude//:prelude)",
},
)

buck2_e2e_test(
name = "test_build_report",
srcs = ["test_build_report.py"],
data_dir = "test_build_report_data",
env = {
"OVR_CONFIG": "1",
"PRELUDE": "$(location prelude//:prelude)",
},
deps = [
"//buck2/tests/e2e_util:utils",
],
Expand Down Expand Up @@ -155,10 +139,6 @@ buck2_e2e_test(
name = "test_build_response",
srcs = ["test_build_response.py"],
data_dir = "test_build_response_data",
env = {
"OVR_CONFIG": "1",
"PRELUDE": "$(location prelude//:prelude)",
},
deps = [
"//buck2/tests/e2e_util:utils",
],
Expand All @@ -168,10 +148,6 @@ buck2_e2e_test(
name = "test_build_rule_type_name_logging",
srcs = ["test_build_rule_type_name_logging.py"],
data_dir = "test_build_rule_type_name_logging_data",
env = {
"OVR_CONFIG": "1",
"PRELUDE": "$(location prelude//:prelude)",
},
deps = [
"//buck2/tests/e2e_util:utils",
],
Expand Down
14 changes: 4 additions & 10 deletions tests/core/build/test_build_output_file_hashes_data/.buckconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[buildfile]
name=TARGETS.fixture
[cells]
root = .

[repositories]
root = .
fbcode = fbcode
fbsource = fbsource
buck = buck
toolchains = toolchains
prelude = prelude
config = config
[buildfile]
name=TARGETS.fixture
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load(":defs.bzl", "export_file")

export_file(
name = "file.txt",
src = "file.txt",
Expand Down
16 changes: 16 additions & 0 deletions tests/core/build/test_build_output_file_hashes_data/defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

def _export_file_impl(ctx):
return [DefaultInfo(default_output = ctx.attrs.src)]

export_file = rule(
impl = _export_file_impl,
attrs = {
"src": attrs.source(allow_directory = True),
},
)
14 changes: 4 additions & 10 deletions tests/core/build/test_build_report_data/.buckconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[buildfile]
name=TARGETS.fixture
[cells]
root = .

[repositories]
root = .
fbcode = fbcode
fbsource = fbsource
buck = buck
toolchains = toolchains
prelude = prelude
config = config
[buildfile]
name=TARGETS.fixture
14 changes: 4 additions & 10 deletions tests/core/build/test_build_response_data/.buckconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[buildfile]
name=TARGETS.fixture
[cells]
root = .

[repositories]
root = .
fbcode = fbcode
fbsource = fbsource
buck = buck
toolchains = toolchains
prelude = prelude
config = config
[buildfile]
name=TARGETS.fixture
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[buildfile]
name=TARGETS.fixture
[cells]
root = .

[repositories]
root = .
fbcode = fbcode
fbsource = fbsource
buck = buck
toolchains = toolchains
prelude = prelude
config = config
[buildfile]
name=TARGETS.fixture
14 changes: 4 additions & 10 deletions tests/core/build/test_nested_subtargets_data/.buckconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[buildfile]
name=TARGETS.fixture
[cells]
root = .

[repositories]
root = .
fbcode = fbcode
fbsource = fbsource
buck = buck
toolchains = toolchains
prelude = prelude
config = config
[buildfile]
name=TARGETS.fixture
14 changes: 4 additions & 10 deletions tests/core/build/test_out_flag_data/.buckconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[buildfile]
name=TARGETS.fixture
[cells]
root = .

[repositories]
root = .
fbcode = fbcode
fbsource = fbsource
buck = buck
toolchains = toolchains
prelude = prelude
config = config
[buildfile]
name=TARGETS.fixture
2 changes: 1 addition & 1 deletion tests/core/build/test_out_flag_data/TARGETS.fixture
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load(":defs.bzl", "out_library")
load(":defs.bzl", "export_file", "out_library")

export_file(
name = "a.txt",
Expand Down
10 changes: 10 additions & 0 deletions tests/core/build/test_out_flag_data/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ out_library = rule(
"outs": attrs.list(attrs.dep()),
},
)

def _export_file_impl(ctx):
return [DefaultInfo(default_output = ctx.attrs.src)]

export_file = rule(
impl = _export_file_impl,
attrs = {
"src": attrs.source(allow_directory = True),
},
)

0 comments on commit 37c2413

Please sign in to comment.