Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Add PYTHONPATH to tests in CMake. Ignore cmake-build-relwithdebinfo. …
Browse files Browse the repository at this point in the history
…Verbose self-driving tests. (#1611)

* Add cmake-build-relwithdebinfo to gitignore.
* Make self-driving tests extra verbose.
* Set PYTHONPATH for tests.
  • Loading branch information
lmwnshn authored Jun 10, 2021
1 parent 39d598b commit 1b8a9b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ cmake_build
.cmake_build
cmake-build-debug
cmake-build-release
cmake-build-relwithdebinfo

# Generated documentation
apidoc/doc
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ add_custom_target(jumbotests
USES_TERMINAL)
add_custom_target(self_driving_e2e_test # For now, this target is specifically used for self-driving pipeline
ctest
--extra-verbose # Print out the test output as it runs.
--resource-spec-file ${BUILD_SUPPORT_DATA_DIR}/ctest_resource_specs.json # For controlling conflicting tests.
${UNITTEST_OUTPUT_ON_FAILURE} # Whether to print output when a test fails.
-j ${NOISEPAGE_TEST_PARALLELISM} # Maximum number of parallel jobs.
Expand Down Expand Up @@ -938,7 +939,10 @@ function(add_noisepage_test
# TODO(WAN): The "modern" gtest_discover_test has a ton of files. Favoring legacy add_test for now...
add_test(${TEST_NAME} ${BUILD_SUPPORT_DIR}/run-test.sh ${CMAKE_BINARY_DIR} test ${TEST_OUTPUT_DIR}/${TEST_NAME})
# Label each test with TEST_LABEL so that ctest can run all the tests under the TEST_LABEL label later.
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${TEST_LABEL};${TEST_NAME}")
set_tests_properties(${TEST_NAME} PROPERTIES
LABELS "${TEST_LABEL};${TEST_NAME}" # Label the test.
ENVIRONMENT "PYTHONPATH=${PROJECT_SOURCE_DIR}" # Set the PYTHONPATH to project root for self-driving.
)
# Add TEST_NAME as a dependency to TEST_LABEL. Note that TEST_LABEL must be a valid target!
add_dependencies(${TEST_LABEL} ${TEST_NAME})
endfunction()
Expand Down

0 comments on commit 1b8a9b0

Please sign in to comment.