From 9408c728cd683019685684780e1910ffca56ccca Mon Sep 17 00:00:00 2001 From: husharp Date: Wed, 4 Sep 2024 10:35:48 +0800 Subject: [PATCH] skip pr Signed-off-by: husharp --- cmd/cli_test_status.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cmd/cli_test_status.go b/cmd/cli_test_status.go index dffd8c2..17e2804 100644 --- a/cmd/cli_test_status.go +++ b/cmd/cli_test_status.go @@ -51,6 +51,8 @@ func newTestCommand() *cobra.Command { return command } +var skipPRNumber = []int{} + func checkTestRange(cmd *cobra.Command, kind string, lastDay time.Time) error { cfgPath, err := cmd.Flags().GetString("config") if err != nil { @@ -79,15 +81,26 @@ func checkTestRange(cmd *cobra.Command, kind string, lastDay time.Time) error { buf := strings.Builder{} _ = getFailedCIURLWithCommits(githubClient, owner, repo, shaMap) + skipPRMap := make(map[int]bool) + for _, prNumber := range skipPRNumber { + skipPRMap[prNumber] = true + } + fmt.Println("======Below is the unstable ut ci link======") for failedName, stats := range ci_test.TestNameMap { + skipPR := false printContent := fmt.Sprintf("%s failed count: %d", failedName, stats.FailedCount) for ciLink, prNumber := range stats.CILink { + if exist, ok := skipPRMap[prNumber]; ok && exist { + skipPR = true + } printContent = fmt.Sprintf("%s\nPR number: %d, CI link: %s", printContent, prNumber, ciLink) } printContent = fmt.Sprintf("%s\n\n", printContent) - fmt.Print(printContent) - buf.WriteString(printContent) + if !skipPR { + fmt.Print(printContent) + buf.WriteString(printContent) + } } now := time.Now().In(timeZone)