steveloughran commented on code in PR #6676:
URL: https://github.com/apache/hadoop/pull/6676#discussion_r1561011696
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsClient.java:
##########
@@ -102,11 +103,31 @@ public void testListPathWithValidListMaxResultsValues()
setListMaxResults(listMaxResults);
int expectedListResultsSize =
listMaxResults > fileCount ? fileCount : listMaxResults;
- Assertions.assertThat(listPath(directory.toString())).describedAs(
- "AbfsClient.listPath result should contain %d items when "
- + "listMaxResults is %d and directory contains %d items",
- expectedListResultsSize, listMaxResults, fileCount)
- .hasSize(expectedListResultsSize);
+
+ AbfsRestOperation op = getFileSystem().getAbfsClient().listPath(
+ directory.toString(), false, getListMaxResults(), null,
+ getTestTracingContext(getFileSystem(), true));
+
+ List<ListResultEntrySchema> list =
op.getResult().getListResultSchema().paths();
+ String continuationToken =
op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_CONTINUATION);
+
+ if (continuationToken == null) {
+ // Listing is complete and number of objects should be same as expected
+ Assertions.assertThat(list)
+ .describedAs("AbfsClient.listPath() should return %d items"
+ + " when listMaxResults is %d, directory contains %d items and
"
+ + "listing is complete",
+ expectedListResultsSize, listMaxResults, fileCount)
+ .hasSize(expectedListResultsSize);
+ } else {
+ // Listing is incomplete and number of objects can be lesser than
expected
+ Assertions.assertThat(list)
+ .describedAs("AbfsClient.listPath() should return %d items"
+ + " or lesser when listMaxResults is %d, directory contains"
Review Comment:
nit: "less"
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsClient.java:
##########
@@ -102,11 +103,31 @@ public void testListPathWithValidListMaxResultsValues()
setListMaxResults(listMaxResults);
int expectedListResultsSize =
listMaxResults > fileCount ? fileCount : listMaxResults;
- Assertions.assertThat(listPath(directory.toString())).describedAs(
- "AbfsClient.listPath result should contain %d items when "
- + "listMaxResults is %d and directory contains %d items",
- expectedListResultsSize, listMaxResults, fileCount)
- .hasSize(expectedListResultsSize);
+
+ AbfsRestOperation op = getFileSystem().getAbfsClient().listPath(
+ directory.toString(), false, getListMaxResults(), null,
+ getTestTracingContext(getFileSystem(), true));
+
+ List<ListResultEntrySchema> list =
op.getResult().getListResultSchema().paths();
+ String continuationToken =
op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_CONTINUATION);
+
+ if (continuationToken == null) {
+ // Listing is complete and number of objects should be same as expected
+ Assertions.assertThat(list)
+ .describedAs("AbfsClient.listPath() should return %d items"
+ + " when listMaxResults is %d, directory contains %d items and
"
+ + "listing is complete",
+ expectedListResultsSize, listMaxResults, fileCount)
+ .hasSize(expectedListResultsSize);
+ } else {
+ // Listing is incomplete and number of objects can be lesser than
expected
Review Comment:
nit: "less"
##########
hadoop-tools/hadoop-azure/src/site/markdown/testing_azure.md:
##########
@@ -634,6 +631,8 @@ kept out of the source tree then referenced through an
XInclude element:
New files created in folder accountSettings is listed in .gitignore to
prevent accidental cred leaks.
+You are all set to run the test srcipt.
Review Comment:
typo
##########
hadoop-tools/hadoop-azure/src/site/markdown/index.md:
##########
@@ -18,8 +18,8 @@
See also:
-* [ABFS](./abfs.html)
-* [Testing](./testing_azure.html)
+* [ABFS](./abfs.md)
Review Comment:
-1. when site docs are generated *.md is mapped to *.html.
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsIntegrationTest.java:
##########
@@ -532,4 +528,36 @@ protected long assertAbfsStatistics(AbfsStatistic
statistic,
(long) metricMap.get(statistic.getStatName()));
return expectedValue;
}
+
+ protected void assumeValidTestConfigPresent(final Configuration conf, final
String key) {
+ String configuredValue = conf.get(key);
Review Comment:
tip: if you set the default to "" then the line below can just check for the
string not being empty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]