Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename TestBase.request_single_product to TestBase.request_product #10678

Merged
merged 1 commit into from Aug 23, 2020

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Aug 23, 2020

Originally, we used "single" to distinguish from the batched scheduler.product_request. However, we no longer use the synchronous API outside of tests and special startup code - end users should never see scheduler.product_request.

Further, we don't care that TestBase.request_product() is only one-product-at-a-time. That's fine for tests, where we don't care about the speed of batching. We care more about readability with tests.

[ci skip-build-wheels]
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
[ci skip-rust]

def build_path(self, relpath: str) -> str:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined.

Comment on lines -84 to -85
_build_graph = None
_address_mapper = None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale.

else:
return os.path.join(relpath, "BUILD")

def create_dir(self, relpath: str) -> str:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still here, just moved lower.

self.invalidate_for(relpath)
return path

def create_workdir_dir(self, relpath: str) -> str:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. It was unused.

@@ -129,18 +102,17 @@ def invalidate_for(self, *relpaths):
files = {f for relpath in relpaths for f in recursive_dirname(relpath)}
return self._scheduler.invalidate_files(files)

def create_link(self, relsrc: str, reldst: str) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. Unused.

@@ -168,29 +140,18 @@ def create_files(self, path: str, files: Iterable[str]) -> None:
for f in files:
self.create_file(os.path.join(path, f), contents=f)

def create_workdir_file(self, relpath: str, contents: str = "", mode: str = "w") -> str:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. Unused.

}

self._build_configuration = self.build_config()

def buildroot_files(self, relpath: Optional[str] = None) -> Set[str]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. Unused.

return cast(SchedulerSession, self._scheduler)

def post_scheduler_init(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. Unused.

@@ -396,17 +319,6 @@ def assertDoesNotRaise(self, exc_class: Type[BaseException] = Exception):
except exc_class as e:
raise AssertionError(f"section should not have raised, but did: {e}") from e

@staticmethod
def get_bootstrap_options(cli_options=()):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined to the one call site we had.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling b38c4a1 on Eric-Arellano:request-product into 8fcd228 on pantsbuild:master.

@Eric-Arellano Eric-Arellano merged commit e9b50bb into pantsbuild:master Aug 23, 2020
@Eric-Arellano Eric-Arellano deleted the request-product branch August 23, 2020 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants