Skip to content

Commit

Permalink
Drop nested_runs. Although we would like to ensure that this will wor…
Browse files Browse the repository at this point in the history
…k in future versions (via #7654) that implementation will not require nesting to validate: only concurrent runs.
  • Loading branch information
stuhood committed Jul 7, 2020
1 parent dce29dc commit b8169c1
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 90 deletions.
6 changes: 0 additions & 6 deletions testprojects/src/python/BUILD
Expand Up @@ -9,7 +9,6 @@ target(
':build_file_imports_module_directory',
':coordinated_runs_directory',
':interpreter_selection_directory',
':nested_runs_directory',
':no_build_file_directory',
':plugins_directory',
':print_env_directory',
Expand Down Expand Up @@ -44,11 +43,6 @@ files(
sources = ['interpreter_selection/**/*'],
)

files(
name = 'nested_runs_directory',
sources = ['nested_runs/**/*'],
)

files(
name = 'no_build_file_directory',
sources = ['no_build_file/**/*'],
Expand Down
6 changes: 0 additions & 6 deletions testprojects/src/python/nested_runs/BUILD

This file was deleted.

Empty file.
26 changes: 0 additions & 26 deletions testprojects/src/python/nested_runs/run_pants_with_pantsd.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/python/pants_test/bin/BUILD
Expand Up @@ -10,7 +10,6 @@ python_tests(
'src/python/pants/option',
'src/python/pants/testutil:int-test',
'testprojects:pants_plugins_directory',
'testprojects/src/python:nested_runs_directory',
],
tags = ['integration'],
timeout = 120,
Expand Down
31 changes: 0 additions & 31 deletions tests/python/pants_test/bin/test_runner_integration.py
@@ -1,7 +1,6 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

import os
from pathlib import Path

from pants.base.build_environment import get_buildroot
Expand Down Expand Up @@ -42,33 +41,3 @@ def test_warning_filter(self):
)
self.assert_success(non_warning_run)
self.assertNotIn("test warning", non_warning_run.stderr_data)

def test_parent_build_id_set_only_for_pants_runs_called_by_other_pants_runs(self):
with self.temporary_workdir() as workdir:
command = [
"run",
"testprojects/src/python/nested_runs",
"--",
workdir,
]
result = self.run_pants_with_workdir(command, workdir,)
self.assert_success(result)

run_tracker_dir = os.path.join(workdir, "run-tracker")
self.assertTrue(
os.path.isdir(run_tracker_dir), f"dir path {run_tracker_dir} does not exist!"
)
run_tracker_sub_dirs = (
os.path.join(run_tracker_dir, dir_name)
for dir_name in os.listdir(run_tracker_dir)
if dir_name != "latest"
)
for run_tracker_sub_dir in run_tracker_sub_dirs:
info_path = os.path.join(run_tracker_sub_dir, "info")
assert os.path.isfile(info_path) is True
with open(info_path, "r") as info_f:
lines = dict(line.split(": ", 1) for line in info_f.readlines())
if "goals" in lines["cmd_line"]:
self.assertIn("parent_build_id", lines)
else:
self.assertNotIn("parent_build_id", lines)
1 change: 0 additions & 1 deletion tests/python/pants_test/pantsd/BUILD
Expand Up @@ -54,7 +54,6 @@ python_tests(
'examples/src/python/example:hello_directory',
'testprojects/src/python:bad_requirements_directory',
'testprojects/src/python:coordinated_runs_directory',
'testprojects/src/python:nested_runs_directory',
'testprojects/src/python:print_env_directory',
],
tags = ['integration'],
Expand Down
19 changes: 0 additions & 19 deletions tests/python/pants_test/pantsd/test_pantsd_integration.py
Expand Up @@ -685,22 +685,3 @@ def test_unhandled_exceptions_only_log_exceptions_once(self):
"pants.bin.daemon_pants_runner._PantsRunFinishedWithFailureException: Terminated with 1",
result.stderr_data,
)

def test_inner_runs_dont_deadlock(self):
"""Create a pantsd run that calls testprojects/src/python/nested_runs with the appropriate
bootstrap options to avoid restarting pantsd.
Regression test for issue https://github.com/pantsbuild/pants/issues/7881
When a run under pantsd calls pants with pantsd inside it, the inner run will time out
waiting for the outer run to end.
NB: testprojects/src/python/nested_runs assumes that the pants.toml file is in ${workdir}/pants.toml
"""
config = {"GLOBAL": {"pantsd_timeout_when_multiple_invocations": 1}}
with self.pantsd_successful_run_context(extra_config=config) as ctx:
result = ctx.runner(
["run", "testprojects/src/python/nested_runs", "--", ctx.workdir], expected_runs=2
)
ctx.checker.assert_started()
self.assert_success(result)
self.assertNotIn("Another pants invocation is running", result.stderr_data)

0 comments on commit b8169c1

Please sign in to comment.