Inconsistent log levels for test names
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- go
- 领域
- cli, testing-qa
调研方向
从 pkg/types/v2/file_existence.go、file_content.go、command.go、licenses.go 和 metadata.go 中的日志记录点开始。使用 --verbosity info 和示例配置运行提供的 container-structure-test 命令,以比较当前输出。完成的标准是:列出的每个测试名称都能在 info 级别一致地显示,同时 debug 输出仍然可用。
由索引模型根据 Issue 内容生成。
描述
Description
Different tests log their name at different log levels:
Infolevel logging:Debuglevel logging:- command: https://github.com/GoogleContainerTools/container-structure-test/blob/main/pkg/types/v2/command.go#L84
- licenses: https://github.com/GoogleContainerTools/container-structure-test/blob/main/pkg/types/v2/licenses.go#L66
- Metadata: https://github.com/GoogleContainerTools/container-structure-test/blob/main/pkg/types/v2/metadata.go#L93
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
- 主要语言
- Go
- 星标
- 2.5k
- 派生
- 213
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GoogleContainerTools/container-structure-test 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
allstar
难度 2/5 1-3 小时 新手友好度 65/100
GoogleContainerTools/container-structure-test#393 · 639 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
GoogleContainerTools/container-structure-test#280 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 45/100
-
Windows: structure_test binary missing .exe extension causes "Open With" dialog instead of running tests可能已有人在做 @peakschris 于 145 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
查看 GoogleContainerTools/container-structure-test 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
schema-drift
难度 2/5 1-3 小时 新手友好度 72/100
stefanhoth/paperless-ngx-cli#61 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
slavakurilyak/awesome-ai-agents#888 ·
维护者通常 1 天内回复
-
enhancement nav-pilot
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
kind/enhancement
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复