Commit Graph

9 Commits

Author SHA1 Message Date
Dennis Oberst 584a971d35 QGrpc{Channel, Call}Options: prefer 'set~()' over 'with~()'
It was concluded that we will use the 'set~()' syntax in our options but
still return a reference to allow chaining.

Task-number: QTBUG-123625
Change-Id: I00838465b485d096b4b7bd3d691d24385543d662
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-28 10:54:19 +02:00
Dennis Oberst d6134c6e11 Add QGrpcDuration: a typedef for std::chrono::milliseconds
std::chrono::milliseconds is already widely used in our API. Qt-ify
it for foresighted API and implementation design.

Task-number: QTBUG-120696
Change-Id: I03650045ee3c93f59b88864932dfe72442dc0925
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-06 15:26:28 +02:00
Alexey Edelev 5b84714ac3 Rewrite the test server in golang
The server requires JSON serialization support for our testing purposes,
C++ API doesn't allow using JSON serialization in gRPC channels, but
the golang one allows. This introduces the different gRPC server
implementation that serve out needs. golang-base server only available
for the host Qt builds if QT_ALLOW_DOWNLOAD is enabled.

The reference C++ server is still used for cross-compiled Qt and
for the cases when go is not present in the system.

Task-number: QTBUG-113777
Change-Id: I9d821d56e5da629604e197707dbead2d5367f844
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-02-21 14:30:06 +01:00
Alexey Edelev 76c05ac9d5 Add JSON serialization support to QGrpcHttp2Channel
It's now possible to preselect the serialization format when creating
the channel using the 'Content-Type' metadata. Supported values for the
header:
 - application/grpc(default)
 - application/grpc+protobuf
 - application/grpc+json

Note: Not all servers and clients support JSON serialization format.

Task-number: QTBUG-113777
Change-Id: Ia25b3382e3addb2306acce112489ea3427687c0d
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-21 14:30:03 +01:00
Alexey Edelev cc54dccb64 End the native gRPC channel support
Remove the native gRPC channel implementation, respective feature and
tests.

Pick-to: 6.7
Change-Id: I71ef99746bb842d24f634ad52c77fee94edbe86f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-02-12 12:23:40 +01:00
Alexey Edelev ad6c1128c0 Implement unix:// sockets support
Add the support for the UNIX sockets to QGrpcHttp2Channel. The channel
only supports the non-encrypted communicatoin.

Pick-to: 6.7
Task-number: QTBUG-119074
Change-Id: Ie404999d7511a783e4d1504a0ac51e5fc97f23ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-02-12 08:28:01 +01:00
Alexey Edelev bc424839f1 Refactor tst_grpc_client_no_channel test
Rename the test to tst_grpc_client_deadline. Use GrpcClientTestBase
as the test base. Add WithChannelDeadline channel to GrpcClientTestBase.

Pick-to: 6.6 6.7
Change-Id: I6125f68f40b26ba645a97721641123d01a5387b2
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-01-11 16:25:18 +01:00
Alexey Edelev 5189fddaed Refactor the way gRPC test are running
Add the ssl channels to tests. Run the test server with SSL channel
enabled by default.

Add the --latency option to the test server. Server now uses the value
provided by test runner instead of using the global definition.

Rename the test server-related targets, so the have grpc_ prefix now.
The previous name was too generic.

Adjust SSL tests and use GrpcClientTestBase with SslNoCredentials
channels.

Pick-to: 6.6 6.7
Task-number: QTBUG-119207
Change-Id: Ib5cf9d05db62f542f5fc9bf4de1d5af93e6864e0
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-11 14:29:05 +01:00
Alexey Edelev c1f9432294 Split client test into unary call and server stream tests
Add the GrpcClientTestBase class and the tst_grpc_client_test_common
library that should be used for all grpc client tests. Split the
client tests into unary call and server stream parts.

Pick-to: 6.5 6.6
Change-Id: Ia5b01f0975ebb4a368aaf9d563e3107f707fd3af
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-08-29 10:53:05 +02:00