54 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
e2640c46d1 [build] Add Missing Dependencies for test/cpp/interop, test/cpp/server, test/cpp/thread_manager, test/cpp/util in Preparation for Enabling layering_check
PiperOrigin-RevId: 797690724
2025-08-21 03:36:51 -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
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
f6c57b6384 [reorg] move a bunch of stuff to src/core/util (#36792)
The following files have been moved:
- src/core/lib/avl/*
- src/core/lib/backoff/*
- src/core/lib/debug/event_log*
- src/core/lib/iomgr/gethostname*
- src/core/lib/iomgr/grpc_if_nametoindex*
- src/core/lib/matchers/*
- src/core/lib/uri/* (renamed from uri_parser.* to uri.*)
- src/core/lib/gprpp/* (existing src/core/util/time.cc was renamed to gpr_time.cc to avoid conflict)

Closes #36792

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36792 from markdroth:reorg_util d4e8996f481c611ffbb06a8b04924ff81bc1bc2b
PiperOrigin-RevId: 676947640
2024-09-20 13:19:02 -07:00
Tanvi Jagtap
154081a92a [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36678)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log
In this CL we are migrating from gRPCs own gpr logging mechanism to absl logging mechanism. The intention is to deprecate gpr_log in the future.

We have the following mapping

1. gpr_log(GPR_INFO,...) -> LOG(INFO)
2. gpr_log(GPR_ERROR,...) -> LOG(ERROR)
3. gpr_log(GPR_DEBUG,...) -> VLOG(2)

Reviewers need to check :

1. If the above mapping is correct.
2. The content of the log is as before.
gpr_log format strings did not use string_view or std::string . absl LOG accepts these. So there will be some elimination of string_view and std::string related conversions. This is expected.

Closes #36678

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36678 from tanvi-jagtap:test_cpp_gpr_log 81b8f4179f6111b902cbed9eb65ef6f41eb1e32d
PiperOrigin-RevId: 636410944
2024-05-22 21:59:06 -07:00
AJ Heller
bc5570bec8 Revert "[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD (#36607)" (#36625)
This reverts commit 15850972dd.

Breaks the bazel distribtests. https://source.cloud.google.com/results/invocations/da317d7c-5240-445f-8953-68a840ccc892/targets/%2F%2Ftools%2Fbazelify_tests%2Ftest:bazel_distribtest_6.5.0_buildtest/log

Closes #36625

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36625 from drfloob:revert-36607 395191f9c700e9b5206cef3bb44d875924602898
PiperOrigin-RevId: 633995522
2024-05-15 10:18:57 -07:00
Tanvi Jagtap
15850972dd [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD (#36607)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD
In this CL we are just editing the build and bzl files to add dependencies.
This is done to prevent merge conflict and constantly having to re-make the make files using generate_projects.sh for each set of changes.

Closes #36607

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36607 from tanvi-jagtap:build_test_cpp 3e17d778d03272cd51da86baa38b67f77760735c
PiperOrigin-RevId: 633523097
2024-05-14 03:37:04 -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
Craig Tiller
b0cf42d86e [clang-format] Remove requirement that port_platform.h is at the top (#36281)
Closes #36281

PiperOrigin-RevId: 623176865
2024-04-09 08:58:34 -07:00
Craig Tiller
67f364e23e [cleanup] Eliminate usage of GRPC_ASSERT(false...); (#31757)
* crash function

* progress

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fixes

* Automated change: Fix sanity tests

* fix

* Automated change: Fix sanity tests

* fix

* fix

* use cpp attr

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* fix

* add exclusion

* fix

* typo

* fix

* fmt

* Update tcp_socket_utils.cc

* Automated change: Fix sanity tests

* fix

* revert php changes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-01-11 08:50:32 -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
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
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
capstan
131579d52d Roll forward of commit 7883b51: Use abseil's flags in tests.
This replaces gflags. Added TODOs where use of `absl::Duration` or `absl::FlagSaver` might be preferred in follow-up cleanup. Fixes #24493.

This reverts commit da66b7d14e.

NEW:
* Adds references to `absl/flags/declare.h`, new to LTS 2020923.2 imported in commit 5b43440.
* Works around MSVC 2017 compiler error with large help text on flags by reducing the help text.
2020-11-06 16:07:19 +01:00
Nathan Herring
da66b7d14e Revert "Abseil Flags" 2020-10-24 15:19:55 -07:00
capstan
7883b5133d Use abseil's flags in tests.
This replaces gflags. Added TODOs where use of `absl::Duration` or `absl::FlagSaver` might be preferred in follow-up cleanup. Fixes #24493.
2020-10-23 19:36:33 +02:00
Lidi Zheng
c34bef4ca4 Format all Bazel files with buildifier 2019-11-05 14:03:52 -08:00
Vijay Pai
8908b58bc2 Make sure test does something 2019-10-15 23:43:28 -07:00
Vijay Pai
c2d749dea0 Fix portability issues and make more readable 2019-10-15 17:03:23 -07:00
Vijay Pai
d16c6792b0 Make thread_manager_test look like other tests 2019-10-15 15:40:56 -07:00
yang-g
67742ef63f Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
Vijay Pai
14ad82a76d Create a new method handler for resource exhaustion and tie into thread mgr 2018-08-14 16:23:21 -07:00
Sree Kuchibhotla
bdd13cb0ae Revert "Revert "Restrict the number of threads in C++ sync server"" 2018-08-01 11:22:40 -07:00
Nicolas Noble
bea98c3c1b Revert "Restrict the number of threads in C++ sync server" 2018-07-31 21:12:45 -07:00
Sree Kuchibhotla
c2a22a1ab8 Address core review comments 2018-07-27 16:19:03 -07:00
Sree Kuchibhotla
b95772eeb9 Add Tests in Core and C++ and fix a few related bugs in thread_manager.cc 2018-07-24 16:35:25 -07:00
Sree Kuchibhotla
ec1c112cc1 Each ThreadManager is a resource user 2018-07-20 15:10:16 -07:00
Muxi Yan
2a03c876ec Fix one more file 2018-03-12 14:54:55 -07: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
Jan Tattermusch
c9ec2c0888 Revert "Stop using std::thread in C++ library since it can trigger exceptions" 2018-01-12 10:16:22 +01:00
Vijay Pai
5dd32268be Switch C++ sync server to use gpr_thd rather than std::thread and provide resource exhaustion mechanism 2018-01-08 10:02:38 -08:00
Craig Tiller
4ac2b8e585 Enable clang-tidy as a sanity check, fix up all known failures 2017-11-10 14:14:17 -08:00
Craig Tiller
baa14a975e Update clang-format to 5.0 2017-11-03 09:09:36 -07:00
Jan Tattermusch
7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Craig Tiller
570fad827c Fix printf format 2017-04-29 14:56:13 -07:00
Jan Tattermusch
bd0b0546a6 windows compilation fixes 2017-02-02 00:01:09 +01:00
Vijay Pai
713c7b87e1 clang-format 2016-11-01 16:33:18 -07:00
Vijay Pai
c0b2acb1a0 Use C++11 final and override 2016-11-01 16:31:56 -07:00
Sree Kuchibhotla
14b701c114 Use nullptr instead of NULL. Move test to grpc namespace so that when using gcc4.4, we use nullptr definition in grpc++/impl/codegen/config.h 2016-10-25 14:29:10 -07:00
Sree Kuchibhotla
cb4cd3dc5d make gcc4.4 happy 2016-10-25 12:06:04 -07:00
Sree Kuchibhotla
3fc578345d Change std::atomic_int to gpr_atm since gcc4.4 is complaining 2016-10-24 16:18:13 -07:00
Sree Kuchibhotla
069c12de23 Fix thread_manager_test 2016-10-24 12:36:52 -07:00
Sree Kuchibhotla
85399f0824 clang formatting fixes 2016-10-24 09:41:20 -07:00
Sree Kuchibhotla
6135535ca7 Minor changes and called generate_projects.sh again 2016-10-20 11:17:22 -07:00