code: def test_validate_configs(cli_context: CLIContext) -> None:
      """Tests config validation from a manifest stored on the filesystem.
  
      This test is special, because the CLI bypasses the semantic manifest read into the CLIContext and
      validates the config files on disk. It's not entirely clear why we do this, so we should probably
      figure that out and, if possible, stop doing it so we can have this test depend on an injectable
      in-memory semantic manifest instead of whatever is stored in the filesystem.
  
      At any rate, due to the direct read from disk, we have to store a serialized semantic manifest
      in a temporary location. In order to spin up the CLI this requires us to ALSO have a dbt_project.yml
      on the filesystem in the project path. Since we don't want to clobber whatever semantic_manifest.json is
      in the real filesystem location we do all of this stuff here.
      """
      yaml_contents = textwrap.dedent(
          """\
          semantic_model:
            name: bad_semantic_model
            node_relation:
              schema_name: some_schema
              alias: some_table
            defaults:
              agg_time_dimension: ds
            dimensions:
              - name: country
                type: categorical
          """
      )
      bad_semantic_model = YamlConfigFile(
          filepath="inline_for_test", contents=yaml_contents
      )
      # JSON-stored manifests from dbt are not transformed, so we run this test on that style of output
      manifest = parse_yaml_files_to_validation_ready_semantic_manifest(
          [
              EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE,
              base_semantic_manifest_file(),
              bad_semantic_model,
          ],
          apply_transformations=False,
      ).semantic_manifest
  
      project_directory = Path().absolute()
      # If the dbt_project.yml doesn't exist in this path location the CLI will throw an exception.
      dummy_project = Path(project_directory, "dbt_project.yml")
      dummy_project.touch()
  
      try:
          cli_runner = MetricFlowCliRunner(
              cli_context=cli_context,
              project_path=str(project_directory),
          )
          target_directory = Path(project_directory, "target")
          with create_directory(target_directory.as_posix()):
              manifest_file = Path(
                  target_directory, "semantic_manifest.json"
              )
              manifest_file.write_text(manifest.json())
  
              resp = cli_runner.run(validate_configs)
  
          assert "ERROR" in resp.output
          assert resp.exit_code == 1
  
      finally:
          dummy_project.unlink()
  
imports: from __future__ import annotations
  import logging
  import shutil
  import textwrap
  from contextlib import contextmanager
  from pathlib import Path
  from typing import Iterator
  import pytest
  from _pytest.fixtures import FixtureRequest
  from dbt_semantic_interfaces.parsing.dir_to_model import parse_yaml_files_to_validation_ready_semantic_manifest
  from dbt_semantic_interfaces.parsing.objects import YamlConfigFile
  from dbt_semantic_interfaces.test_utils import base_semantic_manifest_file
  from metricflow.cli.cli_context import CLIContext
  from metricflow.cli.main import dimension_values, dimensions, entities, health_checks, metrics, query, tutorial, validate_configs
  from metricflow.protocols.sql_client import SqlClient, SqlEngine
  from metricflow.test.fixtures.cli_fixtures import MetricFlowCliRunner
  from metricflow.test.fixtures.setup_fixtures import MetricFlowTestSessionState
  from metricflow.test.model.example_project_configuration import EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE
  from metricflow.test.snapshot_utils import assert_object_snapshot_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_validate_configs(cli_context) without return types