GoogleContainerTools / container-structure-test

validate the structure of your container images
Apache License 2.0
2.33k stars 198 forks source link

Inconsistent log levels for test names #471

Open denizgenc opened 2 weeks ago

denizgenc commented 2 weeks ago

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: