code: def test_push(tmp_dir, scm, dvc, git_upstream, exp_stage, use_url):
      from dvc.exceptions import InvalidArgumentError
  
      remote = git_upstream.url if use_url else git_upstream.remote
      with pytest.raises(InvalidArgumentError):
          dvc.experiments.push(remote, ["foo"])
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=1"]
      )
      exp1 = first(results)
      ref_info1 = first(exp_refs_by_rev(scm, exp1))
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=2"]
      )
      exp2 = first(results)
      ref_info2 = first(exp_refs_by_rev(scm, exp2))
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=3"]
      )
      exp3 = first(results)
      ref_info3 = first(exp_refs_by_rev(scm, exp3))
  
      dvc.experiments.push(remote, [ref_info1.name, ref_info2.name])
      assert git_upstream.tmp_dir.scm.get_ref(str(ref_info1)) == exp1
      assert git_upstream.tmp_dir.scm.get_ref(str(ref_info2)) == exp2
      assert git_upstream.tmp_dir.scm.get_ref(str(ref_info3)) is None
  
      git_upstream.tmp_dir.scm.remove_ref(str(ref_info1))
      assert git_upstream.tmp_dir.scm.get_ref(str(ref_info1)) is None
  
      dvc.experiments.push(remote, [ref_info1.name])
      assert git_upstream.tmp_dir.scm.get_ref(str(ref_info1)) == exp1
  
      dvc.experiments.push(remote)
      assert git_upstream.tmp_dir.scm.get_ref(str(ref_info3)) == exp3
  
file_path: dvc/tests/func/experiments/test_remote.py
imports: import logging
  import pytest
  from funcy import first
  from dvc.repo.experiments.utils import exp_refs_by_rev
label_desc: Use image node_id 1 for calling a global function with example usage: test_push(tmp_dir, scm, dvc, git_upstream, exp_stage, use_url) without return types