Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): add conformance tests to CI for v3 #870

Merged
merged 24 commits into from
Oct 16, 2023

Conversation

daniel-sanche
Copy link
Contributor

adds config to run conformance tests pre-submit

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Oct 5, 2023
@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Oct 5, 2023

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/python-bigtable API. label Oct 5, 2023
@daniel-sanche daniel-sanche changed the title [DRAFT] add conformance tests to CI for v3 chore(tests): add conformance tests to CI for v3 Oct 6, 2023
@daniel-sanche daniel-sanche marked this pull request as ready for review October 6, 2023 18:24
@daniel-sanche daniel-sanche requested review from a team as code owners October 6, 2023 18:24
@product-auto-label product-auto-label bot removed the size: m Pull request size is medium. label Oct 6, 2023
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Oct 6, 2023
Copy link

@danieljbruce danieljbruce left a comment

Choose a reason for hiding this comment

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

A few comments. Looking pretty good!

runs-on: ubuntu-latest
strategy:
matrix:
py-version: [ 3.8 ]

Choose a reason for hiding this comment

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

Should we test more versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Python's case is a bit complicated, since we have 2 (and soon 3) different clients we need to test. I thought it would make sense to just test the lowest Python version for now, to prevent the number of tests exploding too much. But we can easily add more in the future

popd

# Run the conformance test
pushd cloud-bigtable-clients-test/tests

Choose a reason for hiding this comment

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

Same comment as you made on my PR (googleapis/nodejs-bigtable#1349 (comment)). The push and pop are not necessary if you stay at the root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My comment was that pushd . is unnecessary if you aren't planning on changing directories

In this case, I am using pushd to move to the ./cloud-bigtable-clients-test/tests folder for the next commands, before popping back to the root

Choose a reason for hiding this comment

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

Sounds good

popd

# Stop the proxy
kill $proxyPID

Choose a reason for hiding this comment

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

Same comment Baha made here: googleapis/nodejs-bigtable#1349 (comment). Maybe we could do this in a trap so that the process always exits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed

self._emulator_host = os.getenv(BIGTABLE_EMULATOR)
if self._emulator_host is not None and credentials is None:
# use insecure channel if emulator is set
credentials = google.auth.credentials.AnonymousCredentials()

Choose a reason for hiding this comment

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

How are the credentials related to adding conformance tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this is the first time they are being run in a CI environment without GCP authentication, which was raising an error even in emulator mode

Choose a reason for hiding this comment

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

Looks good to me. It seems like this situation is a lot like something I had to do in datastore for setting insecure credentials when the emulator is being used. See https://github.com/googleapis/nodejs-datastore/pull/1164/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R516. I guess this is a bug fix as well then?

I might recommend in a future PR to also use the insecure credentials if an endpoint is provided in the constructor to hit the emulator when this environment variable is not provided.

@@ -79,54 +79,157 @@ async def ReadRows(self, request, **kwargs):
row_list.append(dict_val)
return row_list

@client_handler.error_safe

Choose a reason for hiding this comment

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

Are changes in this file necessary for the conformance tests to function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the conformance tests run through the test proxy. This is filling in some gaps in the test proxy implementation for the legacy client

Choose a reason for hiding this comment

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

Sounds good. Changes here are pretty low risk since they don't affect client behavior so I guess they can be worked on over time until all test cases are handled.

@daniel-sanche daniel-sanche merged commit 1d3a7c1 into experimental_v3 Oct 16, 2023
6 of 7 checks passed
@daniel-sanche daniel-sanche deleted the conformance_test_ci branch October 16, 2023 16:08
@danieljbruce
Copy link

LGTM

daniel-sanche added a commit that referenced this pull request Feb 5, 2024
* feat: add new v3.0.0 API skeleton (#745)

* feat: improve rows filters (#751)

* feat: read rows query model class (#752)

* feat: implement row and cell model classes (#753)

* feat: add pooled grpc transport (#748)

* feat: implement read_rows (#762)

* feat: implement mutate rows (#769)

* feat: literal value filter (#767)

* feat: row_exists and read_row (#778)

* feat: read_modify_write and check_and_mutate_row (#780)

* feat: sharded read rows (#766)

* feat: ping and warm with metadata (#810)

* feat: mutate rows batching (#770)

* chore: restructure module paths (#816)

* feat: improve timeout structure (#819)

* fix: api errors apply to all bulk mutations

* chore: reduce public api surface (#820)

* feat: improve error group tracebacks on < py11 (#825)

* feat: optimize read_rows (#852)

* chore: add user agent suffix (#842)

* feat: optimize retries (#854)

* feat: add test proxy (#836)

* chore(tests): add conformance tests to CI for v3 (#870)

* chore(tests): turn off fast fail for conformance tets (#882)

* feat: add TABLE_DEFAULTS enum for table method arguments (#880)

* fix: pass None for retry in gapic calls (#881)

* feat: replace internal dictionaries with protos in gapic calls (#875)

* chore: optimize gapic calls (#863)

* feat: expose retryable error codes to users (#879)

* chore: update api_core submodule (#897)

* chore: merge main into experimental_v3 (#900)

* chore: pin conformance tests to v0.0.2 (#903)

* fix: bulk mutation eventual success (#909)

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/python-bigtable API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants