Skip to content

Commit 9111042

Browse files
Roshan-Rjlebon
authored andcommitted
feat(kola): add --denylist-stream flag to allow running without manifest.yaml
Kola normally requires a manifest.yaml to determine the stream for denylist filtering. This change adds support for passing the stream explicitly via the --denylist-stream flag, allowing kola to run without a manifest file.
1 parent bc7e0f4 commit 9111042

File tree

2 files changed

+37
-28
lines changed

2 files changed

+37
-28
lines changed

mantle/cmd/kola/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func init() {
6060
sv(&kola.Options.BaseName, "basename", "kola", "Cluster name prefix")
6161
ss("debug-systemd-unit", []string{}, "full-unit-name.service to enable SYSTEMD_LOG_LEVEL=debug on. Can be specified multiple times.")
6262
ssv(&kola.DenylistedTests, "denylist-test", []string{}, "Test pattern to add to denylist. Can be specified multiple times.")
63+
sv(&kola.DenylistStream, "denylist-stream", "", "Stream name used to match entries in the kola denylist")
6364
bv(&kola.NoNet, "no-net", false, "Don't run tests that require an Internet connection")
6465
bv(&kola.ForceRunPlatformIndependent, "run-platform-independent", false, "Run tests that claim platform independence")
6566
ssv(&kola.Tags, "tag", []string{}, "Test tag to run. Can be specified multiple times.")

mantle/kola/harness.go

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ var (
127127
// SkipConsoleWarnings is set via SkipConsoleWarningsTag in kola-denylist.yaml
128128
SkipConsoleWarnings bool
129129
DenylistedTests []string // tests which are on the denylist
130+
DenylistStream string //denylist-stream
130131
WarnOnErrorTests []string // denylisted tests we are going to run and warn in case of error
131132
Tags []string // tags to be ran
132133

@@ -395,38 +396,45 @@ func ParseDenyListYaml(pltfrm string) error {
395396

396397
plog.Debug("Parsed kola-denylist.yaml")
397398

398-
// Look for the right manifest, taking into account the variant
399-
var manifest ManifestData
400-
var pathToManifest string
401-
pathToInitConfig := filepath.Join(Options.CosaWorkdir, "src/config.json")
402-
initConfigFile, err := os.ReadFile(pathToInitConfig)
403-
if os.IsNotExist(err) {
404-
// No variant config found. Let's read the default manifest
405-
pathToManifest = filepath.Join(Options.CosaWorkdir, "src/config/manifest.yaml")
406-
} else if err != nil {
407-
// Unexpected error
408-
return err
409-
} else {
410-
// Figure out the variant and read the corresponding manifests
411-
var initConfig InitConfigData
412-
err = json.Unmarshal(initConfigFile, &initConfig)
399+
var stream string
400+
var osversion string
401+
402+
// Get the stream and osversion variables from the manifest since DenylistStream is not specified
403+
if len(DenylistStream) == 0 {
404+
// Look for the right manifest, taking into account the variant
405+
var manifest ManifestData
406+
var pathToManifest string
407+
pathToInitConfig := filepath.Join(Options.CosaWorkdir, "src/config.json")
408+
initConfigFile, err := os.ReadFile(pathToInitConfig)
409+
if os.IsNotExist(err) {
410+
// No variant config found. Let's read the default manifest
411+
pathToManifest = filepath.Join(Options.CosaWorkdir, "src/config/manifest.yaml")
412+
} else if err != nil {
413+
// Unexpected error
414+
return err
415+
} else {
416+
// Figure out the variant and read the corresponding manifests
417+
var initConfig InitConfigData
418+
err = json.Unmarshal(initConfigFile, &initConfig)
419+
if err != nil {
420+
return err
421+
}
422+
pathToManifest = filepath.Join(Options.CosaWorkdir, fmt.Sprintf("src/config/manifest-%s.yaml", initConfig.ConfigVariant))
423+
}
424+
manifestFile, err := os.ReadFile(pathToManifest)
425+
if err != nil {
426+
return err
427+
}
428+
err = yaml.Unmarshal(manifestFile, &manifest)
413429
if err != nil {
414430
return err
415431
}
416-
pathToManifest = filepath.Join(Options.CosaWorkdir, fmt.Sprintf("src/config/manifest-%s.yaml", initConfig.ConfigVariant))
417-
}
418-
manifestFile, err := os.ReadFile(pathToManifest)
419-
if err != nil {
420-
return err
421-
}
422-
err = yaml.Unmarshal(manifestFile, &manifest)
423-
if err != nil {
424-
return err
425-
}
426432

427-
// Get the stream and osversion variables from the manifest
428-
stream := manifest.Variables.Stream
429-
osversion := manifest.Variables.OsVersion
433+
stream = manifest.Variables.Stream
434+
osversion = manifest.Variables.OsVersion
435+
} else {
436+
stream = DenylistStream
437+
}
430438

431439
// Get the current arch & current time
432440
arch := Options.CosaBuildArch

0 commit comments

Comments
 (0)