Skip to content

Commit e443eed

Browse files
JakobDegenfacebook-github-bot
authored andcommitted
tests: Move more of tests/build into core
Summary: ``` for p in tests/e2e/build/test_*.py rg 'inplace=True' $p && continue sl mv $p tests/core/build/ set part (string sub -e -3 $p) sl mv "$part"_data tests/core/build end sl st -m -a -n | xargs sed -i -E 's|inplace=False,||' sl st -m -a -n | xargs sed -i -E 's|inplace=False||' arc f ``` And then split the targets file I discovered after originally writing this diff that some of these tests are !inplace but actually depend on ovr_config and the prelude. Most of those were pretty straightforward to fix, but `test_build_isolated` is not and so was left out of this change Reviewed By: IanChilds Differential Revision: D63972135 fbshipit-source-id: 2ae7b84b935344a687740f64a599c6328d41a905
1 parent fb937af commit e443eed

File tree

288 files changed

+310
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+310
-327
lines changed

tests/core/build/BUCK

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
load("@fbcode//buck2/tests:buck_e2e.bzl", "buck2_e2e_test")
2+
3+
oncall("build_infra")
4+
5+
buck2_e2e_test(
6+
name = "test_build_output_file_hashes",
7+
srcs = ["test_build_output_file_hashes.py"],
8+
data_dir = "test_build_output_file_hashes_data",
9+
env = {
10+
"OVR_CONFIG": "1",
11+
"PRELUDE": "$(location prelude//:prelude)",
12+
},
13+
serialize_test_cases = False,
14+
)
15+
16+
buck2_e2e_test(
17+
name = "test_build_skip_incompatible_targets",
18+
srcs = ["test_build_skip_incompatible_targets.py"],
19+
data_dir = "test_build_skip_incompatible_targets_data",
20+
)
21+
22+
buck2_e2e_test(
23+
name = "test_build_root_executable",
24+
srcs = ["test_build_root_executable.py"],
25+
data_dir = "test_build_root_executable_data",
26+
serialize_test_cases = False,
27+
)
28+
29+
buck2_e2e_test(
30+
name = "test_plugins",
31+
srcs = ["test_plugins.py"],
32+
data_dir = "test_plugins_data",
33+
serialize_test_cases = False,
34+
)
35+
36+
buck2_e2e_test(
37+
name = "test_uncategorized",
38+
srcs = ["test_uncategorized.py"],
39+
data_dir = "test_uncategorized_data",
40+
env = {
41+
"RECLI": "$(location fbsource//xplat/remote_execution/dotslash:recli)",
42+
},
43+
serialize_test_cases = False,
44+
deps = [
45+
"fbcode//buck2/tests/e2e_util:utils",
46+
],
47+
)
48+
49+
buck2_e2e_test(
50+
name = "test_hash_all_commands",
51+
srcs = ["test_hash_all_commands.py"],
52+
data_dir = "test_hash_all_commands_data",
53+
# These tests heavily depend on watchman, which is flakey on non-Linux systems
54+
skip_for_os = [
55+
"darwin",
56+
"windows",
57+
],
58+
deps = [
59+
"fbcode//buck2/tests/e2e_util:utils",
60+
],
61+
)
62+
63+
buck2_e2e_test(
64+
name = "test_dep_files",
65+
srcs = ["test_dep_files.py"],
66+
data_dir = "test_dep_files_data",
67+
deps = [
68+
"fbcode//buck2/tests/e2e_util:utils",
69+
],
70+
)
71+
72+
buck2_e2e_test(
73+
name = "test_target_aliases",
74+
srcs = ["test_target_aliases.py"],
75+
data_dir = "test_target_aliases_data",
76+
)
77+
78+
buck2_e2e_test(
79+
name = "test_symlinks",
80+
srcs = ["test_symlinks.py"],
81+
data_dir = "test_symlinks_data",
82+
deps = [
83+
"fbcode//buck2/tests/e2e_util:utils",
84+
],
85+
)
86+
87+
buck2_e2e_test(
88+
name = "test_out_flag",
89+
srcs = ["test_out_flag.py"],
90+
data_dir = "test_out_flag_data",
91+
env = {
92+
"OVR_CONFIG": "1",
93+
"PRELUDE": "$(location prelude//:prelude)",
94+
},
95+
)
96+
97+
buck2_e2e_test(
98+
name = "test_nested_subtargets",
99+
srcs = ["test_nested_subtargets.py"],
100+
data_dir = "test_nested_subtargets_data",
101+
env = {
102+
"OVR_CONFIG": "1",
103+
"PRELUDE": "$(location prelude//:prelude)",
104+
},
105+
)
106+
107+
buck2_e2e_test(
108+
name = "test_build_report",
109+
srcs = ["test_build_report.py"],
110+
data_dir = "test_build_report_data",
111+
env = {
112+
"OVR_CONFIG": "1",
113+
"PRELUDE": "$(location prelude//:prelude)",
114+
},
115+
deps = [
116+
"//buck2/tests/e2e_util:utils",
117+
],
118+
)
119+
120+
buck2_e2e_test(
121+
name = "test_build_report_errors",
122+
srcs = ["test_build_report_errors.py"],
123+
data_dir = "test_build_report_errors_data",
124+
deps = [
125+
"fbcode//buck2/tests/e2e_util:golden",
126+
],
127+
)
128+
129+
buck2_e2e_test(
130+
name = "test_build_id_env_var",
131+
srcs = ["test_build_id_env_var.py"],
132+
data_dir = "test_build_id_env_var_data",
133+
deps = [
134+
"//buck2/tests/e2e_util:utils",
135+
],
136+
)
137+
138+
buck2_e2e_test(
139+
name = "test_cancellation",
140+
srcs = ["test_cancellation.py"],
141+
data_dir = "test_cancellation_data",
142+
skip_for_os = ["windows"],
143+
)
144+
145+
buck2_e2e_test(
146+
name = "test_critical_path",
147+
srcs = ["test_critical_path.py"],
148+
data_dir = "test_critical_path_data",
149+
deps = [
150+
"//buck2/tests/e2e_util:utils",
151+
],
152+
)
153+
154+
buck2_e2e_test(
155+
name = "test_build_response",
156+
srcs = ["test_build_response.py"],
157+
data_dir = "test_build_response_data",
158+
env = {
159+
"OVR_CONFIG": "1",
160+
"PRELUDE": "$(location prelude//:prelude)",
161+
},
162+
deps = [
163+
"//buck2/tests/e2e_util:utils",
164+
],
165+
)
166+
167+
buck2_e2e_test(
168+
name = "test_build_rule_type_name_logging",
169+
srcs = ["test_build_rule_type_name_logging.py"],
170+
data_dir = "test_build_rule_type_name_logging_data",
171+
env = {
172+
"OVR_CONFIG": "1",
173+
"PRELUDE": "$(location prelude//:prelude)",
174+
},
175+
deps = [
176+
"//buck2/tests/e2e_util:utils",
177+
],
178+
)
179+
180+
buck2_e2e_test(
181+
name = "test_executor_with_dependencies",
182+
srcs = ["test_executor_with_dependencies.py"],
183+
data_dir = "test_executor_with_dependencies_data",
184+
deps = [
185+
"//buck2/tests/e2e_util:utils",
186+
],
187+
)
188+
189+
buck2_e2e_test(
190+
name = "test_action_error_handler_types",
191+
srcs = ["test_action_error_handler_types.py"],
192+
data_dir = "test_action_error_handler_types_data",
193+
deps = [
194+
"//buck2/tests/e2e_util:utils",
195+
],
196+
)
197+
198+
buck2_e2e_test(
199+
name = "test_build_system_info",
200+
srcs = ["test_build_system_info.py"],
201+
data_dir = "test_build_system_info_data",
202+
deps = [
203+
"//buck2/tests/e2e_util:utils",
204+
],
205+
)
206+
207+
buck2_e2e_test(
208+
name = "test_remote_execution",
209+
srcs = ["test_remote_execution.py"],
210+
data_dir = "test_remote_execution_data",
211+
deps = [
212+
"//buck2/tests/e2e_util:utils",
213+
],
214+
)

tests/e2e/build/test_action_error_handler_types.py renamed to tests/core/build/test_action_error_handler_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from buck2.tests.e2e_util.buck_workspace import buck_test
1313

1414

15-
@buck_test(inplace=False)
15+
@buck_test()
1616
async def test_action_error_handler_types(buck: Buck) -> None:
1717
await buck.bxl(
1818
"//:test_action_error_handler_types.bxl:test_action_error_handler_types"

tests/e2e/build/test_build_id_env_var.py renamed to tests/core/build/test_build_id_env_var.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from buck2.tests.e2e_util.helper.utils import random_string
1414

1515

16-
@buck_test(inplace=False)
16+
@buck_test()
1717
async def test_build_id_env_var_is_set_locally(buck: Buck) -> None:
1818
result = await buck.build(
1919
"root//:top",
@@ -29,7 +29,7 @@ async def test_build_id_env_var_is_set_locally(buck: Buck) -> None:
2929
assert f.read().strip() == result.buck_build_id
3030

3131

32-
@buck_test(inplace=False)
32+
@buck_test()
3333
async def test_build_id_env_var_is_set_remotely(buck: Buck) -> None:
3434
result = await buck.build(
3535
"root//:top",

0 commit comments

Comments
 (0)