151 Commits

Author SHA1 Message Date
Rishesh Agarwal
09218ae889 Adding layering_check and parse_headers in test files (#41226)
Closes #41226

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41226 from rishesh007:layering_test 02e735767f22e934850d5e150c5e3d577bdfbecb
PiperOrigin-RevId: 844606259
2025-12-14 23:05:28 -08:00
Craig Tiller
339906443b [clang-format] Match include file ordering to internal clang-format (#40905)
gRPC is currently getting formatted with two different clang-format implementations, and due to some weirdness they have different include file orderings. This change introduces clang-format configuration to ensure that the two systems align - it's *highly* expected that this will need some maintenance going forward as the two systems evolve.

Closes #40905

PiperOrigin-RevId: 819606209
2025-10-15 00:24:11 -07:00
Rishesh Agarwal
ecb1d4a9b7 This PR adds the missing dependencies src/core:grpc_check and :channel_arg_names to the relevant parts of the codebase
PiperOrigin-RevId: 814622149
2025-10-03 03:29:30 -07:00
Adam Heller
f5ffef4d6b [test] Add PostMortem dumps on CHECK failures in test builds (#39945)
See `grpc_check.h`. This code  redefines the abseil `CHECK*` macros using custom gRPC macros when building tests. In `bazel test ...` builds, on check failure, `PostMortemEmit()` will dump state to the log before crashing.

Caveat: to prevent circular dependencies, code that `postmortem` relies on cannot use the custom gRPC CHECK macros. This is not much code, ~50 source files. grep for the `absl/log:check` bazel dependency.

Closes #39945

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39945 from drfloob:grpc_check ca8e46718f2021e0df79aa67a3a0b0c751b3ce44
PiperOrigin-RevId: 807452496
2025-09-15 17:43:19 -07:00
Rishesh Agarwal
8eff73be73 [build] Add Missing Dependencies for test/cpp/test, test/cpp/security, test/cpp/grpclb, test/cpp/performance in Preparation for Enabling layering_check
PiperOrigin-RevId: 797264957
2025-08-20 05:07:48 -07:00
Craig Tiller
66a137f1d7 [sanity] Restore it (#38869)
Closes #38869

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38869 from ctiller:nubbins 972d734cdf45a4786de53c51b2ce8cf97a3d38ff
PiperOrigin-RevId: 731570368
2025-02-26 21:26:56 -08:00
Craig Tiller
07188632f4 Tiny formatting cleanups for portability
PiperOrigin-RevId: 731512282
2025-02-26 17:22:27 -08:00
Mark D. Roth
55b1ae9700 [build] replace grpc_proto_library rules with separate proto_library/cc_proto_library/cc_grpc_library rules (#37943)
Closes #37943

PiperOrigin-RevId: 691538475
2024-10-30 13:45:41 -07:00
Craig Tiller
dbb5164ac7 [clang-format] Remove custom clang-format rules for include ordering (#37820)
Closes #37820

PiperOrigin-RevId: 682352913
2024-10-04 09:44:20 -07:00
Mark D. Roth
0944410d6c [reorg] move test/core/util -> test/core/test_util (#36446)
Closes #36446

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36446 from markdroth:reorg_test 5dcc85e006581a8fc52a3a914baa5f33e4a21589
PiperOrigin-RevId: 629229220
2024-04-29 17:06:40 -07:00
Tanvi Jagtap
30386413c0 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36438)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

These changes have been made using string replacement and regex.

Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.

Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36438

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36438 from tanvi-jagtap:tjagtap_cpp 405efd63c33aaef551368578c06d01eb85e2a629
PiperOrigin-RevId: 628281347
2024-04-25 21:03:38 -07:00
Tanvi Jagtap
ddb785674c [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36223)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

Will not be replacing CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites.

This could be done using Cider-V once these changes are submitted if we want to clean up later. Given that we have 4000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36223

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36223 from tanvi-jagtap:assert_grpclb 205ba1d023979dd7c3bd990a8da1161d4d2f38de
PiperOrigin-RevId: 622378411
2024-04-05 23:14:29 -07:00
Mark D. Roth
148f59c15a [reorg] move LB policy code to src/core/load_balancing (#35786)
This new directory combines code from the following locations:
- src/core/ext/filters/client_channel/lb_policy
- src/core/lib/load_balancing

Closes #35786

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35786 from markdroth:client_channel_resolver_reorg 98554efb983c50c385009cd6a7df4b999932ec68
PiperOrigin-RevId: 604351832
2024-02-05 10:05:35 -08:00
ericsalo
a6823b6e97 Fix deprecation warnings from upb (#35510)
Replace "upb:collections" with "upb:message"
Replace "upb/collections" with "upb/message"
Replace "upb:upb" with "upb:mem" and/or "upb:base"
Replace "upb/upb.hpp" with "upb/mem/arena.hpp" and/or "upb/base/status.hpp"

Closes #35510

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35510 from ericsalo:master 112392a050489f59f91aa6db78e14408db75d98e
PiperOrigin-RevId: 597872730
2024-01-12 10:15:56 -08:00
Yijie Ma
f99b8b5bc4 Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Esun Kim
0ba0c4bf74 Added googletest clang-tidy checks (#31610)
* Added google-googletest

* Autofix

* Fix test names

* Fix
2022-11-18 13:02:20 -08:00
Cheng-Yu Chung
a192f155b9 Remove include/grpcpp/impl/codegen/config.h (#31061)
* Remove `include/grpcpp/impl/codegen/config.h`

* Update
2022-10-06 13:14:16 -04:00
AJ Heller
1df32ca680 Delete the EventEngine-driven iomgr implementation (#29654)
This code is not compiled by default and has fallen out of sync with the
rest of the codebase. There's a good chance it won't be used, given our
current work to use an iomgr-drive EventEngine instead.

This code will continue to live in git history, should we need to bring
pieces of it back.
2022-05-20 10:18:53 -07:00
AJ Heller
18a8f6aad9 Refactor end2end tests to exercise each EventEngine (#29202)
* Refactor end2end tests to exercise each EventEngine

* fix incorrect bazel_only exclusions

* Automated change: Fix sanity tests

* microbenchmark fix

* sanitize, fix iOS flub

* Automated change: Fix sanity tests

* iOS fix

* reviewer feedback

* first pass at excluding EventEngine test expansion

Also caught a few cases where we should not test pollers, but should
test all engines. And two cases where we likely shouldn't be testing
either product.

* end2end fuzzers to be fuzzed differently via EventEngine.

* sanitize

* reviewer feedback

* remove misleading comment

* reviewer feedback: comments

* EE test_init needs to play with our build system

* fix golden file test runner

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2022-03-30 15:43:05 -07:00
Craig Tiller
5fc3ff8203 grpc_millis -> Timestamp/Duration (#28119)
* wip

* Automated change: Fix sanity tests

* fixes

* progress

* progress

* grpc compiles

* Automated change: Fix sanity tests

* fixing tests

* x

* progress

* better code

* Automated change: Fix sanity tests

* progress

* progress

* windows fix

* Make Duration metadata trivial

* better message

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fix

* progress

* fixes

* fix

* fix

* spam

* un-disable errantly disabled tests

* gain insight

* Automated change: Fix sanity tests

* fixes

* fixes

* fix

* debug

* tweak

* fix

* fix timeout

* fix comment

* fixes

* x

* better test

* tests

* Automated change: Fix sanity tests

* missed file

* fix

* x

* fix

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* merge

* Automated change: Fix sanity tests

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-03-01 11:34:05 -08:00
Richard Belleville
468768865b Make Buildifier Sanity Test Strict (#27807)
* Fix all lint errors in repo.

* Use strict buildifier by default

* Whoops. That file does not exist

* Attempt fix to buildifier invocation

* Add missing copyright
2021-11-03 14:57:04 -07:00
Craig Tiller
d1e01ac139 Add a test for a (now-illegal) build file construct (#27602)
* Add a test for a (now-illegal) build file construct

* add to test suite!

* fix

* fix

* fix syntax
2021-10-06 07:43:59 -07:00
Craig Tiller
ea389c00c2 Adjust include order per style guide (#27175)
Introduce clang-format configuration to sort includes closer to our rules.
2021-09-08 12:14:44 -07:00
AJ Heller
25d91e3091 New iomgr implementation backed by the EventEngine API (#26026)
This code adds an iomgr implementation that's backed by an EventEngine. This uses the EventEngine API alone, and separate work will introduce an EventEngine prototype to plug into it.

See also drfloob#1: @nicolasnoble has a pull request against this branch, implementing the libuv-based EventEngine. One goal here is to implement the iomgr code such that it can be merged independently without affecting normal builds.

This implementation can be built using bazel build --cxxopt='-DGRPC_USE_EVENT_ENGINE' :all

Some shortcuts are being taken to get a working, testable version of the engine. EventEngines are not pluggable, for example.
2021-06-18 12:30:09 -07:00
Mark D. Roth
4c40ee3f78 move parse_address and sockaddr_utils out of iomgr directory (#26077)
* move parse_address and sockaddr_utils out of iomgr directory

* clang-format

* fix python

* fix for import

* fix build file for import
2021-04-30 08:21:58 -07:00
Esun Kim
62ac3f075a Added call to grpc::testing::TestEnvironment in tests 2020-07-01 11:37:57 -07:00
Esun Kim
165ee5007a Replaced grpc::string with std::string 2020-06-29 17:56:36 -07:00
Mark D. Roth
cc6414893c update bazel build dep, regenerate upb files, and add missing includes 2020-06-02 14:48:50 -07:00
Mark D. Roth
ef050280af Clean up APIs for handling grpclb protos 2019-12-13 07:53:54 -08:00
Lidi Zheng
c34bef4ca4 Format all Bazel files with buildifier 2019-11-05 14:03:52 -08:00
Esun Kim
c6b0bd08c7 Updated grpclb to use upb 2019-08-07 13:25:49 -07:00
Prashant Jaikumar
fbfb93c88f Fix C++ tests to run on iOS
- Define grpc_iomgr_run_in_background in iomgr_posix_cfstream.cc
- Use *_IF_SUPPORTED() for death tests
- Move global test init, teardown to SetUpTestCase, TearDownTestCase as GTMGoogleTestRun doesn't run main()
2019-06-20 18:16:20 -07:00
yang-g
67742ef63f Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
Vijay Pai
c90a85649b Change grpc++ references in names to grpcpp 2018-03-08 22:04:59 -08:00
Adele Zhou
1c805ec901 Add more bazel tests 2018-02-20 17:46:39 -08:00
David Garcia Quintas
249a1d7104 Removed outdated grpclb_test 2018-02-15 16:04:28 -08:00
Vijay Pai
c745690caf Internalize gpr_thd except for id and currentid 2018-02-12 11:44:52 -08:00
Noah Eisen
4d20a66685 Run clang fmt 2018-02-09 09:34:04 -08:00
Noah Eisen
be82e64b3d Autofix c casts to c++ casts 2018-02-09 09:16:55 -08:00
Mark D. Roth
209f644f04 Convert resolver API to C++. 2018-02-08 10:26:46 -08:00
Vijay Pai
ae376bf9d9 Privatize host_port.h; was not used in any wrapped language implementation 2018-01-25 23:06:24 -08:00
Mark D. Roth
dbdf495f61 Split lib/support into lib/gpr and lib/gpr++. 2018-01-18 11:21:12 -08:00
Yash Tibrewal
94e676e10f Merge pull request #13659 from grpc/revert-13658-revert-13058-execctx
Revert "Revert "All instances of exec_ctx being passed around in src/core removed""
2017-12-08 09:30:40 -08:00
David Garcia Quintas
d196658279 Merge branch 'master' of github.com:grpc/grpc into removed_expiration_interval 2017-12-06 16:16:49 -08:00
Yash Tibrewal
8cf1470a51 Revert "Revert "All instances of exec_ctx being passed around in src/core removed"" 2017-12-06 09:47:54 -08:00
Yash Tibrewal
ad4d2dde00 Revert "All instances of exec_ctx being passed around in src/core removed" 2017-12-06 09:05:05 -08:00
Yash Tibrewal
a3df36cc25 Merge pull request #13058 from yashykt/execctx
All instances of exec_ctx being passed around in src/core removed
2017-12-05 21:19:52 -08:00
Vijay Pai
43b8f8a11e Update grpclb_test.cc 2017-12-05 17:17:40 -06:00
Vijay Pai
770bf078d5 Regen projects and fix more uses of gpr_thd_new 2017-12-05 16:09:20 -06:00
Yash Tibrewal
c354269ba7 Remove _ prefixed variable names 2017-11-29 19:07:44 -08:00