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

test: not validating all protos in every test #24172

Merged
merged 2 commits into from Nov 23, 2022

Conversation

alyssawilk
Copy link
Contributor

Currently proto_gen_validate pulls all protos into every unit test, and every unit test validates their existence on start up. This is pretty terrible. bufbuild/protoc-gen-validate#738 pulls this out for Envoy Mobile proto-gen-validate-less builds, and so breaks all the unit tests. Changing the Envoy test framework to only validate proto registration for integration tests.

Risk Level: low (should be test only)
Testing: #24151
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #24172 (comment) was created by @alyssawilk.

see: more, trace.

@alyssawilk alyssawilk enabled auto-merge (squash) November 23, 2022 16:56
@alyssawilk
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #24172 (comment) was created by @alyssawilk.

see: more, trace.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

Thanks, overall I think this change is ok, just highlighted 2 questions regarding one of the test changes and I'd like to hear your thoughts.

@@ -47,6 +48,7 @@ BaseIntegrationTest::BaseIntegrationTest(const InstanceConstSharedPtrFn& upstrea
version_(version), upstream_address_fn_(upstream_address_fn),
config_helper_(version, *api_, config),
default_log_level_(TestEnvironment::getOptions().logLevel()) {
Envoy::Server::validateProtoDescriptors();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would like to highlight 2 questions regarding this:

  1. Is calling this outside of the mutex ok?
  2. Could there be a use of one of the validated protos before the BaseIntergrationTest c'tor is executed?

I'm less worried about 2 because this change only impacts tests, and so I guess we will see failures.
For 1, I'm guessing this is only relevant to multi-threaded use-cases, and AFAIK threading only starts after the integration test is instantiated.

Feel free to correct me if I'm wrong on any of the above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I think we're largely checking things that are registered at or before start up, so this is fine
  2. yes, but then the test will fail with a slightly less helpful warning so if the goal is to fail (it's an ASSERT not RELEASE_ASSERT) we will achieve the goal just less helpfully :-)

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

LGTM pending CI, thanks!

@alyssawilk alyssawilk merged commit 52838c4 into envoyproxy:main Nov 23, 2022
@alyssawilk alyssawilk deleted the proto_fixup branch April 5, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants