Skip to content

Commit

Permalink
use run_interactive_process
Browse files Browse the repository at this point in the history
  • Loading branch information
lilatomic committed Aug 29, 2024
1 parent 9b2ab1c commit 6b1f68d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/python/pants/core/goals/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def export(
build_root, environment, output_dir, flattened_results
)
iprs = await MultiGet(
Effect(InteractiveProcessResult, InteractiveProcess, link_requests) for link_requests in link_requests
run_interactive_process(link_request) for link_request in link_requests
)

errors_linking_bins = [
Expand Down
8 changes: 4 additions & 4 deletions src/python/pants/core/goals/export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ def do_mock_export(req: ExportRequest):
rule_runner.do_not_use_mock(Digest, (AddPrefix,)),
rule_runner.do_not_use_mock(EnvironmentVars, (EnvironmentVarsRequest,)),
rule_runner.do_not_use_mock(KnownUserResolveNames, (KnownUserResolveNamesRequest,)),
MockEffect(
MockGet(
output_type=InteractiveProcessResult,
input_types=(InteractiveProcess,),
mock=lambda ip: _mock_run(rule_runner, ip),
),
)
],
union_membership=union_membership,
)
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_run_export_rule_resolve(monkeypatch) -> None:
assert fp.read() == b"BAR"


def test_run_export_rule_binary() -> None:
def test_run_export_rule_binary(monkeypatch) -> None:
rule_runner = RuleRunner(
rules=[
UnionRule(ExportRequest, MockExportRequest),
Expand All @@ -205,7 +205,7 @@ def test_run_export_rule_binary() -> None:
],
target_types=[MockTarget],
)
exit_code, stdout = run_export_rule(rule_runner, binaries=["mybin"])
exit_code, stdout = run_export_rule(rule_runner, monkeypatch, binaries=["mybin"])
assert exit_code == 0
assert "Wrote mock export for mybin to dist/export/mock" in stdout
for filename in ["mybin"]:
Expand Down

0 comments on commit 6b1f68d

Please sign in to comment.