[CLIENT-4702] Test API doc code examples for aerospike.exception, aerospike.GeoJSON, aerospike.predicates, and aerospike.Query#1096
Draft
juliannguyen4 wants to merge 129 commits into
Conversation
…- this may make cicd check redundant in doc tests.
…rs in sphinx preview
…port it in the code examples
…e examples easier
…the TLS test which needs to be run with a different job
…uple that contains the line number where it happened which isn't important
… run boilerplate code before each example in client.rst
…y code example. It doesn't seem possible with doctest + unittest
…s to this format (takes less work)
This reverts commit 44ab356.
This reverts commit e46eae2.
This reverts commit 3eae364.
…ot being able to take in a script file
…te-code-examples-using-doctest
…nt.udf_put() was removed
…ode example doesn't show the MAC address anymore.
…t the zero result codes from put and append.
…t since it's deprecated
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1096 +/- ##
=======================================
Coverage 84.46% 84.46%
=======================================
Files 99 99
Lines 14090 14090
=======================================
Hits 11901 11901
Misses 2189 2189 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
juliannguyen4
added a commit
that referenced
this pull request
Jun 5, 2026
…st to check that code examples are valid using doctest (#1047) This addresses all the code examples in aerospike_helpers, as well as most of the code examples for aerospike and aerospike.Client. There are still some code examples aren't tested yet e.g because they are incomplete, require EE features, or I didn't have time to get to the remaining code examples in time for the next client release. There is another PR to address those: #1096 Extra Changes: - Replaced the code example for client.udf_put(), client.udf_list(), and client.udf_remove() with a higher level code example for the "User Defined Functions" section. The latter is verified to run without errors using doctest and demonstrates the outcomes of those API calls. - Add ability to copy code examples while also stripping any characters that aren't valid Python syntax - Remove bad code example for HyperLogLog class. Normally, HyperLogLog bins are created using operations or expressions. Known issues introduced here Documentation for aerospike.Client: The testsetup code block isn't visible by default, so we have to have a duplicate codeblock to show that code. This introduces some technical debt, and having the testsetup code visible is a missing feature in Sphinx: sphinx-doc/sphinx#3247
Base automatically changed from
CLIENT-4702-doc-validate-code-examples-using-doctest
to
dev
June 5, 2026 15:15
…te-code-examples-using-doctest-part2
…ectives. TODO see if there's a way to dynamically add these testcode blocks using the code examples in doc/examples.
…x doctest plugin to pick up. Delete the example python scripts now that they are inlined in the rst files
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.
TODO
doc/examplesneeds to be tested. I overlooked this in the first PR