Repository navigation
Add eight sdkharness conformance checks: file operations and bucket CRUD - #220
Open
sophiecarreras wants to merge 1 commit into
Open
sophiecarreras wants to merge 1 commit into
sophiecarreras wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds eight
conformancescenarios to the.sdkharness/contract (health is unchanged), so Backblaze's SDK quality harness can ask whether this SDK really does what its capability card claims. This is the first slice: the core file and bucket operations..sdkharness/tests.tsv: eight rows,conformance <capability> simulator ./.sdkharness/tests/run-conformance, forfiles.upload,files.download_content,files.download_by_id,files.list,files.delete_version,files.hide,files.metadataandbucket.crud..sdkharness/tests/run-conformance(bash, executable): same guards asrun-health(loopback simulator URL only, every ambientB2_*dropped, fixed test credential). It compilesconformance/Support.javaand the scenario's class withjavac --release 11against the jars the harness built, runs it, and prints oneSDKHARNESS_RESULTline. A JDK 11 single-file launch cannot import a second source file, which is why the shared helper is compiled rather than imported..sdkharness/tests/conformance/*.java: one program per scenario, using only the SDK's public API. Each one cites the B2 API pages its assertions come from, makes its ownsdkharness-conf-*buckets, and deletes everything it created, on failure too..sdkharness/README.md: what each scenario asserts and how to run one by hand.files.metadataispartialon the card (by name is emulated with an HTTP HEAD of the download URL). The check records the SDK's own HTTP requests and asserts that boundary: by id is aPOSTtob2_get_file_info, by name is aHEADof/file/<bucket>/<name>.No build or source changes. The Gradle files,
core/andhttpclient/are untouched, and.sdkharness/is in no source set. There is no test in this repository that pins the contract file.Verification
Run through the harness adapter against the pinned standalone simulator (
backblaze-labs/b2-simulatorat21a4002), with the jars the harness built from this branch's revision, under a JDK 17 launcher (and the wrapper by hand under JDK 11 forfiles.list,files.metadata,bucket.crud):files.download_content,files.download_by_id,files.list,files.delete_version,files.hide,bucket.crud,files.metadatafiles.uploadunusual name: a file namedst/upload/sp ace/...comes back asst/upload/sp+ace/...The
files.uploadfailure is a finding, not a loosened check. B2 documentsX-Bz-File-Nameas "percent-encoded UTF-8. For example, spaces should be replaced with %20" (b2_upload_file).B2StringUtil.urlEncodeisURLEncoder.encode(s, UTF8).replace("%2F", "/"), which writes a space as+, so the stored name contains a literal plus. The other legs offiles.upload(size, sha1, content type, fileInfo, listing, byte-identical download, empty file) pass before that leg runs. Whether to change the encoding is the maintainers' call; the check will go green when it does../gradlew buildis unaffected by this change.Merge note
A merge to
masterruns the existingci_cd.ymlpush steps (upload to b2, Javadoc togh-pages); this PR does not change them.Tracking: backblaze-labs/demand-side-ai#1101