Skip to content

Commit

Permalink
Fix cleaning up the test directory on windows/macos CI (#3297)
Browse files Browse the repository at this point in the history
The windows and macos CI run multiple tests in different build directories as the same user.
Since #3290 this means that the tests use the same temporary directory, and the cleanup_test may remove tests from other runs.
This uses the RUNNER_TEMP environment variable to create job-specific test directories on the runner machines
  • Loading branch information
benjaminwinger committed Apr 18, 2024
1 parent d7812e6 commit 4496f4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ jobs:

steps:
- uses: actions/checkout@v3

# For `napi.h` header.
- name: Ensure Node.js dependencies
run: npm install --include=dev
Expand Down
7 changes: 6 additions & 1 deletion test/include/test_helper/test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ class TestHelper {
static std::string getMillisecondsSuffix();

inline static std::filesystem::path getTempDir() {
return std::filesystem::temp_directory_path() / "kuzu";
auto tempDir = std::getenv("RUNNER_TEMP");
if (tempDir != nullptr) {
return std::filesystem::path(tempDir) / "kuzu";
} else {
return std::filesystem::temp_directory_path() / "kuzu";
}
}

inline static std::string getTempDir(const std::string& name) {
Expand Down

0 comments on commit 4496f4b

Please sign in to comment.