python-docs-samples
python-docs-samples copied to clipboard
[FIrestore Samples] Update tests to be self-contained and verified for correctness.
In which file did you encounter the issue?
https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/firestore/cloud-client/snippets_test.py
Describe the issue
Tests aren't self contained and also not being verified for correctness. At the moment, tests only run the samples and verify that they execute without failure. Although, tests do provide some level of support using this method, they aren't verifying state correctness of Firestore post after testing a given sample.
This may be fixed in the updated tests from @BenWhitehead.
There are a few older tests that need to have assertions added to them.
@BenWhitehead do we have the individual tests we should fix?
@crwilcox I think with your updated bootstrapping for the tests that should hopefully transparently take care of this.
@frankyn Do you have specific tests that we should double check to make sure the fix from @crwilcox addresses things?
@crwilcox PTAL
Apologies, I missed this in email.
The tests are not validating correctness and only making sure samples execute without failures.
Here's an example of a test being verified: https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/firestore/cloud-client/snippets_test.py#L74-L80
Here's an example of test not being verified: https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/firestore/cloud-client/snippets_test.py#L70-L71
I've been in touch with @BenWhitehead recently, and it is still in the pipeline.