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

GH-39119: [C++] Refactor the Azure FS tests and filesystem class instantiation #39207

Merged
merged 26 commits into from
Dec 14, 2023

Conversation

felipecrv
Copy link
Contributor

@felipecrv felipecrv commented Dec 13, 2023

Rationale for this change

This PR contains some unrelated improvements (like better docs) and some nitpicky fixes. The test refactoring makes it easier to see on which environments tests run and make them able to be instantiated with different options in the future once we extend the AzureOptions.

What changes are included in this PR?

  • Random cleanups
  • Short namespace aliases
  • Refactoring of the tests (multiple environments, TYPED_TEST_SUITE, explicit preexisting data setup)
  • Cleanup of the AzureOptions class

Are these changes tested?

Yes. I created Azure Storage accounts to test with and without Hierarchical Namespace support. I also ran the tests in a shell without my environment variables to ensure the test-skipping behavior is correct.

Are there any user-facing changes?

Changes to AzureOptions, but since AzureFileSystem is not really used yet, these breaking changes won't be a problem.

Copy link

⚠️ GitHub issue #39119 has been automatically assigned in GitHub to PR creator.

@felipecrv
Copy link
Contributor Author

@kou @Tom-Newton @av8or1

std::string account_name_;
std::string account_key_;
bp::child server_process_;
Status status_;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more awkward status_ being set on ctor now that Make is used to construct the environments.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 13, 2023
Comment on lines 315 to 379
if (!options_res.ok() && options_res.status().IsCancelled()) {
GTEST_SKIP() << options_res.status().message();
} else {
suite_skipped_ = true;
GTEST_SKIP() << options.status().message();
EXPECT_OK_AND_ASSIGN(options_, std::move(options_res));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kou I'm explicitly checking that the Status::IsCancelled() to make sure other failures don't make the tests be skipped quietly.

@felipecrv felipecrv requested a review from kou December 13, 2023 02:24
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

I couldn't review all changes carefully because there are too many changes. But I trust you. :-)

cpp/src/arrow/filesystem/azurefs.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs.cc Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs.cc Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Dec 13, 2023
@pitrou pitrou self-requested a review December 13, 2023 17:23
@pitrou pitrou changed the title GH-39119 [C++]: Refactor the Azure FS tests GH-39119: [C++] Refactor the Azure FS tests Dec 13, 2023
cpp/src/arrow/filesystem/azurefs.h Outdated Show resolved Hide resolved
AzureBackend backend = AzureBackend::Azure;
AzureCredentialsKind credentials_kind = AzureCredentialsKind::Anonymous;
/// \brief The backend to connect to: Azure or Azurite (for testing).
AzureBackend backend = AzureBackend::kAzure;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan to autodetect the backend at some point? We do that in S3 (the DetectS3Backend function).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I have the environments, I think I can remove this option completely. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I have the environments, I think I can remove this option completely. 🤔

Do you plan to do that here or in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do on this one, but this is used to configure the URLs in AzureOptions, so I will do it in another PR where I'm adding more options to AzureOptions and documenting it better.

cpp/src/arrow/filesystem/azurefs.h Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Outdated Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Show resolved Hide resolved
cpp/src/arrow/filesystem/azurefs_test.cc Outdated Show resolved Hide resolved
@pitrou
Copy link
Member

pitrou commented Dec 14, 2023

The CI failures look unexpected, can you perhaps rebase on main?

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Let's see if tests are ok now.

@felipecrv felipecrv changed the title GH-39119: [C++] Refactor the Azure FS tests GH-39119: [C++] Refactor the Azure FS tests and filesystem class instantiation Dec 14, 2023
@felipecrv felipecrv merged commit 4e58f7c into apache:main Dec 14, 2023
34 of 35 checks passed
@felipecrv felipecrv removed the awaiting merge Awaiting merge label Dec 14, 2023
@felipecrv felipecrv deleted the azurefs_tests branch December 14, 2023 18:29
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 4e58f7c.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

clayburn pushed a commit to clayburn/arrow that referenced this pull request Jan 23, 2024
…s instantiation (apache#39207)

### Rationale for this change

This PR contains some unrelated improvements (like better docs) and some nitpicky fixes. The test refactoring makes it easier to see on which environments tests run and make them able to be instantiated with different options in the future once we extend the `AzureOptions`.

### What changes are included in this PR?

 - Random cleanups
 - Short namespace aliases
 - Refactoring of the tests (multiple environments, TYPED_TEST_SUITE, explicit preexisting data setup)
 - Cleanup of the `AzureOptions` class

### Are these changes tested?

Yes. I created Azure Storage accounts to test with and without Hierarchical Namespace support. I also ran the tests in a shell without my environment variables to ensure the test-skipping behavior is correct.

### Are there any user-facing changes?

Changes to `AzureOptions`, but since `AzureFileSystem` is not really used yet, these breaking changes won't be a problem.
* Closes: apache#39119

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…s instantiation (apache#39207)

### Rationale for this change

This PR contains some unrelated improvements (like better docs) and some nitpicky fixes. The test refactoring makes it easier to see on which environments tests run and make them able to be instantiated with different options in the future once we extend the `AzureOptions`.

### What changes are included in this PR?

 - Random cleanups
 - Short namespace aliases
 - Refactoring of the tests (multiple environments, TYPED_TEST_SUITE, explicit preexisting data setup)
 - Cleanup of the `AzureOptions` class

### Are these changes tested?

Yes. I created Azure Storage accounts to test with and without Hierarchical Namespace support. I also ran the tests in a shell without my environment variables to ensure the test-skipping behavior is correct.

### Are there any user-facing changes?

Changes to `AzureOptions`, but since `AzureFileSystem` is not really used yet, these breaking changes won't be a problem.
* Closes: apache#39119

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++][FS][Azure] Make mutations of test data explicit in azurefs_test.cc
3 participants