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

Fix failing tests #1081

Merged
merged 1 commit into from
Nov 30, 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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ find_package(Threads REQUIRED)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
Expand Down Expand Up @@ -69,6 +68,7 @@ include_directories(third_party/antlr4_runtime/src)
include_directories(third_party/spdlog)
include_directories(third_party/nlohmann_json)
include_directories(third_party/utf8proc/include)
include_directories(third_party/pybind11/include)

add_subdirectory(third_party)
add_subdirectory(src)
Expand Down
9 changes: 0 additions & 9 deletions external/Taywee_args.BUILD.bazel

This file was deleted.

9 changes: 0 additions & 9 deletions external/antlr4_runtimes.BUILD.bazel

This file was deleted.

9 changes: 0 additions & 9 deletions external/fmtlib_fmt.BUILD.bazel

This file was deleted.

9 changes: 0 additions & 9 deletions external/gabime_spdlog.BUILD.bazel

This file was deleted.

8 changes: 0 additions & 8 deletions external/nlohmann_json.BUILD.bazel

This file was deleted.

10 changes: 7 additions & 3 deletions src/common/csv_reader/csv_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,20 @@ bool CSVReader::hasNextLine() {
return true;
}
// file cursor is past the block limit, end the block, return false.
if (ftell(fd) >= readingBlockEndOffset) {
auto curPos = ftell(fd);
if (curPos >= readingBlockEndOffset) {
isEndOfBlock = true;
return false;
}
// else, read the next line. The function getline() will dynamically allocate a larger line and
// update the lineCapacity accordingly if the length of the line exceeds the lineCapacity.
// We keep curPos in case the very final line does not have a \n character in which case
// we will seek back to where we were and read it without using getLine (inside the if).
auto curPos = ftell(fd);
lineLen = getline(&line, &lineCapacity, fd);
if (lineLen == (ssize_t)-1) {
isEndOfBlock = true;
return false;
}
// Text files created on DOS/Windows machines have different line endings than files created on
// Unix/Linux. DOS uses carriage return and line feed ("\r\n") as a line ending, which Unix uses
// just line feed ("\n"). If the current line uses dos-style newline, we should replace the
Expand Down Expand Up @@ -105,7 +109,7 @@ bool CSVReader::hasNextLine() {
line = (char*)malloc(sizeOfRemainder + 1);
}
fseek(fd, curPos, SEEK_SET);
fgets(line, sizeOfRemainder + 1, fd);
fgets(line, (int)sizeOfRemainder + 1, fd);
line[sizeOfRemainder] = '\n';
lineLen = sizeOfRemainder;
}
Expand Down
2 changes: 0 additions & 2 deletions src/include/common/csv_reader/csv_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "common/types/literal.h"
#include "common/types/types_include.h"

using namespace std;

namespace spdlog {
class logger;
}
Expand Down
3 changes: 2 additions & 1 deletion src/include/processor/operator/physical_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const string PhysicalOperatorTypeNames[] = {"AGGREGATE", "AGGREGATE_SCAN", "COLU
"INDEX_SCAN", "INTERSECT_BUILD", "INTERSECT", "LIMIT", "LIST_EXTEND", "MULTIPLICITY_REDUCER",
"PROJECTION", "SCAN_REL_PROPERTY", "RESULT_COLLECTOR", "SCAN_NODE_ID", "SCAN_COLUMN_PROPERTY",
"SEMI_MASKER", "SET_STRUCTURED_NODE_PROPERTY", "SKIP", "ORDER_BY", "ORDER_BY_MERGE",
"ORDER_BY_SCAN", "UNION_ALL_SCAN", "UNWIND"};
"ORDER_BY_SCAN", "UNION_ALL_SCAN", "UNWIND", "VAR_LENGTH_ADJ_LIST_EXTEND",
"VAR_LENGTH_COLUMN_EXTEND"};

