Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Inconsistent log levels for test names

Abierto
#471 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
go
Área
cli, testing-qa

Línea de trabajo

Comienza con los puntos de logging en pkg/types/v2/file_existence.go, file_content.go, command.go, licenses.go y metadata.go. Ejecuta el comando proporcionado de container-structure-test con --verbosity info y la configuración de ejemplo para comparar la salida actual. Se considera terminado cuando todos los nombres de prueba enumerados sean visibles de forma consistente en el nivel info, mientras la salida de depuración siga disponible.

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

Descripción

Description

Different tests log their name at different log levels:

If container-structure-test runs with --verbosity info and --output <json, junit> --test-report <outfile>, we can't see all the tests that are being run.

Not knowing what tests will run is a possibility in complex build environments where the configuration for container-structure-tests is generated at test time. Therefore it is helpful for all of this information to be available in a consistent manner without having to

I think it would make sense to make all the tests log their name at info level; this way it doesn't affect anyone was using --verbosity debug, whilst allowing those at --verbosity info to see all the tests being run.

Replication

With the following config.yml:

schemaVersion: "2.0.0"

fileExistenceTests:
  - name: "sh existence"
    path: "/bin/sh"

metadataTest:
  entrypoint: []

Running with the flags info --image docker.io/library/alpine:latest --config config.yml --output junit --test-report out.xml will give us the following results:

  • with --verbosity info

    $ container-structure-test test --verbosity info --image docker.io/library/alpine:latest --config config.yml --output junit --test-report out.xml
    INFO[0000] container-structure-test &{Version:1.19.1 GitVersion: BuildDate:2024-07-22T18:56:16Z GoVersion:go1.22.5 Compiler:gc Platform:linux/amd64}
    INFO[0000] File Existence Test: sh existence
    
  • with --verbosity debug:

    $ container-structure-test test --verbosity debug --image docker.io/library/alpine:latest --config config.yml --output junit --test-report out.xml
    INFO[0000] container-structure-test &{Version:1.19.1 GitVersion: BuildDate:2024-07-22T18:56:16Z GoVersion:go1.22.5 Compiler:gc Platform:linux/amd64}
    INFO[0000] File Existence Test: sh existence
    DEBU[0000] Metadata Test
    
Lenguaje dominante
Go
Estrellas
2.5k
Forks
213
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 GoogleContainerTools/container-structure-test

Todos los issues de GoogleContainerTools/container-structure-test

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.