class_docstr: Tests worker HPA auto scaler.
class_docstr_tok: ["Tests","worker","HPA","auto","scaler","."]
code: def test_should_use_hpa_metrics(
      self, metrics, executor, expected_metrics
  ):
      docs = render_chart(
          values={
              "executor": executor,
              "workers": {
                  "hpa": {
                      "enabled": True,
                      **({"metrics": metrics} if metrics else {}),
                  },
              },
          },
          show_only=["templates/workers/worker-hpa.yaml"],
      )
      assert expected_metrics == jmespath.search(
          "spec.metrics[0]", docs[0]
      )
  
imports: from __future__ import annotations
  import jmespath
  import pytest
  from tests.charts.helm_template_generator import render_chart
  from tests.charts.log_groomer import LogGroomerTestBase
label_desc: Use image node_id 4 for calling the TestWorkerHPAAutoScaler obj's underlying member method code with example usage: obj.test_should_use_hpa_metrics(metrics, executor, expected_metrics) without return types