-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'GoogleCloudPlatform:main' into main
- Loading branch information
Showing
79 changed files
with
3,239 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func color(color, text string) string { | ||
if color == "" || text == "" { | ||
return text | ||
} | ||
var emoji string | ||
switch color { | ||
case "red": | ||
emoji = "🔴" | ||
case "yellow": | ||
emoji = "🟡" | ||
case "green": | ||
emoji = "🟢" | ||
default: | ||
return text | ||
} | ||
return fmt.Sprintf("%s %s", emoji, text) | ||
} |
10 changes: 5 additions & 5 deletions
10
.ci/magician/cmd/templates/SCHEDULED_PR_WAITING_FOR_CONTRIBUTOR.md.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.ci/magician/cmd/templates/vcr/without_replay_failed_tests.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{{- if .ReplayingErr -}} | ||
$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$ | ||
{{color "red" "Errors occurred during REPLAYING mode. Please fix them to complete your PR."}} | ||
{{- else -}} | ||
$\textcolor{green}{\textsf{All tests passed!}}$ | ||
{{color "green" "All tests passed!"}} | ||
{{- end}} | ||
|
||
View the [build log](https://storage.cloud.google.com/ci-vcr-logs/beta/refs/heads/auto-pr-{{.PRNumber}}/artifacts/{{.BuildID}}/build-log/replaying_test.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestColor(t *testing.T) { | ||
cases := []struct { | ||
name string | ||
color string | ||
text string | ||
want string | ||
}{ | ||
{ | ||
name: "red", | ||
color: "red", | ||
text: "Test text", | ||
want: "🔴 Test text", | ||
}, | ||
{ | ||
name: "yellow", | ||
color: "yellow", | ||
text: "Test text", | ||
want: "🟡 Test text", | ||
}, | ||
{ | ||
name: "green", | ||
color: "green", | ||
text: "Test text", | ||
want: "🟢 Test text", | ||
}, | ||
{ | ||
name: "unsupported color", | ||
color: "mauve", | ||
text: "Test text", | ||
want: "Test text", | ||
}, | ||
{ | ||
name: "empty color", | ||
text: "Test text", | ||
want: "Test text", | ||
}, | ||
{ | ||
name: "empty text", | ||
color: "green", | ||
want: "", | ||
}, | ||
} | ||
|
||
for _, tc := range cases { | ||
t.Run(tc.name, func(t *testing.T) { | ||
got := color(tc.color, tc.text) | ||
if got != tc.want { | ||
t.Errorf("color(%s, %s) got %s; want %s", tc.color, tc.text, got, tc.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.