Copilot commented on code in PR #279:
URL: 
https://github.com/apache/maven-artifact-plugin/pull/279#discussion_r4480242415


##########
src/it/compare-missing-artifact/verify.groovy:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+// check existence of generated compare in target
+File compareFile = new File( basedir, 
"target/missing-artifact-1.0-SNAPSHOT.buildcompare" );
+assert compareFile.isFile()
+
+String compare = compareFile.text
+
+assert compare.contains( "version=1.0-SNAPSHOT" )
+
+// the main jar always differs (non-reproducible jar plugin version): 1 "ko"
+// the extra classifier jar was never part of the reference build: 1 "missing"
+// they must be reported as disjoint counts, not double-counted into ko
+assert compare.contains( "ko=1" )
+assert compare.contains( "missing=1" )
+assert compare.contains( 'koFiles="missing-artifact-1.0-SNAPSHOT.jar"' )
+assert compare.contains( 
'missingFiles="missing-artifact-1.0-SNAPSHOT-extra.jar"' )

Review Comment:
   Using `String.contains(...)` for key/value assertions can produce false 
positives (e.g., `ko=10` will satisfy `contains("ko=1")`) and can make the IT 
flaky if formatting/order changes. Consider loading the `.buildcompare` file as 
a properties-style map (or using regex with line/key boundaries) and asserting 
exact values for `ko`, `missing`, `koFiles`, and `missingFiles`.



##########
src/it/compare-missing-artifact/verify.groovy:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+// check existence of generated compare in target
+File compareFile = new File( basedir, 
"target/missing-artifact-1.0-SNAPSHOT.buildcompare" );
+assert compareFile.isFile()
+
+String compare = compareFile.text
+
+assert compare.contains( "version=1.0-SNAPSHOT" )
+
+// the main jar always differs (non-reproducible jar plugin version): 1 "ko"
+// the extra classifier jar was never part of the reference build: 1 "missing"
+// they must be reported as disjoint counts, not double-counted into ko
+assert compare.contains( "ko=1" )
+assert compare.contains( "missing=1" )
+assert compare.contains( 'koFiles="missing-artifact-1.0-SNAPSHOT.jar"' )
+assert compare.contains( 
'missingFiles="missing-artifact-1.0-SNAPSHOT-extra.jar"' )

Review Comment:
   Using `String.contains(...)` for key/value assertions can produce false 
positives (e.g., `ko=10` will satisfy `contains("ko=1")`) and can make the IT 
flaky if formatting/order changes. Consider loading the `.buildcompare` file as 
a properties-style map (or using regex with line/key boundaries) and asserting 
exact values for `ko`, `missing`, `koFiles`, and `missingFiles`.



##########
src/it/compare-missing-artifact/invoker.properties:
##########
@@ -0,0 +1,23 @@
+# 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.
+
+# initial reference build: install, without the extra classifier
+invoker.goals.1=clean install
+# second build: produce the extra classifier too, then compare (could be 
package, but not install

Review Comment:
   The comment has an unclosed parenthesis, which reads like a typo. Close the 
parenthesis (and optionally punctuate) to avoid confusion.



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