Skip to content

Commit

Permalink
update buck_e2e tests
Browse files Browse the repository at this point in the history
Reviewed By: mzlee

Differential Revision: D69795641

fbshipit-source-id: ae608580cd030ac9b8d81b07589b9b0b15dd12a3
  • Loading branch information
annakukliansky authored and facebook-github-bot committed Feb 19, 2025
1 parent edca638 commit f1f4054
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
16 changes: 7 additions & 9 deletions tests/buck_e2e.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def buck_e2e_test(
data = None,
data_dir = None,
srcs = None,
tags = None,
labels = None,
deps = None,
env = None,
resources = None,
Expand All @@ -39,14 +39,14 @@ def buck_e2e_test(
Custom macro for buck2/buckaemon end-to-end tests using pytest.
"""
srcs = srcs or []
tags = tags or []
labels = labels or []
deps = deps or []
cfg_modifiers = cfg_modifiers or []

for s in skip_for_os:
if s not in ["darwin", "windows"]:
fail("Skipped os must be one of darwin or windows, not {}".format(s))
tags = list(tags) + [
labels = list(labels) + [
# Running multiple bucks are expensive. This limits tpx to parallelism of 4.
"heavyweight",
]
Expand Down Expand Up @@ -77,7 +77,7 @@ def buck_e2e_test(
if serialize_test_cases:
# This lets us pass stress runs by making all test cases inside of a test file serial
# Test cases in different files can still run in parallel.
tags.append("serialize_test_cases")
labels.append("serialize_test_cases")

if data and data_dir:
fail("`data` and `data_dir` cannot be used together")
Expand Down Expand Up @@ -116,7 +116,6 @@ def buck_e2e_test(
if not "conftest.py" in resources.values():
resources["fbcode//buck2/tests/e2e_util:conftest.py"] = "conftest.py"

labels = []
if "darwin" in skip_for_os:
labels += ci.remove_labels(ci.mac(ci.aarch64(ci.opt())))
if "windows" in skip_for_os:
Expand All @@ -129,7 +128,7 @@ def buck_e2e_test(
name = name,
base_module = base_module,
srcs = srcs,
tags = tags,
labels = labels,
deps = deps,
env = env,
emails = contacts,
Expand All @@ -140,7 +139,6 @@ def buck_e2e_test(
pytest_marks = pytest_marks,
pytest_expr = pytest_expr,
pytest_confcutdir = pytest_confcutdir,
labels = labels,
metadata = metadata,
compatible_with = compatible_with,
)
Expand Down Expand Up @@ -190,7 +188,7 @@ def buck2_e2e_test(
data = None,
data_dir = None,
srcs = (),
tags = (),
labels = (),
resources = None,
pytest_config = None,
pytest_marks = None,
Expand Down Expand Up @@ -229,6 +227,7 @@ def buck2_e2e_test(
"contacts": contacts,
"data": data,
"data_dir": data_dir,
"labels": labels,
"pytest_confcutdir": pytest_confcutdir,
"pytest_config": pytest_config,
"pytest_expr": pytest_expr,
Expand All @@ -237,7 +236,6 @@ def buck2_e2e_test(
"resources": resources,
"serialize_test_cases": serialize_test_cases,
"srcs": srcs,
"tags": tags,
"use_buck_api": use_buck_api,
}

Expand Down
3 changes: 1 addition & 2 deletions tests/bxl_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def bxl_test(src, name = None, labels = None, buck_args: list[str] | None = None
name = name,
env = env,
srcs = {"fbcode//buck2/tests/e2e_util:test_bxl_template.py": "test_bxl_template.py"},
# fbcode_macros uses tags instead of labels
tags = ["bxl_test"] + (labels if labels else []),
labels = ["bxl_test"] + (labels if labels else []),
test_with_compiled_buck2 = False,
test_with_deployed_buck2 = True,
**kwargs
Expand Down
9 changes: 3 additions & 6 deletions tests/check_dependencies_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ def check_dependencies_test(
"TARGET": target,
"VERIFICATION_MODE": mode,
} | (env or {}),
# fbcode_macros uses tags instead of labels
tags = ["check_dependencies_test"],
labels = ["check_dependencies_test"],
test_with_compiled_buck2 = False,
test_with_deployed_buck2 = True,
use_buck_api = False,
Expand Down Expand Up @@ -123,8 +122,7 @@ def assert_dependencies_test(
"EXPECT_FAILURE_MSG": expect_failure_msg or "",
"TARGET": target,
},
# fbcode_macros uses tags instead of labels
tags = ["assert_dependencies_test"],
labels = ["assert_dependencies_test"],
test_with_compiled_buck2 = False,
test_with_deployed_buck2 = True,
use_buck_api = False,
Expand Down Expand Up @@ -171,8 +169,7 @@ def audit_dependents_test(
"SOURCE_TARGET": source_target,
"TARGET": target,
},
# fbcode_macros uses tags instead of labels
tags = ["audit_dependents_test"],
labels = ["audit_dependents_test"],
test_with_compiled_buck2 = False,
test_with_deployed_buck2 = True,
use_buck_api = False,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/build/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buck2_e2e_test(
buck2_e2e_test(
name = "test_worker",
srcs = ["test_worker.py"],
tags = ["long_running"],
labels = ["long_running"],
deps = [
"//buck2/tests/e2e_util:utils",
],
Expand Down

0 comments on commit f1f4054

Please sign in to comment.