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

Remove JVM testprojects #10216

Merged

Conversation

Eric-Arellano
Copy link
Contributor

[ci skip-rust-tests]

# Rust tests will be skipped. Delete if not intended.
[ci skip-rust-tests]
@@ -1,37 +0,0 @@
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stuhood @benjyw I'd appreciate a double check that it's fine to delete this IT, as we already test it through unit tests.

Cycles:

def do_test_cycle(self, address_str: str, cyclic_address_str: str) -> None:
scheduler = self.create_json()
parsed_address = Address.parse(address_str)
self.do_test_trace_message(
scheduler,
parsed_address,
f"(?ms)Dependency graph contained a cycle:.*{cyclic_address_str}.* <-.*{cyclic_address_str}.* <-",
)
def test_cycle_self(self) -> None:
self.do_test_cycle("graph_test:self_cycle", "graph_test:self_cycle")
def test_cycle_direct(self) -> None:
self.do_test_cycle("graph_test:direct_cycle", "graph_test:direct_cycle")
def test_cycle_indirect(self) -> None:
self.do_test_cycle("graph_test:indirect_cycle", "graph_test:one")

Imports:

def test_illegal_import(self) -> None:
prelude = dedent(
"""\
import os
def make_target():
python_library()
"""
).encode()
address_mapper = unittest.mock.Mock()
address_mapper.prelude_glob_patterns = ("prelude",)
with self.assertRaisesRegex(
Exception, "Import used in /dev/null/prelude at line 1\\. Import statements are banned"
):
run_rule(
evaluate_preludes,
rule_args=[address_mapper,],
mock_gets=[
MockGet(
product_type=Snapshot,
subject_type=PathGlobs,
mock=lambda _: Snapshot(Digest("abc", 10), ("/dev/null/prelude",), ()),
),
MockGet(
product_type=FilesContent,
subject_type=Digest,
mock=lambda _: FilesContent(
[FileContent(path="/dev/null/prelude", content=prelude)]
),
),
],
)

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Not being sure about this was one of the reasons I left all this alone last week, so I'll defer to @stuhood , who already has cycles and such on the mind.

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

But yeah, this seems fine to me!

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Yea, the other tests are much better. Thanks!

@Eric-Arellano Eric-Arellano merged commit 55aa86d into pantsbuild:master Jun 30, 2020
@Eric-Arellano Eric-Arellano deleted the remove-jvm-testprojects branch June 30, 2020 19:36
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