test(nvcf-cli): TestResolveStack_GitURI_DispatchesToGitResolver opens a real SSH connection and blocks go test on a host-key prompt

Abierto Apto para principiantes
#3,630 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
91/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, go
Área
cli, testing

Línea de trabajo

Lee src/clis/nvcf-cli/internal/selfhosted/stack_test.go, especialmente TestResolveStack_GitURI_DispatchesToGitResolver, y comprueba cómo ResolveStack invoca el resolvedor de Git. Ejecuta la prueba específica con GIT_SSH_COMMAND=false, tal como se describe en el issue; la tarea estará terminada cuando la prueba verifique el envío al resolvedor sin abrir una conexión SSH real ni quedarse bloqueada ante una solicitud de confirmación de la clave del host.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

cicd needs-triage

Problem

TestResolveStack_GitURI_DispatchesToGitResolver
(src/clis/nvcf-cli/internal/selfhosted/stack_test.go) calls ResolveStack with
[email protected]:nonexistent/nonexistent.git, so resolveGit runs a real
git clone over SSH to github.com.

The test's comment says "The point is to verify dispatch, not network
reachability," but the test depends on SSH and the network. On a machine where
github.com is not in known_hosts, SSH asks the host-key question on the terminal,
and go test ./... stops until someone answers:

The authenticity of host 'github.com (...)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

In CI there is no terminal, so SSH fails fast and the test passes, which hides this.

Steps to reproduce

  1. Fresh environment (I used a GitHub Codespace on main 31e209e64) with no
    github.com entry in ~/.ssh/known_hosts.
  2. cd src/clis/nvcf-cli && go test ./...
  3. The run blocks on the host-key prompt in internal/selfhosted.

Suggested fix

Keep the test off the network so it only verifies dispatch, for example:

t.Setenv("GIT_SSH_COMMAND", "false")

before calling ResolveStack. Git then fails immediately with no prompt, and the
existing assertions (an error containing "git ") still hold. Verified with
GIT_SSH_COMMAND=false go test ./internal/selfhosted/ -run TestResolveStack_GitURI_DispatchesToGitResolver -v.
Happy to send the PR.

Lenguaje dominante
Go
Estrellas
251
Forks
100
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/nvcf

Todos los issues de NVIDIA/nvcf

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.