Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate pytest with ctest #1090

Merged
merged 1 commit into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ debug:

test:
cd $(ROOT_DIR)/build/release/test && \
ctest && \
cd $(ROOT_DIR)/tools/python_api/test && \
pytest
ctest

clean:
rm -rf build
2 changes: 1 addition & 1 deletion src/transaction/transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ void TransactionManager::allowReceivingNewTransactions() {
}

void TransactionManager::stopNewTransactionsAndWaitUntilAllReadTransactionsLeave() {
lock_t lck{mtxForSerializingPublicFunctionCalls};
mtxForStartingNewTransactions.lock();
lock_t lck{mtxForSerializingPublicFunctionCalls};
uint64_t numTimesWaited = 0;
while (true) {
if (!activeReadOnlyTransactionIDs.empty()) {
Expand Down
14 changes: 14 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ add_subdirectory(processor)
add_subdirectory(runner)
add_subdirectory(storage)
add_subdirectory(transaction)

function(add_kuzu_python_api_test TEST_NAME FILE_NAME)
add_test(NAME PythonAPI.${TEST_NAME}
COMMAND ${PYTHON_EXECUTABLE} -m pytest ${PROJECT_SOURCE_DIR}/tools/python_api/test/${FILE_NAME}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tools/python_api/test)
endfunction()

add_kuzu_python_api_test(DataType test_datatype.py)
add_kuzu_python_api_test(PandaAPI test_df.py)
add_kuzu_python_api_test(Exception test_exception.py)
add_kuzu_python_api_test(GetHeader test_get_header.py)
add_kuzu_python_api_test(Main test_main.py)
add_kuzu_python_api_test(Parameter test_parameter.py)
add_kuzu_python_api_test(WriteToCSV test_write_to_csv.py)