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

pantsbuild / pants / 19377500035

14 Nov 2025 09:01PM UTC coverage: 80.078% (-0.2%) from 80.29%
19377500035

Pull #22890

github

web-flow
Merge 90397d509 into 42e1ebd41
Pull Request #22890: Updated all python subsystem constraints to 3.14

4 of 5 new or added lines in 5 files covered. (80.0%)

214 existing lines in 14 files now uncovered.

77661 of 96982 relevant lines covered (80.08%)

3.36 hits per line

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

66.67
/src/python/pants/backend/helm/subsystems/post_renderer_test.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
from pathlib import PurePath
1✔
7
from textwrap import dedent
1✔
8

9
import pytest
1✔
10

11
from pants.backend.helm.subsystems import post_renderer
1✔
12
from pants.backend.helm.subsystems.post_renderer import HelmPostRenderer, SetupHelmPostRenderer
1✔
13
from pants.backend.helm.utils.yaml import MutableYamlIndex, YamlPath
1✔
14
from pants.core.goals.run import rules as run_rules
1✔
15
from pants.engine.fs import DigestContents, Snapshot
1✔
16
from pants.engine.process import Process, ProcessResult
1✔
17
from pants.engine.rules import QueryRule
1✔
18
from pants.testutil.rule_runner import PYTHON_BOOTSTRAP_ENV, RuleRunner
1✔
19

20

21
@pytest.fixture
1✔
22
def rule_runner() -> RuleRunner:
1✔
23
    rule_runner = RuleRunner(
1✔
24
        rules=[
25
            *post_renderer.rules(),
26
            *run_rules(),
27
            QueryRule(HelmPostRenderer, (SetupHelmPostRenderer,)),
28
            QueryRule(ProcessResult, (Process,)),
29
        ]
30
    )
31
    rule_runner.set_options(
1✔
32
        [],
33
        env_inherit=PYTHON_BOOTSTRAP_ENV,
34
    )
35
    return rule_runner
1✔
36

37

38
def test_post_renderer_is_runnable(rule_runner: RuleRunner) -> None:
1✔
39
    replacements = MutableYamlIndex[str]()
1✔
40
    replacements.insert(
1✔
41
        file_path=PurePath("file.yaml"),
42
        yaml_path=YamlPath.parse("/root/element"),
43
        item="replaced_value",
44
    )
45

46
    expected_cfg_file = dedent(
1✔
47
        """\
48
      ---
49
      file.yaml:
50
      - paths:
51
          /root/element: replaced_value
52
      """
53
    )
54

55
    post_renderer_setup = rule_runner.request(
1✔
56
        HelmPostRenderer,
57
        [
58
            SetupHelmPostRenderer(
59
                replacements.frozen(), description_of_origin="test_post_renderer_is_runnable"
60
            )
61
        ],
62
    )
UNCOV
63
    assert post_renderer_setup.exe == "post_renderer_wrapper.sh"
×
64

UNCOV
65
    input_snapshot = rule_runner.request(Snapshot, [post_renderer_setup.digest])
×
UNCOV
66
    assert "post_renderer.cfg.yaml" in input_snapshot.files
×
UNCOV
67
    assert "post_renderer_wrapper.sh" in input_snapshot.files
×
68

UNCOV
69
    input_contents = rule_runner.request(DigestContents, [post_renderer_setup.digest])
×
UNCOV
70
    for file in input_contents:
×
UNCOV
71
        if file.path == "post_renderer.cfg.yaml":
×
UNCOV
72
            assert file.content.decode() == expected_cfg_file
×
UNCOV
73
        elif file.path == "post_renderer_wrapper.sh":
×
UNCOV
74
            script_lines = file.content.decode().splitlines()
×
UNCOV
75
            assert (
×
76
                "./helm_post_renderer.pex_pex_shim.sh ./post_renderer.cfg.yaml ./__helm_stdout.yaml"
77
                in script_lines
78
            )
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