Skip to content

Test/rest list objects v2 queries#2013

Merged
benmcclelland merged 1 commit intomainfrom
test/rest_list_objects_v2_queries
Apr 15, 2026
Merged

Test/rest list objects v2 queries#2013
benmcclelland merged 1 commit intomainfrom
test/rest_list_objects_v2_queries

Conversation

@lrm25
Copy link
Copy Markdown
Contributor

@lrm25 lrm25 commented Apr 3, 2026

No description provided.

@lrm25 lrm25 force-pushed the test/rest_list_objects_v2_queries branch 5 times, most recently from 04d63da to 41f4721 Compare April 10, 2026 15:38
Comment thread tests/drivers/list_buckets/list_buckets_rest.sh
Comment thread tests/drivers/list_buckets/list_buckets_rest.sh
Comment thread tests/drivers/list_buckets/list_buckets_rest.sh Outdated
Comment thread tests/drivers/list_objects/list_objects_rest.sh Outdated
Comment thread tests/drivers/list_objects/list_objects_rest.sh Outdated
Comment thread tests/drivers/file.sh Outdated
Comment thread tests/drivers/rest.sh
@lrm25 lrm25 force-pushed the test/rest_list_objects_v2_queries branch 2 times, most recently from 0d25058 to 35e2399 Compare April 13, 2026 19:30
bucket_list=$(xmllint --xpath '//*[local-name()="Bucket"]/*[local-name()="Name"]/text()' "$1")
local response
if ! response=$(xmllint --xpath '//*[local-name()="Bucket"]/*[local-name()="Name"]/text()' "$1" 2>&1); then
if [[ "$response" == *"XPath set is empty" ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

xmllint often appends a newline or specific formatting to its error messages. Using a wildcard at the beginning of the check—or checking the exit status directly—makes it more bulletproof
if [[ "$response" == *"XPath set is empty"* ]]; then


local response error
if ! response=$(check_count_and_keys "$1" "$3" "${@:5}" 2>&1); then
log 2 "error checking count and keys: $xml_file"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

xml_file hasn't been defined here, it happens after this if block.

Comment thread tests/drivers/list_objects/list_objects_rest.sh

xml_data="$response"
if ! check_if_element_exists "$xml_data" "$2" "ListBucketResult" "StartAfter"; then
log 2 "error checking if element '$key' exists"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

key isn't defined here, probably mean $2?

Comment thread tests/drivers/list_objects/list_objects_rest.sh
}

list_objects_delimiter() {
run assert_param_count "ListObjects version" 1 $#
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is all using run/assert - but that should be done at the test level, not in the helpers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a common call for two tests with just a version change, can move it though

Comment thread tests/drivers/rest.sh Outdated
fi
status_line_idx=1
status_code=""
continue_count=0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

local vars?

Comment thread tests/drivers/xml.sh Outdated
return 1
fi
if check_if_element_exists "$1" "$2" "${@:3}"; then
log 2 "element '$2' should not exist in data (data: $(cat "$1"))"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a risk here is the file is really big this log line could be really bloated.

@lrm25 lrm25 force-pushed the test/rest_list_objects_v2_queries branch from 9d1f4c7 to a53e9a1 Compare April 13, 2026 22:16
@lrm25 lrm25 force-pushed the test/rest_list_objects_v2_queries branch from a53e9a1 to 1632c8c Compare April 14, 2026 21:50
@benmcclelland benmcclelland merged commit 6d3688a into main Apr 15, 2026
122 checks passed
@benmcclelland benmcclelland deleted the test/rest_list_objects_v2_queries branch April 15, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants