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

Create FileHandle mock tests to enable testing of cuFile I/O path on non-GDS systems #595

Draft
wants to merge 3 commits into
base: branch-25.04
Choose a base branch
from

Conversation

kingcrimsontianyu
Copy link
Contributor

@kingcrimsontianyu kingcrimsontianyu commented Jan 24, 2025

This PR is WIP

This PR by dint of the gmock framework enables the testing of different compatibility modes uniformly on a non-GDS system for the core class FileHandle. The following cases have been mocked:

  • FileHandle constructor receives argument CompatMode::ON.
  • FileHandle constructor receives argument CompatMode::OFF. The file cannot be opened with O_DIRECT flag, and an exception is thrown.
  • FileHandle constructor receives argument CompatMode::AUTO. The file cannot be opened with O_DIRECT flag, and the compatibility mode is set to ON.

In addition, this PR slightly improves existing tests by:

  • Removing the hand-written main() and instead linking to the gtest/gmock-provided main according to gtest's recommendation;
  • Regrouping tests into different binaries, namely BASIC_IO_TEST, DEFAULTS_TEST, FILE_HANDLE_TEST;
  • Fixing the file permission definition 644 in FileHandle by removing S_IWGRP.

Addresses #556

@kingcrimsontianyu kingcrimsontianyu added improvement Improves an existing functionality non-breaking Introduces a non-breaking change c++ Affects the C++ API of KvikIO labels Jan 24, 2025
@kingcrimsontianyu kingcrimsontianyu self-assigned this Jan 24, 2025
Copy link

copy-pr-bot bot commented Jan 24, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Affects the C++ API of KvikIO improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants