bneradt commented on code in PR #12350:
URL: https://github.com/apache/trafficserver/pull/12350#discussion_r2223051352


##########
tests/CMakeLists.txt:
##########
@@ -91,10 +73,26 @@ add_custom_target(
   autest_no_install
   COMMAND ${RUNPIPENV} install
   COMMAND
-    ${CMAKE_COMMAND} -E env 
PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/gold_tests/remap:$ENV{PYTHONPATH} 
${RUNPIPENV} run
-    env autest --directory ${CMAKE_CURRENT_SOURCE_DIR}/gold_tests 
--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_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}
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  USES_TERMINAL
+)
+
+# autest uds specific target that skips tests and runs with curl flag
+add_custom_target(
+  autest-uds
+  COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install
+  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 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}
+  COMMAND ${CMAKE_COMMAND} -E rename {CMAKE_SKIP_GOLD_DIR}/h2 
${CMAKE_GOLD_DIR}/h2
+  COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_SKIP_GOLD_DIR}/tls 
${CMAKE_GOLD_DIR}/tls

Review Comment:
   I assume if the test fails, the restores don't run? An autest exclude filter 
would be nice, but it doesn't support that currently. Maybe we can work on an 
autest patch for that after this PR lands (no need to hold this PR up).



##########
tests/autest.sh.in:
##########
@@ -15,3 +26,13 @@ ${RUNPIPENV} run env autest \
   --build-root ${CMAKE_BINARY_DIR} \
   ${CURL_UDS_FLAG} ${AUTEST_OPTIONS} \
   "$@"
+
+# Restore tests back to source tree
+if [ -n "${CURL_UDS_FLAG}" ]; then
+  if [ -d "${CMAKE_SKIP_GOLD_DIR}/h2" ]; then
+    mv "${CMAKE_SKIP_GOLD_DIR}/h2" "${CMAKE_GOLD_DIR}/h2"
+  fi
+  if [ -d "${CMAKE_SKIP_GOLD_DIR}/tls" ]; then
+    mv "${CMAKE_SKIP_GOLD_DIR}/tls" "${CMAKE_GOLD_DIR}/tls"
+  fi
+fi

Review Comment:
   Lets have trailing newlines. 



##########
tests/CMakeLists.txt:
##########
@@ -36,42 +36,24 @@ function(ADD_AUTEST_PLUGIN _NAME)
 endfunction()
 
 add_subdirectory(tools/plugins)
+add_subdirectory(gold_tests/chunked_encoding)
+add_subdirectory(gold_tests/continuations/plugins)
+add_subdirectory(gold_tests/jsonrpc/plugins)
+add_subdirectory(gold_tests/pluginTest/polite_hook_wait)
+add_subdirectory(gold_tests/pluginTest/tsapi)
+add_subdirectory(gold_tests/pluginTest/TSVConnFd)
+add_subdirectory(gold_tests/timeout)
+add_subdirectory(gold_tests/tls)
+
 set(RUNPIPENV PIPENV_VENV_IN_PROJECT=True ${PipEnv})
 
-set(CMAKE_GOLD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gold_tests_filtered")
+set(CMAKE_GOLD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gold_tests")
+set(CMAKE_SKIP_GOLD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/_gold_tests")

Review Comment:
   `_gold_tests` may not be obvious. Maybe `_skipped_uds_gold_tests` or the 
like?



-- 
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: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to