code: def test_metrics_diff_cli(
      tmp_dir, scm, dvc, run_copy_metrics, caplog, capsys
  ):
      def _gen(val):
          tmp_dir.gen({"m_temp.yaml": f"foo: {val}"})
          run_copy_metrics(
              "m_temp.yaml",
              "m.yaml",
              name="copy-metrics",
              metrics=["m.yaml"],
          )
          dvc.scm.commit(str(val))
  
      _gen(1.23456789)
      _gen(2.34567891011)
      _gen(3.45678910111213)
  
      caplog.clear()
      capsys.readouterr()  # clearing the buffer
      assert main(["metrics", "diff", "HEAD~2"]) == 0
  
      captured = capsys.readouterr()
  
      assert (
          captured.out
          == "Path    Metric    HEAD~2    workspace    Change\n"
          "m.yaml  foo       1.23457   3.45679      2.22222\n"
      )
  
imports: import json
  from os.path import join
  import pytest
  from dvc.cli import main
  from dvc.utils import relpath
  from dvc.utils.serialize import JSONFileCorruptedError
label_desc: Use image node_id 12 for calling a global function with example usage: test_metrics_diff_cli(tmp_dir, scm, dvc, run_copy_metrics, caplog, capsys) without return types