[CLIENT-4702] Convert docstring code examples to doctest format and validate them#1047
Draft
juliannguyen4 wants to merge 120 commits into
Draft
[CLIENT-4702] Convert docstring code examples to doctest format and validate them#1047juliannguyen4 wants to merge 120 commits into
juliannguyen4 wants to merge 120 commits into
Conversation
…- this may make cicd check redundant in doc tests.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1047 +/- ##
=======================================
Coverage 84.46% 84.46%
=======================================
Files 99 99
Lines 14088 14090 +2
=======================================
+ Hits 11899 11901 +2
Misses 2189 2189 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…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)
…plicate code block that shows the testblock code.
…te-code-examples-using-doctest # Conflicts: # .github/workflows/smoke-tests.yml
…te-code-examples-using-doctest
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.
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.
Extra Changes
client.udf_put(),client.udf_list(), andclient.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.Known issues introduced here
Trade-offs
Code examples are harder to run because the Python REPL gives a syntax error when it encounters>>>. As a workaround, developers have to use IPython REPL with their specific desired version of Python to copy and run the code examplesManual testing
TODO
aerospike needs to be compiled before running doctestCopying doctest formatted code into Python REPL causes syntax errors related toMoved to a different format from doctest>>>Out of scope