coreos / coreos/coreos-assembler

kola.json is not used on external tests

Open
#4,392 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
393
Forks
193
Avg merge
17h 6m
Merged PRs (30d)
5

Description

Bug Report

Environment

What operating system is being used to run coreos-assembler?
Fedora 43

What operating system is being assembled?
fedora coreos

Is coreos-assembler running in Podman or Docker?
podman

If Podman, is coreos-assembler running privileged or unprivileged?
rootless with --privileged

Expected Behavior

When defining external tests for kola, the file kola.json should be used as default metadata for all tests in the test folder.

Actual Behavior

Only in binary metadatas (json and yaml) are used and kola.json is parsed, but never used

Reproduction Steps

  1. Create an external test. Put metadata in the kola.json file
  2. Run kola list -E /path/to/project
  3. On the ext.* tests, the metadata are not used

This procedure is for quick check, running or listing the tests is the same. Using label is a quick way to check.

Other Information

After reading the code I found the issue. in mantle/kola/harness.go, the function registerExternalTest will check if the binary have metadata in the binary using the metadataFromTestBinary function. If the result is nil, then kola.json is used, if not, the in binary metadata are used.

The commit 119bc7f9aadc36dfa210bb665df10a41e413c544 that introduced the exclusive metadata, modified the function metadataFromTestBinary by initializing the meta variable with this expression :

meta := &externalTestMeta{Exclusive: true}

Causing the function to never return a nil value, and thus kola.json will never be used.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mantle/kola/harness.go, especially registerExternalTest and metadataFromTestBinary, then reproduce the report with an external test and kola list -E /path/to/project. Check how kola.json and binary metadata are selected. Done means metadata from kola.json is applied to external tests when binary metadata is absent, including labels shown by kola list.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.