PakhomovAlexander commented on code in PR #4598:
URL: https://github.com/apache/ignite-3/pull/4598#discussion_r1806632344


##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/metric/ItNodeMetricCommandTest.java:
##########
@@ -17,57 +17,94 @@
 
 package org.apache.ignite.internal.cli.commands.metric;
 
+import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertAll;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
 import org.apache.ignite.internal.cli.CliIntegrationTest;
-import org.junit.jupiter.api.DisplayName;
+import org.apache.ignite.rest.client.model.MetricSource;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.function.Executable;
 
 /** Tests for node metric commands. */
 class ItNodeMetricCommandTest extends CliIntegrationTest {
     private static final String NL = System.lineSeparator();
 
     @Test
-    @DisplayName("Should display disabled jvm metric source when valid 
node-url is given")
-    void nodeMetricList() {
-        // When list node metric with valid url
-        execute("node", "metric", "source", "list", "--plain", "--url", 
NODE_URL);
+    void metricEnable() {
+        // When disable cluster metric with valid url
+        execute("node", "metric", "source", "disable", "jvm", "--url", 
NODE_URL);

Review Comment:
   ```suggestion
           execute("cluster", "metric", "source", "disable", "jvm", "--url", 
NODE_URL);
   ```



##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/metric/ItClusterMetricCommandTest.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal.cli.commands.metric;
+
+import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertAll;
+
+import java.util.stream.Stream;
+import org.apache.ignite.internal.cli.CliIntegrationTest;
+import org.apache.ignite.internal.metrics.MetricSource;
+import org.junit.jupiter.api.Test;
+
+/** Tests for cluster metric commands. */

Review Comment:
   not related to the code but I would like to mention: Should we add `list` 
command?



##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/call/metric/ItMetricCallsTest.java:
##########
@@ -118,4 +121,38 @@ void nodeMetricDisable() {
         // Then
         assertThat(output.hasError()).isTrue();
     }
+
+    @Test
+    @DisplayName("Should display error message when enabling nonexistent 
metric source and cluster is up and running")

Review Comment:
   Parametrized test with Boolean source is a good candidate for this test and 
for the next one.



-- 
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]

Reply via email to