class_docstr: Tests scheduler.
class_docstr_tok: ["Tests","scheduler","."]
docstr: DAG Processor can move gitsync and DAGs mount from the scheduler to the DAG Processor only.
  
  The only exception is when we have a Local executor.
  In these cases, the scheduler does the worker role and needs access to DAGs anyway.
code: def test_dags_mount_and_gitsync_expected_with_dag_processor(
      self, dag_processor, executor, skip_dags_mount
  ):
      """
      DAG Processor can move gitsync and DAGs mount from the scheduler to the DAG Processor only.
  
      The only exception is when we have a Local executor.
      In these cases, the scheduler does the worker role and needs access to DAGs anyway.
      """
      docs = render_chart(
          values={
              "dagProcessor": {"enabled": dag_processor},
              "executor": executor,
              "dags": {
                  "gitSync": {"enabled": True},
                  "persistence": {"enabled": True},
              },
              "scheduler": {"logGroomerSidecar": {"enabled": False}},
          },
          show_only=["templates/scheduler/scheduler-deployment.yaml"],
      )
  
      if skip_dags_mount:
          assert "dags" not in [
              vm["name"]
              for vm in jmespath.search(
                  "spec.template.spec.containers[0].volumeMounts",
                  docs[0],
              )
          ]
          assert "dags" not in [
              vm["name"]
              for vm in jmespath.search(
                  "spec.template.spec.volumes", docs[0]
              )
          ]
          assert 1 == len(
              jmespath.search("spec.template.spec.containers", docs[0])
          )
      else:
          assert "dags" in [
              vm["name"]
              for vm in jmespath.search(
                  "spec.template.spec.containers[0].volumeMounts",
                  docs[0],
              )
          ]
          assert "dags" in [
              vm["name"]
              for vm in jmespath.search(
                  "spec.template.spec.volumes", docs[0]
              )
          ]
          assert "git-sync" in [
              c["name"]
              for c in jmespath.search(
                  "spec.template.spec.containers", docs[0]
              )
          ]
          assert "git-sync-init" in [
              c["name"]
              for c in jmespath.search(
                  "spec.template.spec.initContainers", 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 32 for calling the TestScheduler obj's underlying member method code with example usage: obj.test_dags_mount_and_gitsync_expected_with_dag_processor(dag_processor, executor, skip_dags_mount) without return types