File tree 5 files changed +70
-3
lines changed
testdata/apply/008-custom-entities
5 files changed +70
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ require (
13
13
github.com/fatih/color v1.18.0
14
14
github.com/google/go-cmp v0.7.0
15
15
github.com/kong/go-apiops v0.1.42
16
- github.com/kong/go-database-reconciler v1.22.6
16
+ github.com/kong/go-database-reconciler v1.22.7
17
17
github.com/kong/go-kong v0.65.1
18
18
github.com/mitchellh/go-homedir v1.1.0
19
19
github.com/spf13/cobra v1.8.1
Original file line number Diff line number Diff line change @@ -246,8 +246,8 @@ github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/q
246
246
github.com/klauspost/cpuid/v2 v2.2.5 /go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws =
247
247
github.com/kong/go-apiops v0.1.42 h1:GF9KV1D06p/Ux2F5Dc4UJzGKFOeMzynpUWiAZwyEqxE =
248
248
github.com/kong/go-apiops v0.1.42 /go.mod h1:hKnHJ3UyeuG932SkI/yMpuT/PqSqGXNTS1zhno1lDqg =
249
- github.com/kong/go-database-reconciler v1.22.6 h1:G8rjG7057aVHem4q6tyyzEyJo3hH2weL0U9JAZk4H/0 =
250
- github.com/kong/go-database-reconciler v1.22.6 /go.mod h1:hLtPRsuxqTYv1rt6h/YrimjDQzkxlAFSIWoG1jEjWKE =
249
+ github.com/kong/go-database-reconciler v1.22.7 h1:7sjQBpGvL46pHpEdjLRUX9+D7fjk2lUsPgBTob6UguM =
250
+ github.com/kong/go-database-reconciler v1.22.7 /go.mod h1:hLtPRsuxqTYv1rt6h/YrimjDQzkxlAFSIWoG1jEjWKE =
251
251
github.com/kong/go-kong v0.65.1 h1:CM+8NlF+VbJckTxP2hGmSPKhA1GMliitXjQ7vJiPkaE =
252
252
github.com/kong/go-kong v0.65.1 /go.mod h1:sqdysTKrXIJ6mpxHwTwjgZhLW7jR1/puczTXHLUwJaE =
253
253
github.com/kong/go-slugify v1.0.0 h1:vCFAyf2sdoSlBtLcrmDWUFn0ohlpKiKvQfXZkO5vSKY =
Original file line number Diff line number Diff line change @@ -107,3 +107,37 @@ func Test_Apply_3x(t *testing.T) {
107
107
assert .Equal (t , expectedChanged , outChanged )
108
108
})
109
109
}
110
+
111
+ // test scope:
112
+ // - enterprise: >=3.0.0
113
+ // - konnect
114
+ func Test_Apply_Custom_Entities (t * testing.T ) {
115
+ runWhenEnterpriseOrKonnect (t , ">=3.0.0" )
116
+ setup (t )
117
+
118
+ ctx := context .Background ()
119
+ tests := []struct {
120
+ name string
121
+ initialStateFile string
122
+ targetPartialStateFile string
123
+ }{
124
+ {
125
+ name : "degraphql routes" ,
126
+ initialStateFile : "testdata/apply/008-custom-entities/initial-state.yaml" ,
127
+ targetPartialStateFile : "testdata/apply/008-custom-entities/partial-update.yaml" ,
128
+ },
129
+ }
130
+
131
+ for _ , tc := range tests {
132
+ t .Run (tc .name , func (t * testing.T ) {
133
+ t .Cleanup (func () {
134
+ reset (t )
135
+ })
136
+ err := sync (ctx , tc .initialStateFile )
137
+ require .NoError (t , err )
138
+
139
+ err = apply (ctx , tc .targetPartialStateFile )
140
+ require .NoError (t , err )
141
+ })
142
+ }
143
+ }
Original file line number Diff line number Diff line change
1
+ _format_version : " 3.0"
2
+ services :
3
+ - connect_timeout : 60000
4
+ enabled : true
5
+ host : example.com
6
+ name : example
7
+ plugins :
8
+ - config :
9
+ graphql_server_path : /graphql
10
+ enabled : true
11
+ name : degraphql
12
+ protocols :
13
+ - grpc
14
+ - grpcs
15
+ - http
16
+ - https
17
+ port : 443
18
+ protocol : https
19
+ read_timeout : 60000
20
+ retries : 5
21
+ write_timeout : 60000
22
+ tags :
23
+ - foo'
Original file line number Diff line number Diff line change
1
+ _format_version : " 3.0"
2
+ custom_entities :
3
+ - fields :
4
+ methods :
5
+ - GET
6
+ query : query { viewer { login } }
7
+ service :
8
+ name : example
9
+ uri : /me
10
+ type : degraphql_routes
You can’t perform that action at this time.
0 commit comments