struct OperatorMetrics {

Expand Down
6 changes: 3 additions & 3 deletions src/storage/in_mem_csv_copier/in_mem_rel_csv_copier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ void InMemRelCSVCopier::populateListsTask(
copier->csvDescription.filePath, copier->csvDescription.csvReaderConfig, blockId);
skipFirstRowIfNecessary(blockId, copier->csvDescription, reader);
vector<bool> requireToReadTableLabels{true, true};
vector<nodeID_t> nodeIDs{2};
vector<DataType> nodePKTypes{2};
vector<uint64_t> reversePos{2};
vector<nodeID_t> nodeIDs(2);
vector<DataType> nodePKTypes(2);
vector<uint64_t> reversePos(2);
for (auto relDirection : REL_DIRECTIONS) {
auto nodeTableIDs =
copier->catalog.getReadOnlyVersion()->getNodeTableIDsForRelTableDirection(
Expand Down
3 changes: 3 additions & 0 deletions test/include/test_helper/test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class BaseGraphTest : public Test {
void SetUp() override {
systemConfig =
make_unique<SystemConfig>(StorageConfig::DEFAULT_BUFFER_POOL_SIZE_FOR_TESTING);
if (FileUtils::fileOrPathExists(TestHelper::getTmpTestDir())) {
FileUtils::removeDir(TestHelper::getTmpTestDir());
}
databaseConfig = make_unique<DatabaseConfig>(TestHelper::getTmpTestDir());
}

Expand Down
2 changes: 1 addition & 1 deletion test/runner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_kuzu_test(e2e_copy_csv_transaction_test e2e_copy_csv_transaction_test.cpp)
add_kuzu_test(e2e_ddl_test e2e_ddl_test.cpp)
#add_kuzu_test(e2e_delete_create_transaction_test e2e_delete_create_transaction_test.cpp)
add_kuzu_test(e2e_delete_create_transaction_test e2e_delete_create_transaction_test.cpp)
add_kuzu_test(e2e_exception_test e2e_exception_test.cpp)
add_kuzu_test(e2e_order_by_test e2e_order_by_test.cpp)
add_kuzu_test(e2e_read_list_test e2e_read_list_test.cpp)
Expand Down
2 changes: 1 addition & 1 deletion test/runner/e2e_delete_create_transaction_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class CreateRelTrxTest : public BaseDeleteCreateTrxTest {
auto createClause = "CREATE (a)-[e:knows {length:" + length + ",place:'" + place +
"',tag:" + tag + "}]->(b)";
string query = matchClause + createClause;
assert(conn->query(query));
ASSERT_TRUE(conn->query(query)->isSuccess());
}

vector<string> readAllKnowsProperty(Connection* connection, const string& srcLabel,
Expand Down
12 changes: 6 additions & 6 deletions test/runner/e2e_read_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ TEST_F(TinySnbReadTest, Unwind) {
runTest(TestHelper::appendKuzuRootPath("test/test_files/tinySNB/unwind/unwind.test"));
}

// TEST_F(TinySnbReadTest, VarLengthExtendTests) {
// runTest(TestHelper::appendKuzuRootPath(
// "test/test_files/tinySNB/var_length_extend/var_length_adj_list_extend.test"));
// runTest(TestHelper::appendKuzuRootPath(
// "test/test_files/tinySNB/var_length_extend/var_length_column_extend.test"));
//}
TEST_F(TinySnbReadTest, VarLengthExtendTests) {
runTest(TestHelper::appendKuzuRootPath(
"test/test_files/tinySNB/var_length_extend/var_length_adj_list_extend.test"));
runTest(TestHelper::appendKuzuRootPath(
"test/test_files/tinySNB/var_length_extend/var_length_column_extend.test"));
}
1 change: 1 addition & 0 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_subdirectory(antlr4_runtime)
add_subdirectory(antlr4_cypher)
add_subdirectory(utf8proc)
add_subdirectory(pybind11)
Loading