|
1 | 1 | import functools |
2 | | -import json |
3 | 2 | import os |
4 | 3 | import site |
5 | 4 | import stat |
@@ -180,17 +179,6 @@ def test_install_pip_requirements_with_uv( |
180 | 179 | {"shallow-clone": True}, |
181 | 180 | id="git_with_shallow_clone", |
182 | 181 | ), |
183 | | - pytest.param( |
184 | | - {}, |
185 | | - { |
186 | | - "REPOSITORY_TYPE": "git", |
187 | | - "HEAD_REPOSITORY": "https://github.com/example/repo", |
188 | | - "HEAD_REV": "abc123", |
189 | | - "EXTRA_REFS": json.dumps(["refs/notes/taskgraph", "refs/notes/other"]), |
190 | | - }, |
191 | | - {"extra-refs": ["refs/notes/taskgraph", "refs/notes/other"]}, |
192 | | - id="git_with_extra_refs", |
193 | | - ), |
194 | 182 | ], |
195 | 183 | ) |
196 | 184 | def test_collect_vcs_options( |
@@ -228,7 +216,6 @@ def test_collect_vcs_options( |
228 | 216 | "shallow-clone": False, |
229 | 217 | "ssh-secret-name": env.get("SSH_SECRET_NAME"), |
230 | 218 | "store-path": env.get("HG_STORE_PATH"), |
231 | | - "extra-refs": None, |
232 | 219 | } |
233 | 220 | if "PIP_REQUIREMENTS" in env: |
234 | 221 | expected["pip-requirements"] = os.path.join( |
@@ -653,34 +640,3 @@ def test_main_abspath_environment(mocker, run_main): |
653 | 640 | assert env[key] == "/builds/worker/file" |
654 | 641 |
|
655 | 642 |
|
656 | | -def test_git_checkout_extra_refs(mock_stdin, run_task_mod, mock_git_repo, tmp_path): |
657 | | - """extra_refs are fetched into the local repo during checkout.""" |
658 | | - # Add a notes ref to the source repo |
659 | | - rev = mock_git_repo["main"][-1] |
660 | | - subprocess.check_call( |
661 | | - ["git", "notes", "--ref=refs/notes/taskgraph", "add", "-m", "test", rev], |
662 | | - cwd=mock_git_repo["path"], |
663 | | - ) |
664 | | - |
665 | | - destination = tmp_path / "destination" |
666 | | - run_task_mod.git_checkout( |
667 | | - destination_path=str(destination), |
668 | | - head_repo=mock_git_repo["path"], |
669 | | - base_repo=mock_git_repo["path"], |
670 | | - base_rev=None, |
671 | | - head_ref="main", |
672 | | - head_rev=None, |
673 | | - ssh_key_file=None, |
674 | | - ssh_known_hosts_file=None, |
675 | | - extra_refs=["refs/notes/taskgraph"], |
676 | | - ) |
677 | | - |
678 | | - # Verify the notes ref is available locally |
679 | | - result = subprocess.run( |
680 | | - ["git", "notes", "--ref=refs/notes/taskgraph", "show", rev], |
681 | | - cwd=str(destination), |
682 | | - capture_output=True, |
683 | | - text=True, |
684 | | - ) |
685 | | - assert result.returncode == 0 |
686 | | - assert "test" in result.stdout |
0 commit comments