Skip to content

Warning on new test fail#4518

Open
angelcerveraroldan wants to merge 2 commits intocoreos:mainfrom
angelcerveraroldan:warning-on-new-test-fail
Open

Warning on new test fail#4518
angelcerveraroldan wants to merge 2 commits intocoreos:mainfrom
angelcerveraroldan:warning-on-new-test-fail

Conversation

@angelcerveraroldan
Copy link
Copy Markdown
Member

New tests often block the CI when they fail.

If we add a creation date for new tets, we can throw a warning rather than a failure for a week after the creation date, so that we can monitor the test in the pipeline without blocking it.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a grace period for new kola tests by adding a creationDate field to the test metadata. For one week following this date, test failures are treated as warnings to prevent blocking CI during initial monitoring. The changes include documentation, metadata structure updates, and logic to manage the WarnOnErrorTests list. One concern was raised regarding the use of filepath.Match for checking WarnOnErrorTests; literal test names containing glob characters might fail to match correctly, potentially bypassing the warning logic.

Comment on lines +1311 to +1322
if targetMeta.CreationDate != "" {
today := time.Now()
testCreationDate, err := time.Parse(dateFormat, targetMeta.CreationDate)
if err != nil {
return err
}
gracePeriodEnds := testCreationDate.Add(gracePeriod)
if today.Before(gracePeriodEnds) {
fmt.Printf("⏳ Kola test \"%s\" is in grace period (created: %s, expires: %s), failures will be warnings.\n", t.Name, targetMeta.CreationDate, gracePeriodEnds.Format(dateFormat))
WarnOnErrorTests = append(WarnOnErrorTests, t.Name)
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding a literal test name to WarnOnErrorTests might lead to unexpected behavior if the test name contains characters that are special to filepath.Match (such as *, ?, or [). Since IsWarningOnFailure uses filepath.Match to check for matches, a test name like ext.myproj.test[1] would fail to match itself because [1] would be interpreted as a character class. While kola test names are generally well-behaved, it would be safer to ensure that literal names are matched correctly even if they contain glob characters.

New test will have a one week grace period, where any failures will be
logged as a warning, rather than an error.
@dustymabe
Copy link
Copy Markdown
Member

The general direction here looks good. A few suggestions:

  1. Let's squash the two commits into 1 commit. I'm not sure there's enough of a reason to split them up.
  2. Can we prefix the commit tile with mantle/kola:
  3. I think the grace period should be 1 month (~30 days). A little extra time for things to propagate downstream would be nice.
  4. We should ensure as part of this that this works for COSA defined tests too. If we were to add any there it would be nice to be able to set CreationDate not just in external tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants