Skip to content

Commit b322574

Browse files
test(rest): assert scheme routing and widen the full-stack test's build coverage
1 parent d5c4c15 commit b322574

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

src/iceberg/resolving_file_io.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ namespace iceberg {
4545
/// from FileIORegistry with this FileIO's properties and cached. Vended
4646
/// credentials are forwarded in full to every resolved FileIO that supports
4747
/// them; each applies the prefixes it understands and ignores the rest.
48+
///
49+
/// Lazy resolution is internally synchronized, so file operations may run
50+
/// concurrently. Credentials are not: install them before sharing the instance,
51+
/// since credentials() hands out a reference that SetStorageCredentials
52+
/// replaces.
4853
class ICEBERG_EXPORT ResolvingFileIO final : public FileIO,
4954
public SupportsStorageCredentials {
5055
public:

src/iceberg/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ if(ICEBERG_BUILD_REST)
297297
add_test(NAME ${test_name} COMMAND ${test_name})
298298
endfunction()
299299

300-
if(ICEBERG_S3 AND ICEBERG_BUILD_BUNDLE)
300+
if(ICEBERG_BUILD_BUNDLE)
301301
add_rest_iceberg_test(rest_arrow_file_io_test USE_BUNDLE SOURCES
302302
rest_arrow_file_io_test.cc)
303303
endif()

src/iceberg/test/rest_arrow_file_io_test.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ TEST_F(RestArrowFileIOTest, ReadsBackWhatItWroteThroughRealLocalFileIO) {
7171
EXPECT_THAT(io.value()->DeleteFile(path), IsOk());
7272
}
7373

74-
// A break anywhere in the chain (scheme routing, credential forwarding, or the
75-
// S3 delegate dropping the `oss://` prefix) shows up as the warning.
74+
#if ICEBERG_S3_ENABLED
75+
7676
TEST_F(RestArrowFileIOTest, AppliesOssCredentialThroughRealArrowS3FileIO) {
7777
auto logger = std::make_shared<CapturingLogger>();
7878
ScopedDefaultLogger scoped(logger);
@@ -82,12 +82,16 @@ TEST_F(RestArrowFileIOTest, AppliesOssCredentialThroughRealArrowS3FileIO) {
8282
{{.prefix = "oss://bucket/table", .config = {{"k", "v"}}}});
8383
ASSERT_THAT(io, IsOk());
8484

85-
// Opening builds the delegate and applies the credential; the open itself
86-
// hits the network, so its result is irrelevant here.
87-
std::ignore = io.value()->NewInputFile("oss://bucket/table/data/file.parquet");
85+
// Opening builds the delegate and applies the credential. The open itself hits
86+
// the network, so only the failure modes before that are asserted: a routing
87+
// break surfaces as kNotSupported, and a dropped credential as the warning.
88+
auto input = io.value()->NewInputFile("oss://bucket/table/data/file.parquet");
89+
EXPECT_THAT(input, ::testing::Not(IsError(ErrorKind::kNotSupported)));
8890
EXPECT_FALSE(HasWarning(*logger));
8991
}
9092

93+
#endif // ICEBERG_S3_ENABLED
94+
9195
} // namespace
9296

9397
} // namespace iceberg::rest

0 commit comments

Comments
 (0)