From 216ad9df42b395ad102ceb733260bdfe0a22ef44 Mon Sep 17 00:00:00 2001 From: Elssky <1914127671@qq.com> Date: Wed, 9 Oct 2024 10:28:46 +0800 Subject: [PATCH] fix(c++,spark): clean the output directory before running unit test --- .github/workflows/ci.yml | 4 +++- .github/workflows/pyspark.yml | 6 ++++-- cpp/CMakeLists.txt | 18 ++++++++++++++++++ pyspark/Makefile | 4 ++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34ec752cb..0996df589 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,9 @@ jobs: - name: Build GraphAr working-directory: "cpp/build" - run: make -j$(nproc) + run: | + make clean_all + make -j$(nproc) - name: Test working-directory: "cpp/build" diff --git a/.github/workflows/pyspark.yml b/.github/workflows/pyspark.yml index c5f075d71..5414301d4 100644 --- a/.github/workflows/pyspark.yml +++ b/.github/workflows/pyspark.yml @@ -72,8 +72,10 @@ jobs: - name: Install Spark Scala && PySpark working-directory: pyspark - run: make install_test - + run: | + make clean + make install_test + - name: Run PyTest and Generate Coverage Report working-directory: pyspark run: make coverage_report diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d162392b8..797aaa56b 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -177,6 +177,24 @@ macro(install_graphar_target target) ) endmacro() +# ------------------------------------------------------------------------------ +# clean output data +# ------------------------------------------------------------------------------ +add_custom_target(clean_data + COMMAND ${CMAKE_COMMAND} -E remove_directory /tmp/vertex || true + COMMAND ${CMAKE_COMMAND} -E remove_directory /tmp/edge || true + COMMAND ${CMAKE_COMMAND} -E remove_directory /tmp/ldbc || true +) + +# ------------------------------------------------------------------------------ +# clean target and data +# ------------------------------------------------------------------------------ +add_custom_target(clean_all + COMMAND ${CMAKE_COMMAND} clean + COMMAND ${CMAKE_COMMAND} clean_data +) + + macro(build_graphar) file(GLOB_RECURSE CORE_SRC_FILES "src/graphar/*.cc" ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/mini-yaml/yaml/*.cpp) if(GRAPHAR_BUILD_STATIC) diff --git a/pyspark/Makefile b/pyspark/Makefile index 7e709be6b..9eff66be6 100644 --- a/pyspark/Makefile +++ b/pyspark/Makefile @@ -53,3 +53,7 @@ install_docs: .PHONY: docs docs: poetry run pdoc -t ./template --output-dir ./docs graphar_pyspark + +.PHONY: clean +clean: + rm -rf /tmp/vertex /tmp/edge /tmp/ldbc || true \ No newline at end of file