Skip to content

Commit

Permalink
fix(c++,spark): clean the output directory before running unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Elssky committed Oct 9, 2024
1 parent b015a2f commit 216ad9d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pyspark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions pyspark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 216ad9d

Please sign in to comment.