-
Notifications
You must be signed in to change notification settings - Fork 59
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
test: Add conformance tests #1349
test: Add conformance tests #1349
Conversation
Add conformance tests that use the test proxy to ensure the client is running correctly.
🤖 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 -- conventional-commit-lint bot |
Warning: This pull request is touching the following templated files:
|
This reverts commit aa18af6.
If the yaml config sets up node then the node test proxy can be tested.
This reverts commit 2bb0eed.
This reverts commit 80d5569.
This reverts commit 359d413.
Add execution permissions to the conformance shell file.
The path for the known failures is wrong and needs to be corrected.
Errors out because skip has no argument
The proxy address needs to be set to where the test proxy is listening
The known failures should be added to the file so that those tests can be skipped
By putting all the test names on one line maybe they will all be picked up to be skipped rather than just one of them.
conformance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? Looks like a duplicate of the step below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet it's not needed, but I'm not completely sure. The PR in Java has this twice so I figured there must be a reason it is there https://github.com/googleapis/java-bigtable/pull/1699/files. I'll investigate further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been informed by @liujiongxin this check is probably for the Java client repo itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that makes sense. I forgot there were two repos involved!
.github/workflows/conformance.yaml
Outdated
path: cloud-bigtable-clients-test | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be useful to test with multiple node versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
testproxy/known_failures.txt
Outdated
@@ -0,0 +1 @@ | |||
TestCheckAndMutateRow_NoRetry_TransientError\|TestCheckAndMutateRow_Generic_Headers\|TestCheckAndMutateRow_Generic_DeadlineExceeded\|TestMutateRow_Generic_Headers\|TestMutateRow_Generic_DeadlineExceeded\|TestMutateRows_Generic_CloseClient\|TestReadModifyWriteRow_Generic_Headers\|TestReadModifyWriteRow_NoRetry_TransientError\|TestReadModifyWriteRow_Generic_DeadlineExceeded\|TestReadRow_Generic_DeadlineExceeded\|TestReadRows_Retry_PausedScan\|TestReadRows_Retry_StreamReset\|TestMutateRows_Generic_DeadlineExceeded\|TestSampleRowKeys_Generic_Headers\|TestReadRows_Generic_DeadlineExceeded\|TestReadRows_Generic_CloseClient\|TestSampleRowKeys_Generic_DeadlineExceeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little unsure if we should be skipping all these tests, maybe we should just let the test stay red until these are fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's look into this further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have two test paths: default and all tests enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answer to review comments.
conformance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet it's not needed, but I'm not completely sure. The PR in Java has this twice so I figured there must be a reason it is there https://github.com/googleapis/java-bigtable/pull/1699/files. I'll investigate further.
.github/workflows/conformance.yaml
Outdated
path: cloud-bigtable-clients-test | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
testproxy/known_failures.txt
Outdated
@@ -0,0 +1 @@ | |||
TestCheckAndMutateRow_NoRetry_TransientError\|TestCheckAndMutateRow_Generic_Headers\|TestCheckAndMutateRow_Generic_DeadlineExceeded\|TestMutateRow_Generic_Headers\|TestMutateRow_Generic_DeadlineExceeded\|TestMutateRows_Generic_CloseClient\|TestReadModifyWriteRow_Generic_Headers\|TestReadModifyWriteRow_NoRetry_TransientError\|TestReadModifyWriteRow_Generic_DeadlineExceeded\|TestReadRow_Generic_DeadlineExceeded\|TestReadRows_Retry_PausedScan\|TestReadRows_Retry_StreamReset\|TestMutateRows_Generic_DeadlineExceeded\|TestSampleRowKeys_Generic_Headers\|TestReadRows_Generic_DeadlineExceeded\|TestReadRows_Generic_CloseClient\|TestSampleRowKeys_Generic_DeadlineExceeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's look into this further.
The conformance tests may catch more issues to do with streaming and such if more versions of node are covered.
cd $(dirname $0)/.. | ||
|
||
# Build and start the proxy in a separate process | ||
pushd . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pushd and popd shouldn't be necessary if you stay at the root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly would you suggest here if we eliminate pushd and popd? I tried subshells locally https://unix.stackexchange.com/questions/13802/execute-a-specific-command-in-a-given-directory-without-cding-to-it, but the command hangs.
Looking at this further, I think in the Java example we wanted to go back to the root because we wanted to run https://github.com/googleapis/java-bigtable/pull/1699/files#diff-08b007a16e10891ada78edba8173c7323e74500fa6e1600c5e1dc7a721df5388R62. Since we don't need to run anything else in this script after the golang tests however, I think we can eliminate pushd .
and popd
and not worry about staying at the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushd and popd are only needed if you're changing directories. In the case of this specific block , it seems like a no-op, so yeah it makes sense to remove it
Alternatively, you could replace all the cd
statements with pushd
statements, which can be a lot cleaner if you have to move around the filesystem. But since this script is pretty simple, you can probably just stick with the cds
you have
.kokoro/conformance.sh
Outdated
# Run the conformance test | ||
pushd . | ||
pwd | ||
ls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was pwd and ls added for debugging? Can probably remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. These debugging commands have been removed now.
pwd and ls should not be left in the script
These two commands are unnecessary as nothing is run after them.
.kokoro/conformance.sh
Outdated
RETURN_CODE=$? | ||
|
||
# Stop the proxy | ||
kill $proxyPID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be executed irrespective of when / how script exits. Exit traps can be used here. E.g. https://github.com/googleapis/google-cloud-go/blob/5de394be14cf852b99dde65fbeba3d02714f6845/storage/emulator_test.sh#L64-L70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Makes sense. So would you suggest adding trap kill $proxyPID
somewhere at the top of the file and removing this line? In that case would any exit signal still get propogated up to the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a cleanup function.
Trap on EXIT signal which would catch any exit signal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the trap change pushed? I don't see the changes here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is called "Add a cleanup operation"
As required, remove the list of known failures
The cleanup operation should happen no matter how the program exits.
Add conformance tests that use the test proxy to ensure the client is running correctly. This PR should be very similar to https://github.com/googleapis/java-bigtable/pull/1699 which adds conformance tests to java-bigtable. A list of known test failures is also provided so that we only test against the test proxy tests that pass and our continuous integration pipeline passes. The idea is that we want to reduce this list over time as the test proxy improves.