code: def test_foreach_do_definition_item_does_not_exist(
      tmp_dir, dvc, key, loc
  ):
      context = Context(foo="bar")
      definition = make_foreach_def(
          tmp_dir,
          "build",
          [{"thresh": "10"}, {}],
          {"cmd": embrace(key)},
          context,
      )
  
      with pytest.raises(ResolveError) as exc_info:
          definition.resolve_all()
  
      assert (
          str(exc_info.value)
          == f"failed to parse '{loc}' in 'dvc.yaml': Could not find '{key}'"
      )
  
      # should have no `item` and `key` even though it failed to resolve.
      assert context == {"foo": "bar"}
  
imports: import logging
  import re
  import pytest
  from dvc.parsing import ResolveError
  from dvc.parsing.context import Context
  from dvc.parsing.interpolate import embrace
  from dvc.utils.humanize import join
  from .None import make_entry_definition, make_foreach_def
label_desc: Use image node_id 15 for calling a global function with example usage: test_foreach_do_definition_item_does_not_exist(tmp_dir, dvc, key, loc) without return types