bored-art-40741
09/29/2021, 11:43 PMbored-art-40741
09/29/2021, 11:45 PMfast-nail-55400
09/29/2021, 11:52 PMfast-nail-55400
09/29/2021, 11:52 PMfast-nail-55400
09/29/2021, 11:53 PMbored-art-40741
09/29/2021, 11:53 PMbored-art-40741
09/29/2021, 11:54 PMbored-art-40741
09/29/2021, 11:54 PMwitty-crayon-22786
09/29/2021, 11:54 PMbored-art-40741
09/29/2021, 11:54 PMbored-art-40741
09/29/2021, 11:54 PMwitty-crayon-22786
09/29/2021, 11:54 PMbored-art-40741
09/29/2021, 11:55 PMwitty-crayon-22786
09/29/2021, 11:56 PMbored-art-40741
09/29/2021, 11:57 PMbored-art-40741
09/30/2021, 12:12 AMbored-art-40741
09/30/2021, 12:12 AMfast-nail-55400
09/30/2021, 12:14 AMbored-art-40741
09/30/2021, 12:15 AMwitty-crayon-22786
09/30/2021, 12:18 AMwitty-crayon-22786
09/30/2021, 12:19 AMbored-art-40741
09/30/2021, 12:24 AMbored-art-40741
09/30/2021, 12:25 AMbored-art-40741
09/30/2021, 12:26 AMbored-art-40741
09/30/2021, 12:29 AM_DependencyMappingRequest.expanded_targets = False
bored-art-40741
09/30/2021, 12:32 AMbored-art-40741
09/30/2021, 12:38 AMbored-art-40741
09/30/2021, 12:39 AME ValueError: Encountered 7 rule graph errors:
E No installed rules return the type FirstPartyJavaTargetsMappingMarker, and it was not provided by potential callers of @rule(pants.backend.java.dependency_inference.package_mapper:79:map_first_party_java_targets_to_symbols(FirstPartyJavaTargetsMappingMarker) -> FirstPartyJavaMappingImpl, gets=[Get(Targets, AddressSpecs), Get(SourceFiles, SourceFilesRequest), Get(JavaSourceDependencyAnalysis, SourceFiles)]).
E If that type should be computed by a rule, ensure that that rule is installed.
which I feel like someone else recently encounteredbored-art-40741
09/30/2021, 12:44 AMbored-art-40741
09/30/2021, 12:51 AMFirstPartyPythonTargetsMappingMarker
is never mentioned outside the module where it's defined, and that's what I based the Java dep inference onbored-art-40741
09/30/2021, 1:02 AMQueryRule(FirstPartyJavaTargetsMappingMarker, ()),
didn't do the trick, and that more or less exhausts my ability to debug union rule errorsbored-art-40741
09/30/2021, 1:08 AMdiff --git a/src/python/pants/backend/java/compile/javac_test.py b/src/python/pants/backend/java/compile/javac_test.py
index 4e929be6d..f3de375b0 100644
--- a/src/python/pants/backend/java/compile/javac_test.py
+++ b/src/python/pants/backend/java/compile/javac_test.py
@@ -16,6 +16,10 @@ from pants.backend.java.compile.javac import (
JavacCheckRequest,
)
from pants.backend.java.compile.javac import rules as javac_rules
+from pants.backend.java.dependency_inference.package_mapper import (
+ FirstPartyJavaTargetsMappingMarker,
+)
+from pants.backend.java.dependency_inference.rules import rules as dep_inference_rules
from pants.backend.java.target_types import JavaSourcesGeneratorTarget
from pants.backend.java.target_types import rules as target_types_rules
from pants.build_graph.address import Address
@@ -54,11 +58,14 @@ def rule_runner() -> RuleRunner:
*util_rules(),
*target_types_rules(),
*coursier_rules(),
+ *dep_inference_rules(),
witty-crayon-22786
09/30/2021, 1:57 AMwitty-crayon-22786
09/30/2021, 1:57 AMbored-art-40741
09/30/2021, 1:58 AMwitty-crayon-22786
09/30/2021, 1:59 AMwitty-crayon-22786
09/30/2021, 2:05 AMwitty-crayon-22786
09/30/2021, 2:05 AMbored-art-40741
09/30/2021, 2:11 AMbored-art-40741
09/30/2021, 2:11 AMbored-art-40741
09/30/2021, 2:11 AMcommit 5ff76bf86e891081b388151f09af6752219e5bd0 (HEAD -> main, upstream/main)
Author: Stu Hood <stuhood@gmail.com>
Date: Wed Sep 29 15:09:39 2021 -0700
[internal] Record metadata on engine-aware params (#13040)
bored-art-40741
09/30/2021, 2:12 AM$ git diff -- src/python/pants/jvm/testutil.py
diff --git a/src/python/pants/jvm/testutil.py b/src/python/pants/jvm/testutil.py
index aab60bf62..3cb4bd69e 100644
--- a/src/python/pants/jvm/testutil.py
+++ b/src/python/pants/jvm/testutil.py
@@ -1,12 +1,9 @@
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
-import os
-
-import pytest
-
def maybe_skip_jdk_test(func):
- return pytest.mark.skipif("PANTS_RUN_JDK_TESTS" not in os.environ, reason="Skip JDK tests")(
- func
- )
+ return func
+ # return pytest.mark.skipif("PANTS_RUN_JDK_TESTS" not in os.environ, reason="Skip JDK tests")(
+ # func
+ # )
witty-crayon-22786
09/30/2021, 2:14 AM--extra-env-vars='PANTS_RUN_JDK_TESTS=1'
)bored-art-40741
09/30/2021, 2:14 AMwitty-crayon-22786
09/30/2021, 2:14 AMwitty-crayon-22786
09/30/2021, 2:14 AMtest --extra-env-vars=…
bored-art-40741
09/30/2021, 2:19 AMwitty-crayon-22786
09/30/2021, 2:32 AMbored-art-40741
09/30/2021, 2:33 AMbored-art-40741
09/30/2021, 2:33 AM___________________ test_vintage_and_jupiter_simple_success ____________________
rule_runner = RuleRunner(build_root=/tmp/RuleRunner.lndredeu/BUILD_ROOT)
@maybe_skip_jdk_test
def test_vintage_and_jupiter_simple_success(rule_runner: RuleRunner) -> None:
combined_lockfile = CoursierResolvedLockfile(
entries=(*JUNIT4_RESOLVED_LOCKFILE.entries, *JUNIT5_RESOLVED_LOCKFILE.entries)
)
rule_runner.write_files(
{
"coursier_resolve.lockfile": combined_lockfile.to_json().decode("utf-8"),
"BUILD": dedent(
"""\
jvm_artifact(
name='junit_junit',
group='junit',
artifact='junit',
version='4.13.2',
)
jvm_artifact(
name='org.junit.jupiter_junit-jupiter-api',
group='org.junit.jupiter',
artifact='junit-jupiter-api',
version='5.7.2',
)
coursier_lockfile(
name = 'lockfile',
requirements = [
':junit_junit',
':org.junit.jupiter_junit-jupiter-api',
],
sources = [
"coursier_resolve.lockfile",
],
)
junit_tests(
name='example-test',
dependencies= [':lockfile'],
)
"""
),
"JupiterTest.java": dedent(
"""
package org.pantsbuild.example;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class JupiterTest {
@Test
void testHello(){
assertEquals("Hello!", "Hello!");
}
}
"""
),
"VintageTest.java": dedent(
"""
package org.pantsbuild.example;
import junit.framework.TestCase;
public class VintageTest extends TestCase {
public void testGoodbye(){
assertTrue("Hello!" == "Hello!");
}
}
"""
),
}
)
test_result = run_junit_test(rule_runner, "example-test", "JupiterTest.java")
assert test_result.exit_code == 0
# TODO: Once support for parsing junit.xml is implemented, use that to determine status so we can remove the
# hack to use ASCII test output in the `run_junit_test` rule.
> assert re.search(r"Finished:\s+testHello", test_result.stdout) is not None
E AssertionError: assert None is not None
E + where None = <function search at 0x7f7ccf9140d0>('Finished:\\s+testHello', '\nThanks for using JUnit! Support its development at <https://junit.org/sponsoring>\n\nTest execution started. Number o... ]\n[ 0 tests aborted ]\n[ 0 tests successful ]\n[ 0 tests failed ]\n\n')
E + where <function search at 0x7f7ccf9140d0> = re.search
E + and '\nThanks for using JUnit! Support its development at <https://junit.org/sponsoring>\n\nTest execution started. Number o... ]\n[ 0 tests aborted ]\n[ 0 tests successful ]\n[ 0 tests failed ]\n\n' = TestResult(exit_code=0, stdout='\nThanks for using JUnit! Support its development at <https://junit.org/sponsoring>\n\nT...st.java.example-test/TEST-junit-jupiter.xml,.JupiterTest.java.example-test/TEST-junit-vintage.xml)), extra_output=None).stdout
src/python/pants/backend/java/test/junit_test.py:662: AssertionError
---------------------------- Captured stderr setup -----------------------------
Preserving rule runner temporary directories at /tmp/RuleRunner.lndredeu.
- generated xml file: /tmp/process-execution4N3Xju/src.python.pants.backend.java.test.junit_test.py.tests.xml -
=========================== short test summary info ============================
FAILED src/python/pants/backend/java/test/junit_test.py::test_vintage_simple_success
FAILED src/python/pants/backend/java/test/junit_test.py::test_vintage_simple_failure
FAILED src/python/pants/backend/java/test/junit_test.py::test_vintage_success_with_dep
FAILED src/python/pants/backend/java/test/junit_test.py::test_jupiter_simple_success
FAILED src/python/pants/backend/java/test/junit_test.py::test_jupiter_simple_failure
FAILED src/python/pants/backend/java/test/junit_test.py::test_jupiter_success_with_dep
FAILED src/python/pants/backend/java/test/junit_test.py::test_vintage_and_jupiter_simple_success
============================== 7 failed in 1.77s ===============================
witty-crayon-22786
09/30/2021, 2:33 AM--system
, isn’t it.bored-art-40741
09/30/2021, 2:34 AMbored-art-40741
09/30/2021, 2:34 AMwitty-crayon-22786
09/30/2021, 2:34 AMtest_vintage_and_jupiter_simple_success
is suspicious. i don’t actually know why that one ever passed. it tries to run tests in two different files… but those are separate targets, so they’ll run in separate invokesbored-art-40741
09/30/2021, 2:35 AMwitty-crayon-22786
09/30/2021, 2:39 AMbored-art-40741
09/30/2021, 2:40 AMwitty-crayon-22786
09/30/2021, 2:40 AMwitty-crayon-22786
09/30/2021, 2:41 AMtest_vintage_and_jupiter_simple_success
went from succeeding to failing because inference converted it into two invokes, etcwitty-crayon-22786
09/30/2021, 2:41 AMbored-art-40741
09/30/2021, 2:41 AMbored-art-40741
09/30/2021, 2:42 AMwitty-crayon-22786
09/30/2021, 3:37 AMwitty-crayon-22786
09/30/2021, 3:39 AMwitty-crayon-22786
09/30/2021, 7:17 AMwitty-crayon-22786
09/30/2021, 9:42 PM