• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 18252174847

05 Oct 2025 01:36AM UTC coverage: 43.382% (-36.9%) from 80.261%
18252174847

push

github

web-flow
run tests on mac arm (#22717)

Just doing the minimal to pull forward the x86_64 pattern.

ref #20993

25776 of 59416 relevant lines covered (43.38%)

1.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/java/goals/check.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
×
5

6
import logging
×
7

8
from pants.backend.java.subsystems.javac import JavacSubsystem
×
9
from pants.backend.java.target_types import JavaFieldSet
×
10
from pants.core.goals.check import CheckRequest, CheckResult, CheckResults
×
11
from pants.engine.addresses import Addresses
×
12
from pants.engine.internals.graph import resolve_coarsened_targets as coarsened_targets_get
×
13
from pants.engine.rules import collect_rules, concurrently, implicitly, rule
×
14
from pants.engine.target import CoarsenedTargets
×
15
from pants.engine.unions import UnionRule
×
16
from pants.jvm.compile import (
×
17
    ClasspathEntryRequest,
18
    ClasspathEntryRequestFactory,
19
    get_fallible_classpath_entry,
20
)
21
from pants.jvm.resolve.coursier_fetch import select_coursier_resolve_for_targets
×
22
from pants.util.logging import LogLevel
×
23

24
logger = logging.getLogger(__name__)
×
25

26

27
class JavacCheckRequest(CheckRequest):
×
28
    field_set_type = JavaFieldSet
×
29
    tool_name = JavacSubsystem.options_scope
×
30

31

32
@rule(desc="Check javac compilation", level=LogLevel.DEBUG)
×
33
async def javac_check(
×
34
    request: JavacCheckRequest,
35
    classpath_entry_request: ClasspathEntryRequestFactory,
36
) -> CheckResults:
37
    coarsened_targets = await coarsened_targets_get(
×
38
        **implicitly(Addresses(field_set.address for field_set in request.field_sets))
39
    )
40

41
    # NB: Each root can have an independent resolve, because there is no inherent relation
42
    # between them other than that they were on the commandline together.
43
    resolves = await concurrently(
×
44
        select_coursier_resolve_for_targets(CoarsenedTargets([t]), **implicitly())
45
        for t in coarsened_targets
46
    )
47

48
    results = await concurrently(
×
49
        get_fallible_classpath_entry(
50
            **implicitly(
51
                {
52
                    classpath_entry_request.for_targets(
53
                        component=target, resolve=resolve
54
                    ): ClasspathEntryRequest
55
                }
56
            )
57
        )
58
        for target, resolve in zip(coarsened_targets, resolves)
59
    )
60

61
    # NB: We don't pass stdout/stderr as it will have already been rendered as streaming.
62
    exit_code = next((result.exit_code for result in results if result.exit_code != 0), 0)
×
63
    return CheckResults([CheckResult(exit_code, "", "")], checker_name=request.tool_name)
×
64

65

66
def rules():
×
67
    return [
×
68
        *collect_rules(),
69
        UnionRule(CheckRequest, JavacCheckRequest),
70
    ]
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc