From 3ad34eecfdd2786eb102fa80c83deee824e1729f Mon Sep 17 00:00:00 2001 From: Zakhar Pilipuk Date: Fri, 23 Jun 2023 15:00:13 +0200 Subject: [PATCH] test --- .github/workflows/build_and_test.yml | 45 ++++++++++++++++++++++++++-- eventuals/then.h | 1 + test/grpc/streaming/streaming.cc | 16 ++++++---- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 1bd69a07..5d797bee 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -41,7 +41,7 @@ jobs: - os: ubuntu-latest sudo-command: "sudo" bazel-command: "dazel" - bazel-config: "--config=asan" + bazel-config: "--config=asan --test_env=ASAN_OPTIONS=detect_odr_violation=0" output-user_root: "" - os: windows-2019 sudo-command: "" # The Windows runner already runs as root. @@ -108,7 +108,7 @@ jobs: --google_credentials=${{ env.GOOGLE_APPLICATION_CREDENTIALS }}" \ >> $GITHUB_ENV - - name: Build + - name: Build eventuals run: | ${{ matrix.bazel-command }} \ ${{ matrix.output-user_root }} \ @@ -118,7 +118,46 @@ jobs: --verbose_failures \ -c dbg \ --strip="never" \ - ... + test:eventuals + + - name: Build eventuals grpc + if: runner.os != 'Windows' + run: | + ${{ matrix.bazel-command }} \ + ${{ matrix.output-user_root }} \ + build \ + ${{ matrix.bazel-config }} \ + ${{ env.BAZEL_REMOTE_CACHE }} \ + --verbose_failures \ + -c dbg \ + --strip="never" \ + test/grpc:grpc + + - name: Build route-guide + if: runner.os != 'Windows' + run: | + ${{ matrix.bazel-command }} \ + ${{ matrix.output-user_root }} \ + build \ + ${{ matrix.bazel-config }} \ + ${{ env.BAZEL_REMOTE_CACHE }} \ + --verbose_failures \ + -c dbg \ + --strip="never" \ + test/grpc/route_guide:route-guide-test + + - name: Build eventuals protobuf + if: runner.os != 'Windows' + run: | + ${{ matrix.bazel-command }} \ + ${{ matrix.output-user_root }} \ + build \ + ${{ matrix.bazel-config }} \ + ${{ env.BAZEL_REMOTE_CACHE }} \ + --verbose_failures \ + -c dbg \ + --strip="never" \ + test/protobuf:protobuf - name: Test run: | diff --git a/eventuals/then.h b/eventuals/then.h index 885e68f0..11ee644b 100644 --- a/eventuals/then.h +++ b/eventuals/then.h @@ -112,6 +112,7 @@ struct _Then final { "callable passed to 'Then' is not invocable " "with the type of argument it receives"); + return Continuation(std::move(k), std::move(f_)); } diff --git a/test/grpc/streaming/streaming.cc b/test/grpc/streaming/streaming.cc index cd1795e4..8201f044 100644 --- a/test/grpc/streaming/streaming.cc +++ b/test/grpc/streaming/streaming.cc @@ -1,5 +1,7 @@ #include "streaming.h" +#include "eventuals/task.h" + namespace eventuals::grpc::test { using keyvaluestore::Request; @@ -66,12 +68,14 @@ void test_client_behavior( ::grpc::InsecureChannelCredentials(), pool.Borrow()); - auto call = [&]() { - return client.Call< - Stream, - Stream>( - "keyvaluestore.KeyValueStore.GetValues") - >> std::move(handler); + auto call = [&]() -> Task::Of<::grpc::Status>::Raises { + return [&]() { + return client.Call< + Stream, + Stream>( + "keyvaluestore.KeyValueStore.GetValues") + >> std::move(handler); + }; }; auto status = *call();