code: def test_run_external_outputs(
      tmp_dir,
      dvc,
      local_workspace,
  ):
      hash_name = "md5"
      foo_hash = "acbd18db4cc2f85cedef654fccc4a4d8"
      bar_hash = "37b51d194a7513e45b56f6524f2d51f2"
  
      local_workspace.gen("foo", "foo")
      dvc.run(
          name="mystage",
          cmd="mycmd",
          deps=["remote://workspace/foo"],
          outs_no_cache=["remote://workspace/bar"],
          no_exec=True,
      )
  
      dvc_yaml = (
          "stages:\n"
          "  mystage:\n"
          "    cmd: mycmd\n"
          "    deps:\n"
          "    - remote://workspace/foo\n"
          "    outs:\n"
          "    - remote://workspace/bar:\n"
          "        cache: false\n"
      )
  
      assert (tmp_dir / "dvc.yaml").read_text() == dvc_yaml
      assert not (tmp_dir / "dvc.lock").exists()
  
      local_workspace.gen("bar", "bar")
      dvc.commit("dvc.yaml", force=True)
  
      assert (tmp_dir / "dvc.yaml").read_text() == dvc_yaml
      assert (tmp_dir / "dvc.lock").read_text() == (
          "schema: '2.0'\n"
          "stages:\n"
          "  mystage:\n"
          "    cmd: mycmd\n"
          "    deps:\n"
          "    - path: remote://workspace/foo\n"
          "      hash: md5\n"
          f"      {hash_name}: {foo_hash}\n"
          "      size: 3\n"
          "    outs:\n"
          "    - path: remote://workspace/bar\n"
          "      hash: md5\n"
          f"      {hash_name}: {bar_hash}\n"
          "      size: 3\n"
      )
  
      assert (local_workspace / "foo").read_text() == "foo"
      assert (local_workspace / "bar").read_text() == "bar"
      assert not (local_workspace / "cache").exists()
  
imports: import logging
  import os
  import textwrap
  import uuid
  import pytest
  from funcy import get_in
  from dvc.cli import main
  from dvc.dependency import ParamsDependency
  from dvc.dependency.base import DependencyDoesNotExistError
  from dvc.dvcfile import LOCK_FILE, PROJECT_FILE, load_file
  from dvc.exceptions import ArgumentDuplicationError, CircularDependencyError, CyclicGraphError, InvalidArgumentError, OutputDuplicationError, OverlappingOutputPathsError
  from dvc.stage import PipelineStage
  from dvc.stage.exceptions import DuplicateStageName, InvalidStageName, StagePathNotDirectoryError, StagePathNotFoundError, StagePathOutsideError
  from dvc.utils.serialize import load_yaml
label_desc: Use image node_id 21 for calling a global function with example usage: test_run_external_outputs(tmp_dir, dvc, local_workspace) without return types