@@ -978,102 +978,45 @@ func TestNotificationTemplates_Golden(t *testing.T) {
978
978
UserName : "Bobby" ,
979
979
980
980
UserUsername : "bobby" ,
981
- Labels : map [string ]string {},
981
+ Labels : map [string ]string {
982
+ "template_name" : "bobby-first-template" ,
983
+ "template_display_name" : "Bobby First Template" ,
984
+ },
982
985
// We need to use floats as `json.Unmarshal` unmarshal numbers in `map[string]any` to floats.
983
986
Data : map [string ]any {
987
+ "failed_builds" : 4.0 ,
988
+ "total_builds" : 55.0 ,
984
989
"report_frequency" : "week" ,
985
- "templates " : []map [string ]any {
990
+ "template_versions " : []map [string ]any {
986
991
{
987
- "name" : "bobby-first-template" ,
988
- "display_name" : "Bobby First Template" ,
989
- "failed_builds" : 4.0 ,
990
- "total_builds" : 55.0 ,
991
- "versions" : []map [string ]any {
992
+ "template_version_name" : "bobby-template-version-1" ,
993
+ "failed_count" : 3.0 ,
994
+ "failed_builds" : []map [string ]any {
992
995
{
993
- "template_version_name" : "bobby-template-version-1" ,
994
- "failed_count" : 3.0 ,
995
- "failed_builds" : []map [string ]any {
996
- {
997
- "workspace_owner_username" : "mtojek" ,
998
- "workspace_name" : "workspace-1" ,
999
- "workspace_id" : "24f5bd8f-1566-4374-9734-c3efa0454dc7" ,
1000
- "build_number" : 1234.0 ,
1001
- },
1002
- {
1003
- "workspace_owner_username" : "johndoe" ,
1004
- "workspace_name" : "my-workspace-3" ,
1005
- "workspace_id" : "372a194b-dcde-43f1-b7cf-8a2f3d3114a0" ,
1006
- "build_number" : 5678.0 ,
1007
- },
1008
- {
1009
- "workspace_owner_username" : "jack" ,
1010
- "workspace_name" : "workwork" ,
1011
- "workspace_id" : "1386d294-19c1-4351-89e2-6cae1afb9bfe" ,
1012
- "build_number" : 774.0 ,
1013
- },
1014
- },
996
+ "workspace_owner_username" : "mtojek" ,
997
+ "workspace_name" : "workspace-1" ,
998
+ "build_number" : 1234.0 ,
1015
999
},
1016
1000
{
1017
- "template_version_name" : "bobby-template-version-2" ,
1018
- "failed_count" : 1.0 ,
1019
- "failed_builds" : []map [string ]any {
1020
- {
1021
- "workspace_owner_username" : "ben" ,
1022
- "workspace_name" : "cool-workspace" ,
1023
- "workspace_id" : "86fd99b1-1b6e-4b7e-b58e-0aee6e35c159" ,
1024
- "build_number" : 8888.0 ,
1025
- },
1026
- },
1001
+ "workspace_owner_username" : "johndoe" ,
1002
+ "workspace_name" : "my-workspace-3" ,
1003
+ "build_number" : 5678.0 ,
1004
+ },
1005
+ {
1006
+ "workspace_owner_username" : "jack" ,
1007
+ "workspace_name" : "workwork" ,
1008
+ "build_number" : 774.0 ,
1027
1009
},
1028
1010
},
1029
1011
},
1030
1012
{
1031
- "name" : "bobby-second-template" ,
1032
- "display_name" : "Bobby Second Template" ,
1033
- "failed_builds" : 5.0 ,
1034
- "total_builds" : 50.0 ,
1035
- "versions" : []map [string ]any {
1036
- {
1037
- "template_version_name" : "bobby-template-version-1" ,
1038
- "failed_count" : 3.0 ,
1039
- "failed_builds" : []map [string ]any {
1040
- {
1041
- "workspace_owner_username" : "daniellemaywood" ,
1042
- "workspace_name" : "workspace-9" ,
1043
- "workspace_id" : "cd469690-b6eb-4123-b759-980be7a7b278" ,
1044
- "build_number" : 9234.0 ,
1045
- },
1046
- {
1047
- "workspace_owner_username" : "johndoe" ,
1048
- "workspace_name" : "my-workspace-7" ,
1049
- "workspace_id" : "c447d472-0800-4529-a836-788754d5e27d" ,
1050
- "build_number" : 8678.0 ,
1051
- },
1052
- {
1053
- "workspace_owner_username" : "jack" ,
1054
- "workspace_name" : "workworkwork" ,
1055
- "workspace_id" : "919db6df-48f0-4dc1-b357-9036a2c40f86" ,
1056
- "build_number" : 374.0 ,
1057
- },
1058
- },
1059
- },
1013
+ "template_version_name" : "bobby-template-version-2" ,
1014
+ "failed_count" : 1.0 ,
1015
+ "failed_builds" : []map [string ]any {
1060
1016
{
1061
- "template_version_name" : "bobby-template-version-2" ,
1062
- "failed_count" : 2.0 ,
1063
- "failed_builds" : []map [string ]any {
1064
- {
1065
- "workspace_owner_username" : "ben" ,
1066
- "workspace_name" : "more-cool-workspace" ,
1067
- "workspace_id" : "c8fb0652-9290-4bf2-a711-71b910243ac2" ,
1068
- "build_number" : 8878.0 ,
1069
- },
1070
- {
1071
- "workspace_owner_username" : "ben" ,
1072
- "workspace_name" : "less-cool-workspace" ,
1073
- "workspace_id" : "703d718d-2234-4990-9a02-5b1df6cf462a" ,
1074
- "build_number" : 8848.0 ,
1075
- },
1076
- },
1017
+ "workspace_owner_username" : "ben" ,
1018
+ "workspace_name" : "cool-workspace" ,
1019
+ "build_number" : 8888.0 ,
1077
1020
},
1078
1021
},
1079
1022
},
0 commit comments