Copilot commented on code in PR #12664:
URL: https://github.com/apache/trafficserver/pull/12664#discussion_r2525172446


##########
cmake/download-proxy-verifier.cmake:
##########
@@ -0,0 +1,112 @@
+#######################
+#
+#  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.
+#
+#######################
+
+# This script downloads and extracts proxy-verifier on first execution of 
autests.
+# It is called by autest targets and autest.sh script.
+#
+# Required variables:
+#   PROXY_VERIFIER_VERSION
+#   PROXY_VERIFIER_HASH
+#   ATS_SOURCE_DIR (for locating .git directory)
+#   HOST_SYSTEM_NAME
+#   HOST_SYSTEM_PROCESSOR
+
+if(NOT PROXY_VERIFIER_VERSION)
+  message(FATAL_ERROR "PROXY_VERIFIER_VERSION Required")
+endif()
+
+if(NOT PROXY_VERIFIER_HASH)
+  message(FATAL_ERROR "PROXY_VERIFIER_HASH Required")
+endif()
+
+if(NOT ATS_SOURCE_DIR)
+  message(FATAL_ERROR "ATS_SOURCE_DIR Required")
+endif()
+
+if(NOT HOST_SYSTEM_NAME)
+  message(FATAL_ERROR "HOST_SYSTEM_NAME Required")
+endif()
+
+if(NOT HOST_SYSTEM_PROCESSOR)
+  message(FATAL_ERROR "HOST_SYSTEM_PROCESSOR Required")
+endif()
+
+# Check that .git directory exists.
+if(NOT EXISTS "${ATS_SOURCE_DIR}/.git")
+  message(FATAL_ERROR "ENABLE_AUTEST requires a .git directory (developer-only 
feature). ${ATS_SOURCE_DIR}/.git not found.")
+endif()
+
+# Determine platform subdirectory.
+if(HOST_SYSTEM_NAME STREQUAL "Linux")
+  if(HOST_SYSTEM_PROCESSOR STREQUAL "x86_64"
+     OR HOST_SYSTEM_PROCESSOR STREQUAL "amd64"
+     OR HOST_SYSTEM_PROCESSOR STREQUAL "i686"
+  )
+    set(PV_SUBDIR "linux-amd64")
+  elseif(HOST_SYSTEM_PROCESSOR STREQUAL "arm64" OR HOST_SYSTEM_PROCESSOR 
STREQUAL "aarch64")
+    set(PV_SUBDIR "linux-arm64")
+  else()
+    message(FATAL_ERROR "Unknown processor ${HOST_SYSTEM_PROCESSOR}")
+  endif()
+elseif(HOST_SYSTEM_NAME STREQUAL "Darwin")
+  if(HOST_SYSTEM_PROCESSOR STREQUAL "x86_64"
+     OR HOST_SYSTEM_PROCESSOR STREQUAL "amd64"
+     OR HOST_SYSTEM_PROCESSOR STREQUAL "i686"
+  )
+    set(PV_SUBDIR "darwin-amd64")
+  elseif(HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
+    set(PV_SUBDIR "darwin-arm64")
+  else()
+    message(FATAL_ERROR "Unknown processor ${HOST_SYSTEM_PROCESSOR}")
+  endif()
+else()
+  message(FATAL_ERROR "Host ${HOST_SYSTEM_NAME} doesnt support running proxy 
verifier")

Review Comment:
   Spelling error: "doesnt" should be "doesn't".
   ```suggestion
     message(FATAL_ERROR "Host ${HOST_SYSTEM_NAME} doesn't support running 
proxy verifier")
   ```



##########
tests/CMakeLists.txt:
##########
@@ -84,14 +86,15 @@ add_custom_target(
 add_custom_target(
   autest-uds
   COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install
+  COMMAND ${CMAKE_COMMAND} -D PROXY_VERIFIER_VERSION=${PROXY_VERIFIER_VERSION} 
-D PROXY_VERIFIER_HASH=${PROXY_VERIFIER_HASH} -D 
ATS_SOURCE_DIR=${CMAKE_SOURCE_DIR} -D 
HOST_SYSTEM_NAME=${CMAKE_HOST_SYSTEM_NAME} -D 
HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR} -P 
${CMAKE_SOURCE_DIR}/cmake/download-proxy-verifier.cmake
   COMMAND ${RUNPIPENV} install
   COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_GOLD_DIR}/h2 
${CMAKE_SKIP_GOLD_DIR}/h2
   COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_GOLD_DIR}/tls 
${CMAKE_SKIP_GOLD_DIR}/tls
   COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_GOLD_DIR}/tls_hooks 
${CMAKE_SKIP_GOLD_DIR}/tls_hooks
   COMMAND
     ${CMAKE_COMMAND} -E env 
PYTHONPATH=${CMAKE_GOLD_DIR}/remap:$ENV{PYTHONPATH} ${RUNPIPENV} run env autest 
--directory
     ${CMAKE_GOLD_DIR} --ats-bin=${CMAKE_INSTALL_PREFIX}/bin 
--proxy-verifier-bin ${PROXY_VERIFIER_PATH} --build-root
-    ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} 
${AUTEST_OPTIONS}
+    ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} 
${AUTEST_OPTIONS_LIST}
   COMMAND ${CMAKE_COMMAND} -E rename {CMAKE_SKIP_GOLD_DIR}/h2 
${CMAKE_GOLD_DIR}/h2

Review Comment:
   Missing `$` before `{CMAKE_SKIP_GOLD_DIR}`. This should be 
`${CMAKE_SKIP_GOLD_DIR}/h2` to properly reference the CMake variable.
   ```suggestion
     COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_SKIP_GOLD_DIR}/h2 
${CMAKE_GOLD_DIR}/h2
   ```



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