code: def test_run_databricks_validations(
      tmp_path,
      monkeypatch,
      cluster_spec_mock,
      dbfs_mocks,
      set_tag_mock,
  ):  # pylint: disable=unused-argument
      """
      Tests that running on Databricks fails before making any API requests if validations fail.
      """
      monkeypatch.setenvs(
          {"DATABRICKS_HOST": "test-host", "DATABRICKS_TOKEN": "foo"}
      )
      with mock.patch(
          "mlflow.projects.databricks.DatabricksJobRunner._databricks_api_request"
      ) as db_api_req_mock:
          # Test bad tracking URI
          mlflow.set_tracking_uri(tmp_path.as_uri())
          with pytest.raises(
              ExecutionException, match="MLflow tracking URI must be of"
          ):
              run_databricks_project(
                  cluster_spec_mock, synchronous=True
              )
          assert db_api_req_mock.call_count == 0
          db_api_req_mock.reset_mock()
          mlflow_service = MlflowClient()
          assert (
              len(
                  mlflow_service.search_runs(
                      [FileStore.DEFAULT_EXPERIMENT_ID]
                  )
              )
              == 0
          )
          mlflow.set_tracking_uri("databricks")
          # Test misspecified parameters
          with pytest.raises(
              ExecutionException,
              match="No value given for missing parameters: 'name'",
          ):
              mlflow.projects.run(
                  TEST_PROJECT_DIR,
                  backend="databricks",
                  entry_point="greeter",
                  backend_config=cluster_spec_mock,
              )
          assert db_api_req_mock.call_count == 0
          db_api_req_mock.reset_mock()
          # Test bad cluster spec
          with pytest.raises(
              ExecutionException, match="Backend spec must be provided"
          ):
              mlflow.projects.run(
                  TEST_PROJECT_DIR,
                  backend="databricks",
                  synchronous=True,
                  backend_config=None,
              )
          assert db_api_req_mock.call_count == 0
          db_api_req_mock.reset_mock()
          # Test that validations pass with good tracking URIs
          databricks.before_run_validations(
              "http://", cluster_spec_mock
          )
          databricks.before_run_validations(
              "databricks", cluster_spec_mock
          )
  
imports: import filecmp
  import json
  import os
  import shutil
  from unittest import mock
  import databricks_cli
  import pytest
  from databricks_cli.configure.provider import DatabricksConfig
  import mlflow
  from mlflow import MlflowClient, cli
  from mlflow.entities import RunStatus
  from mlflow.environment_variables import MLFLOW_TRACKING_URI
  from mlflow.exceptions import MlflowException
  from mlflow.projects import ExecutionException, databricks
  from mlflow.projects.databricks import DatabricksJobRunner, _get_cluster_mlflow_run_cmd
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, ErrorCode
  from mlflow.store.tracking.file_store import FileStore
  from mlflow.tracking.request_header.default_request_header_provider import DefaultRequestHeaderProvider
  from mlflow.utils import file_utils
  from mlflow.utils.mlflow_tags import MLFLOW_DATABRICKS_RUN_URL, MLFLOW_DATABRICKS_SHELL_JOB_RUN_ID, MLFLOW_DATABRICKS_WEBAPP_URL
  from mlflow.utils.uri import construct_db_uri_from_profile
  from tests import helper_functions
  from tests.integration.utils import invoke_cli_runner
  from tests.projects.utils import TEST_PROJECT_DIR, validate_exit_status
label_desc: Use image node_id 18 for calling a global function with example usage: test_run_databricks_validations(tmp_path, monkeypatch, cluster_spec_mock, dbfs_mocks, set_tag_mock) without return types