• 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

24.0
/src/python/pants/option/options_diff.py
1
# Copyright 2025 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from dataclasses import fields
3✔
5
from enum import Enum
3✔
6
from typing import Any
3✔
7

8
from pants.option.bootstrap_options import DynamicRemoteOptions
3✔
9

10

11
def summarize_options_map_diff(old: dict[str, Any], new: dict[str, Any]) -> str:
3✔
12
    """Compare two options map (as produced by `OptionsFingerprinter.options_map_for_scope`), and
13
    return a one-liner summarizing all differences, e.g.:
14

15
    `key1: 'old' -> "new'; list_key: ['x', 'y'] -> ['x']`
16
    """
17
    diffs = []
×
18
    for key in sorted({*old, *new}):
×
19
        o = old.get(key)
×
20
        n = new.get(key)
×
21

22
        if o == n:
×
23
            continue
×
24

25
        diffs.append(f"{key}: {o!r} -> {n!r}")
×
26

27
    return "; ".join(diffs)
×
28

29

30
def summarize_dynamic_options_diff(old: DynamicRemoteOptions, new: DynamicRemoteOptions) -> str:
3✔
31
    """Compare two `DynamicRemoteOptions` and return a one-liner summarizing all differences, e.g.:
32

33
    `provider: 'reapi' -> 'experimental-file'; cache_read: False -> True`
34
    """
35
    diffs = []
×
36
    for field in fields(DynamicRemoteOptions):
×
37
        key = field.name
×
38
        o = getattr(old, key)
×
39
        n = getattr(new, key)
×
40

41
        if o == n:
×
42
            continue
×
43

44
        o = o.value if isinstance(o, Enum) else o
×
45
        n = n.value if isinstance(n, Enum) else n
×
46

47
        diffs.append(f"{key}: {o!r} -> {n!r}")
×
48

49
    return "; ".join(diffs)
×
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