code: def test_diff_no_cache(tmp_dir, scm, dvc):
      tmp_dir.dvc_gen({"dir": {"file": "file content"}}, commit="first")
      scm.tag("v1")
  
      tmp_dir.dvc_gen(
          {"dir": {"file": "modified file content"}}, commit="second"
      )
      scm.tag("v2")
  
      remove(dvc.cache.local.path)
  
      # invalidate_dir_info to force cache loading
      dvc.cache.local._dir_info = {}
  
      diff = dvc.diff("v1", "v2")
      assert diff["added"] == []
      assert diff["deleted"] == []
      assert first(diff["modified"])["path"] == os.path.join("dir", "")
      assert diff["not in cache"] == []
  
      (tmp_dir / "dir" / "file").unlink()
      remove(str(tmp_dir / "dir"))
      diff = dvc.diff()
      assert diff["added"] == []
      assert diff["deleted"] == [
          {
              "path": os.path.join("dir", ""),
              "hash": "f0f7a307d223921557c929f944bf5303.dir",
          }
      ]
      assert diff["renamed"] == []
      assert diff["modified"] == []
      assert diff["not in cache"] == [
          {
              "path": os.path.join("dir", ""),
              "hash": "f0f7a307d223921557c929f944bf5303.dir",
          }
      ]
  
imports: import hashlib
  import os
  import pytest
  from funcy import first
  from dvc.exceptions import DvcException
  from dvc.utils.fs import remove
label_desc: Use image node_id 12 for calling a global function with example usage: test_diff_no_cache(tmp_dir, scm, dvc) without return types