imbajin commented on code in PR #3429:
URL: https://github.com/apache/hugegraph/pull/3429#discussion_r4413744023


##########
helm/hugegraph/tests/bootstrap_fresh_test.yaml:
##########
@@ -0,0 +1,254 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+suite: Experimental bootstrap fresh installs
+templates:
+- bootstrap-configmap.yaml
+- pd-statefulset.yaml
+- store-statefulset.yaml
+- server-deployment.yaml
+set:
+  fullnameOverride: cluster
+  bootstrap.enabled: true
+  pd.auth.existingSecret: fixture-pd
+  server.auth.admin.existingSecret: fixture-admin
+  server.auth.token.existingSecret: fixture-token
+tests:
+- it: records fresh 1 PD and Store topology
+  template: bootstrap-configmap.yaml
+  set: &id001
+    pd.replicas: 1
+    store.replicas: 1
+    pd.pdb.minAvailable: 1
+    store.pdb.minAvailable: 1
+  asserts:
+  - equal:
+      path: data.pdReplicas
+      value: '1'
+  - equal:
+      path: data.storeReplicas
+      value: '1'
+  - equal:
+      path: data.initialStoreCount
+      value: '1'
+  - equal:
+      path: immutable
+      value: true
+- it: initializes all 1 fresh PD voters
+  template: pd-statefulset.yaml
+  set: *id001
+  asserts:
+  - contains:
+      path: spec.template.spec.containers[0].env
+      content:
+        name: HG_PD_RAFT_PEERS_LIST
+        value: cluster-pd-0.cluster-pd.NAMESPACE.svc:8610
+  - contains:
+      path: spec.template.spec.containers[0].env
+      content:
+        name: HG_PD_INITIAL_STORE_LIST
+        value: cluster-store-0.cluster-store.NAMESPACE.svc:8500
+  - contains:
+      path: spec.template.spec.containers[0].env
+      content:
+        name: HG_PD_INITIAL_STORE_COUNT
+        value: '1'
+- it: gives fresh 1 topology matching client seeds
+  template: store-statefulset.yaml
+  set: *id001
+  asserts:
+  - contains:
+      path: spec.template.spec.containers[0].env
+      content:
+        name: HG_STORE_PD_ADDRESS
+        value: cluster-pd-0.cluster-pd.NAMESPACE.svc:8686
+- it: records fresh 3 PD and Store topology
+  template: bootstrap-configmap.yaml
+  set: &id002
+    pd.replicas: 3
+    store.replicas: 3
+    pd.pdb.minAvailable: 2
+    store.pdb.minAvailable: 2
+  asserts:
+  - equal:
+      path: data.pdReplicas
+      value: '3'
+  - equal:
+      path: data.storeReplicas
+      value: '3'
+  - equal:
+      path: initialStoreCount

Review Comment:
   Two fresh-bootstrap test assertions do not match the current templates:
   
   1. In `helm/hugegraph/tests/bootstrap_fresh_test.yaml:94`, “records fresh 3 
PD and Store topology” asserts `initialStoreCount` at the document root. 
[`bootstrap-configmap.yaml`](https://github.com/apache/hugegraph/blob/96ef3e209f389a92de6257022ca56cd920412b47/helm/hugegraph/templates/bootstrap-configmap.yaml#L29-L33)
 emits this field under `data`; please use `data.initialStoreCount`, as the 
fresh 1/5 cases already do.
   2. In [the Store3 / pinned Store1 case, 
lines193–201](https://github.com/apache/hugegraph/blob/96ef3e209f389a92de6257022ca56cd920412b47/helm/hugegraph/tests/bootstrap_fresh_test.yaml#L193-L201),
 `initialStoreCount` remains unpinned and therefore defaults to desired 
`store.replicas` (3). [The 
resolver](https://github.com/apache/hugegraph/blob/96ef3e209f389a92de6257022ca56cd920412b47/helm/hugegraph/templates/_bootstrap.tpl#L113-L135)
 rejects threshold 3 > pinned Store count 1 before reaching the Store-equality 
check, so the expected equality error is not the first error. Pin 
`bootstrap.initialStoreCount: 1` to isolate the intended equality regression, 
or deliberately assert the threshold error.
   
   These mismatches would prevent the fresh-bootstrap suite from establishing 
the intended regression coverage. This is an independent static check of the 
exact linked revision, not a reported Helm test execution: Helm is unavailable 
in this review environment. The new production guards address the previously 
reported default ConfigMap lookup, topology and count-bound issues; this 
comment is specifically about the added assertions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to