You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "seokjin0414 (via GitHub)" <gi...@apache.org> on 2026/06/23 09:50:30 UTC
[PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
seokjin0414 opened a new pull request, #3554:
URL: https://github.com/apache/iggy/pull/3554
## What
Adds BDD coverage for the C++ SDK by implementing the shared
`bdd/scenarios/basic_messaging.feature` with cucumber-cpp and wiring it into
the Docker-based BDD harness and CI, the same way the other SDKs run. This is
the second part of #2965; the messaging FFI it relies on landed in #3046.
## How it works
cucumber-cpp only supports the Cucumber wire protocol, so the step definitions
compile (via Bazel) into a wire server, and a Ruby Cucumber runner (`cucumber` +
`cucumber-wire`, pinned to the versions cucumber-cpp itself tests against) drives
the feature file over the wire against a real `iggy-server`. The step logic and
assertions are all C++ and exercise the SDK's FFI (`get_streams`, `create_stream`,
`create_topic`, `send_messages`, `poll_messages`).
The step definitions live under `foreign/cpp/bdd/` rather than `bdd/cpp/` because
the Bazel workspace root is `foreign/cpp` and cannot reach the repo-level `bdd/`
directory. `bdd/cpp/` holds the Ruby runner harness (Dockerfile, Gemfile,
`cucumber.wire`).
## Heads-up for reviewers
Because cucumber-cpp is wire-protocol-only, the C++ BDD image pulls in a Ruby
runtime (`cucumber` + `cucumber-wire`). Flagging this explicitly in case it
changes how you'd like the harness shaped.
## Verification
Ran the suite locally against a real server and the scenario passes end to end
(17 steps). The existing `//:unit` and `//:low-level-e2e` targets still build, and
`MODULE.bazel.lock` is consistent under `lockfile_mode=error`.
The TearDown fixture and the magic-number cleanup discussed on Discord are tracked
separately by @slbotbm.
Closes #2965
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4879626935
/ready
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio merged PR #3554:
URL: https://github.com/apache/iggy/pull/3554
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3553442597
##########
bdd/cpp/scripts/entrypoint.sh:
##########
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Copy the mounted shared feature files, start the cucumber-cpp wire server, then run the
+# Ruby Cucumber driver against it.
+set -euo pipefail
+
+if [ -d /app/features ]; then
+ cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true
+fi
+
+bdd_wire_server &
+server_pid=$!
+sleep 2
+
+cd /workspace/bdd/cpp || exit 1
+
+set +e
+bundle exec cucumber
Review Comment:
done — #3634. couldn't self-assign, so feel free to assign it to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4778854255
## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/3554?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 73.64%. Comparing base ([`74d62eb`](https://app.codecov.io/gh/apache/iggy/commit/74d62eb8969e84ed46728110f1d75fb73ccb6001?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`dfc8f20`](https://app.codecov.io/gh/apache/iggy/commit/dfc8f20bbe0abd2d2900866a29f10c3ae023af5d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #3554 +/- ##
============================================
- Coverage 74.41% 73.64% -0.77%
Complexity 937 937
============================================
Files 1243 1180 -63
Lines 125987 121300 -4687
Branches 101854 101768 -86
============================================
- Hits 93756 89337 -4419
+ Misses 29218 28950 -268
Partials 3013 3013
```
| [Components](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.17% <ø> (ø)` | |
| [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `62.44% <ø> (ø)` | |
| [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.10% <ø> (ø)` | |
| [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `88.88% <ø> (ø)` | |
| [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `84.29% <ø> (ø)` | |
| [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.27% <ø> (-3.86%)` | :arrow_down: |
| [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/3554/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.14% <ø> (ø)` | |
[see 81 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/3554/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4826593817
/ready
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3502386519
##########
bdd/cpp/Dockerfile:
##########
Review Comment:
done. 3-stage now: bazel-public:9.1.1 builds the wire server, ruby:3.3-slim-trixie installs the gems with bundler, and the runtime stage copies just the binary + vendored gems. final image is ~220 MB (was ~6.5 GB). e2e still green, 17/17 steps.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4848764158
/ready
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4794596733
@slbotbm the cmake route was just to keep the test self-contained in bdd/cpp without touching foreign/cpp — i didn't realize local_path_override could pull the sdk in cleanly. it can, so i switched to bazel as you suggested: bdd/cpp is its own module now, cucumber-cpp from the registry + iggy_cpp via local_path_override(../../foreign/cpp). cmake is gone.
the only change to foreign/cpp is one line — making the iggy-cpp target public so the harness can depend on it. build + the full wire e2e (17 steps) pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3521893708
##########
bdd/cpp/scripts/entrypoint.sh:
##########
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Copy the mounted shared feature files, start the cucumber-cpp wire server, then run the
+# Ruby Cucumber driver against it.
+set -euo pipefail
+
+if [ -d /app/features ]; then
+ cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true
+fi
+
+bdd_wire_server &
+server_pid=$!
+sleep 2
+
+cd /workspace/bdd/cpp || exit 1
+
+set +e
+bundle exec cucumber
Review Comment:
@slbotbm i'd like to take the rust/go ones — will open a separate pr adding --strict equivalents to both runners after this lands.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3521987813
##########
bdd/cpp/.bazelrc:
##########
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+common --enable_bzlmod
Review Comment:
and it caught its first real drift on the very first ci run: master merged #3598 (foreign/cpp rules_cc 0.2.19 → 0.2.20) after this branch's lock was generated, and ci builds the merge commit — so resolution wanted rules_cc 0.2.20 files the lock didn't know about. update mode would have re-resolved silently; error mode failed loudly. rebased onto master, synced bdd/cpp to rules_cc 0.2.20 and regenerated the lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3506932843
##########
bdd/cpp/Dockerfile:
##########
@@ -0,0 +1,71 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# C++ BDD harness, built in three stages so the runtime image carries only what the test run
+# needs (~330 MB instead of ~10 GB for a single toolchain image):
+# 1. build - Bazel builds the cucumber-cpp wire server. bdd/cpp is its own Bazel module and
+# links the Iggy C++ SDK from foreign/cpp via local_path_override; rules_rust
+# fetches its own Rust toolchain, so no system Rust is needed.
+# 2. deps - Bundler installs the Ruby Cucumber runner (compiles the ffi native extension).
+# 3. runtime - copies the wire server binary and the vendored gems, then runs cucumber.
+# cucumber-cpp v0.8.0 is wire-only: the Ruby runner reads the shared feature files and drives
+# the C++ wire server over the wire protocol.
+
+# Stage 1: build the wire server with Bazel.
+FROM gcr.io/bazel-public/bazel:9.1.1 AS build
+
+USER root
+WORKDIR /workspace
+COPY . .
+
+RUN cd bdd/cpp \
+ && bazel build //:bdd_wire_server \
+ && cp bazel-bin/bdd_wire_server /tmp/bdd_wire_server
+
+# Stage 2: install the Ruby Cucumber runner. build-essential is needed to compile the ffi
+# native extension and never reaches the runtime image.
+FROM ruby:3.3-slim-trixie AS deps
+
+RUN apt-get update && apt-get install --yes --no-install-recommends \
+ build-essential \
+ && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /workspace/bdd/cpp
+COPY bdd/cpp/Gemfile bdd/cpp/Gemfile.lock ./
+RUN gem install bundler --no-document \
Review Comment:
Let's pin bundler to a specific version
##########
bdd/cpp/features/step_definitions/background_steps.cpp:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// cucumber-cpp names its generated step classes CukeObject<__COUNTER__>, and the counter
+// restarts in every translation unit. A unique prefix per step file keeps those names from
+// colliding when several step files are linked into one wire server.
+#define CUKE_OBJECT_PREFIX IggyBddBackground
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstdlib>
+#include <string>
+
+#include "world.hpp"
+
+using cucumber::ScenarioScope;
Review Comment:
Let's remove this line and explicitly use `cucumber::ScenarioScope` whever it is called.
##########
bdd/cpp/features/step_definitions/messaging_steps.cpp:
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Unique step-class prefix so the generated CukeObject<n> symbols do not clash with the other
+// step file when linked together (see background_steps.cpp for details).
+#define CUKE_OBJECT_PREFIX IggyBddMessaging
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "world.hpp"
+
+using cucumber::ScenarioScope;
+
+GIVEN("^I have no streams in the system$") {
+ ScenarioScope<bdd::GlobalContext> context;
+ ASSERT_NE(context->client, nullptr);
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(0));
+}
+
+WHEN("^I create a stream with name \"(.*)\"$") {
Review Comment:
Let's change the regex from `(.*)` to `([^"]{1,255})` to reflect actual stream name restrictions
##########
bdd/cpp/features/step_definitions/messaging_steps.cpp:
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Unique step-class prefix so the generated CukeObject<n> symbols do not clash with the other
+// step file when linked together (see background_steps.cpp for details).
+#define CUKE_OBJECT_PREFIX IggyBddMessaging
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "world.hpp"
+
+using cucumber::ScenarioScope;
+
+GIVEN("^I have no streams in the system$") {
+ ScenarioScope<bdd::GlobalContext> context;
+ ASSERT_NE(context->client, nullptr);
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(0));
+}
+
+WHEN("^I create a stream with name \"(.*)\"$") {
Review Comment:
Also do for topic as well.
##########
bdd/cpp/features/step_definitions/messaging_steps.cpp:
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Unique step-class prefix so the generated CukeObject<n> symbols do not clash with the other
+// step file when linked together (see background_steps.cpp for details).
+#define CUKE_OBJECT_PREFIX IggyBddMessaging
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "world.hpp"
+
+using cucumber::ScenarioScope;
+
+GIVEN("^I have no streams in the system$") {
+ ScenarioScope<bdd::GlobalContext> context;
+ ASSERT_NE(context->client, nullptr);
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(0));
+}
+
+WHEN("^I create a stream with name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_stream(name);
+}
+
+THEN("^the stream should be created successfully$") {
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(1));
+}
+
+THEN("^the stream should have name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ EXPECT_EQ(std::string(stream.name), name);
+}
+
+WHEN("^I create a topic with name \"(.*)\" in stream ([0-9]+) with ([0-9]+) partitions$") {
+ REGEX_PARAM(std::string, topic_name);
+ REGEX_PARAM(int, stream_id);
+ REGEX_PARAM(int, partitions_count);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_topic(bdd::make_numeric_identifier(static_cast<std::uint32_t>(stream_id)), topic_name,
+ static_cast<std::uint32_t>(partitions_count), "none", 0, "never_expire", 0,
+ "server_default");
Review Comment:
Instead of passing strings like "server_default" and "never_expire" here, I think we can use the functions and classes in `iggy.hpp`
##########
bdd/cpp/features/step_definitions/messaging_steps.cpp:
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Unique step-class prefix so the generated CukeObject<n> symbols do not clash with the other
+// step file when linked together (see background_steps.cpp for details).
+#define CUKE_OBJECT_PREFIX IggyBddMessaging
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "world.hpp"
+
+using cucumber::ScenarioScope;
+
+GIVEN("^I have no streams in the system$") {
+ ScenarioScope<bdd::GlobalContext> context;
+ ASSERT_NE(context->client, nullptr);
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(0));
+}
+
+WHEN("^I create a stream with name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_stream(name);
+}
+
+THEN("^the stream should be created successfully$") {
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(1));
+}
+
+THEN("^the stream should have name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ EXPECT_EQ(std::string(stream.name), name);
+}
+
+WHEN("^I create a topic with name \"(.*)\" in stream ([0-9]+) with ([0-9]+) partitions$") {
+ REGEX_PARAM(std::string, topic_name);
+ REGEX_PARAM(int, stream_id);
+ REGEX_PARAM(int, partitions_count);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_topic(bdd::make_numeric_identifier(static_cast<std::uint32_t>(stream_id)), topic_name,
+ static_cast<std::uint32_t>(partitions_count), "none", 0, "never_expire", 0,
+ "server_default");
Review Comment:
can also be done for the rest of the functions. This will help us understand what the sdk is not providing right now.
##########
bdd/cpp/features/step_definitions/messaging_steps.cpp:
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Unique step-class prefix so the generated CukeObject<n> symbols do not clash with the other
+// step file when linked together (see background_steps.cpp for details).
+#define CUKE_OBJECT_PREFIX IggyBddMessaging
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "world.hpp"
+
+using cucumber::ScenarioScope;
+
+GIVEN("^I have no streams in the system$") {
+ ScenarioScope<bdd::GlobalContext> context;
+ ASSERT_NE(context->client, nullptr);
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(0));
+}
+
+WHEN("^I create a stream with name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_stream(name);
+}
+
+THEN("^the stream should be created successfully$") {
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(1));
+}
+
+THEN("^the stream should have name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ EXPECT_EQ(std::string(stream.name), name);
+}
+
+WHEN("^I create a topic with name \"(.*)\" in stream ([0-9]+) with ([0-9]+) partitions$") {
+ REGEX_PARAM(std::string, topic_name);
+ REGEX_PARAM(int, stream_id);
+ REGEX_PARAM(int, partitions_count);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_topic(bdd::make_numeric_identifier(static_cast<std::uint32_t>(stream_id)), topic_name,
+ static_cast<std::uint32_t>(partitions_count), "none", 0, "never_expire", 0,
+ "server_default");
+}
+
+THEN("^the topic should be created successfully$") {
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ EXPECT_FALSE(stream.topics.empty());
+}
+
+THEN("^the topic should have name \"(.*)\"$") {
+ REGEX_PARAM(std::string, name);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ ASSERT_FALSE(stream.topics.empty());
+ EXPECT_EQ(std::string(stream.topics[0].name), name);
+}
+
+THEN("^the topic should have ([0-9]+) partitions$") {
+ REGEX_PARAM(int, partitions_count);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ ASSERT_FALSE(stream.topics.empty());
+ EXPECT_EQ(stream.topics[0].partitions_count, static_cast<std::uint32_t>(partitions_count));
+}
+
+WHEN("^I send ([0-9]+) messages to stream ([0-9]+), topic ([0-9]+), partition ([0-9]+)$") {
+ REGEX_PARAM(int, message_count);
+ REGEX_PARAM(int, stream_id);
+ REGEX_PARAM(int, topic_id);
+ REGEX_PARAM(int, partition_id);
+ ScenarioScope<bdd::GlobalContext> context;
+
+ rust::Vec<iggy::ffi::IggyMessageToSend> messages;
+ for (int index = 0; index < message_count; ++index) {
+ iggy::ffi::IggyMessageToSend message =
+ iggy::ffi::make_message(bdd::to_payload(bdd::expected_payload(static_cast<std::uint32_t>(index))));
+ // Assign an explicit, 1-based id so the last-sent/last-polled comparison is meaningful.
+ message.id_lo = static_cast<std::uint64_t>(index + 1);
+ messages.push_back(std::move(message));
+ }
+
+ context->client->send_messages(bdd::make_numeric_identifier(static_cast<std::uint32_t>(stream_id)),
+ bdd::make_numeric_identifier(static_cast<std::uint32_t>(topic_id)), "partition_id",
+ bdd::partition_id_bytes(static_cast<std::uint32_t>(partition_id)),
+ std::move(messages));
+
+ context->sent_count = static_cast<std::uint32_t>(message_count);
+ context->last_sent_payload = bdd::expected_payload(static_cast<std::uint32_t>(message_count - 1));
+ context->last_sent_id_lo = static_cast<std::uint64_t>(message_count);
+}
+
+THEN("^all messages should be sent successfully$") {
+ ScenarioScope<bdd::GlobalContext> context;
+
+ EXPECT_GT(context->sent_count, static_cast<std::uint32_t>(0));
Review Comment:
can we tighten this to expect the exact message count?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3521902066
##########
bdd/cpp/scripts/entrypoint.sh:
##########
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Copy the mounted shared feature files, start the cucumber-cpp wire server, then run the
+# Ruby Cucumber driver against it.
+set -euo pipefail
+
+if [ -d /app/features ]; then
+ cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true
+fi
+
+bdd_wire_server &
+server_pid=$!
+sleep 2
+
+cd /workspace/bdd/cpp || exit 1
+
+set +e
+bundle exec cucumber
Review Comment:
added --strict and a guard that exits 1 when no .feature files are present after the copy. verified both holes independently before fixing: an undefined step is exit 0 without --strict and exit 1 with it, and zero feature files is exit 0 even with --strict, so the guard covers the second one. full 17-step run stays green; with an extra undefined step appended the suite now fails (17 passed / 1 undefined, exit 1).
##########
bdd/cpp/scripts/entrypoint.sh:
##########
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Copy the mounted shared feature files, start the cucumber-cpp wire server, then run the
+# Ruby Cucumber driver against it.
+set -euo pipefail
+
+if [ -d /app/features ]; then
+ cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true
+fi
+
+bdd_wire_server &
+server_pid=$!
+sleep 2
Review Comment:
replaced with a poll loop (10s cap, exit 1 with a message on timeout). one catch found while testing: the wire server accepts exactly one connection, so a connect-based probe eats the slot cucumber needs and the run dies with 'unable to contact the wire server'. the probe reads /proc/net/tcp for port 3902 in LISTEN state instead, so nothing touches the socket.
##########
bdd/cpp/features/step_definitions/messaging_steps.cpp:
##########
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Unique step-class prefix so the generated CukeObject<n> symbols do not clash with the other
+// step file when linked together (see background_steps.cpp for details).
+#define CUKE_OBJECT_PREFIX IggyBddMessaging
+
+#include <gtest/gtest.h>
+
+#include <cucumber-cpp/autodetect.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "iggy.hpp"
+#include "world.hpp"
+
+GIVEN("^I have no streams in the system$") {
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+ ASSERT_NE(context->client, nullptr);
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(0));
+}
+
+WHEN("^I create a stream with name \"([^\"]{1,255})\"$") {
+ REGEX_PARAM(std::string, name);
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ context->client->create_stream(name);
+}
+
+THEN("^the stream should be created successfully$") {
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ const auto streams = context->client->get_streams();
+ EXPECT_EQ(streams.size(), static_cast<std::size_t>(1));
+}
+
+THEN("^the stream should have name \"([^\"]{1,255})\"$") {
+ REGEX_PARAM(std::string, name);
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ EXPECT_EQ(std::string(stream.name), name);
+}
+
+WHEN("^I create a topic with name \"([^\"]{1,255})\" in stream ([0-9]+) with ([0-9]+) partitions$") {
+ REGEX_PARAM(std::string, topic_name);
+ REGEX_PARAM(int, stream_id);
+ REGEX_PARAM(int, partitions_count);
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ // Drive the SDK through the typed helpers in iggy.hpp rather than raw strings. Options that
+ // still take plain strings below (partitioning kind, consumer kind) mark where the C++ SDK
+ // does not yet expose a typed wrapper.
+ const auto compression = iggy::CompressionAlgorithm::none();
+ const auto message_expiry = iggy::Expiry::never_expire();
+ const auto max_topic_size = iggy::MaxTopicSize::server_default();
+
+ context->client->create_topic(bdd::make_numeric_identifier(static_cast<std::uint32_t>(stream_id)), topic_name,
+ static_cast<std::uint32_t>(partitions_count),
+ std::string(compression.compression_algorithm_value()), 0,
+ std::string(message_expiry.expiry_kind()), message_expiry.expiry_value(),
+ std::string(max_topic_size.max_topic_size()));
+}
+
+THEN("^the topic should be created successfully$") {
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ EXPECT_FALSE(stream.topics.empty());
+}
+
+THEN("^the topic should have name \"([^\"]{1,255})\"$") {
+ REGEX_PARAM(std::string, name);
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ ASSERT_FALSE(stream.topics.empty());
+ EXPECT_EQ(std::string(stream.topics[0].name), name);
+}
+
+THEN("^the topic should have ([0-9]+) partitions$") {
+ REGEX_PARAM(int, partitions_count);
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ const auto stream = context->client->get_stream(bdd::make_numeric_identifier(0));
+ ASSERT_FALSE(stream.topics.empty());
+ EXPECT_EQ(stream.topics[0].partitions_count, static_cast<std::uint32_t>(partitions_count));
+}
+
+WHEN("^I send ([0-9]+) messages to stream ([0-9]+), topic ([0-9]+), partition ([0-9]+)$") {
+ REGEX_PARAM(int, message_count);
+ REGEX_PARAM(int, stream_id);
+ REGEX_PARAM(int, topic_id);
+ REGEX_PARAM(int, partition_id);
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ rust::Vec<iggy::ffi::IggyMessageToSend> messages;
+ for (int index = 0; index < message_count; ++index) {
+ iggy::ffi::IggyMessageToSend message =
+ iggy::ffi::make_message(bdd::to_payload(bdd::expected_payload(static_cast<std::uint32_t>(index))));
+ // Assign an explicit, 1-based id so the last-sent/last-polled comparison is meaningful.
+ message.id_lo = static_cast<std::uint64_t>(index + 1);
+ messages.push_back(std::move(message));
+ }
+
+ const auto sent = messages.size();
+ context->client->send_messages(bdd::make_numeric_identifier(static_cast<std::uint32_t>(stream_id)),
+ bdd::make_numeric_identifier(static_cast<std::uint32_t>(topic_id)), "partition_id",
+ bdd::partition_id_bytes(static_cast<std::uint32_t>(partition_id)),
+ std::move(messages));
+
+ context->sent_count = static_cast<std::uint32_t>(sent);
+ context->messages_to_send = static_cast<std::uint32_t>(message_count);
+ context->last_sent_payload = bdd::expected_payload(static_cast<std::uint32_t>(message_count - 1));
+ context->last_sent_id_lo = static_cast<std::uint64_t>(message_count);
+}
+
+THEN("^all messages should be sent successfully$") {
+ cucumber::ScenarioScope<bdd::GlobalContext> context;
+
+ EXPECT_EQ(context->sent_count, context->messages_to_send);
Review Comment:
dropped the bookkeeping — you're right, it could never fail. the then step now just documents that send_messages() throwing in the WHEN is the real signal, same shape as the rust suite.
##########
bdd/cpp/features/step_definitions/world.hpp:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#include <cstdint>
+#include <string>
+#include <vector>
+
+#include "lib.rs.h"
+
+namespace bdd {
+
+// Plain-C++ snapshot of a poll result so the scenario context never stores cxx types
+// (rust::Vec) across steps.
+struct PolledData {
+ std::uint32_t count = 0;
+ std::uint64_t current_offset = 0;
Review Comment:
dropped the field and the assignment.
##########
bdd/cpp/Gemfile.lock:
##########
@@ -0,0 +1,61 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ builder (3.3.0)
+ cucumber (7.1.0)
+ builder (~> 3.2, >= 3.2.4)
+ cucumber-core (~> 10.1, >= 10.1.0)
+ cucumber-create-meta (~> 6.0, >= 6.0.1)
+ cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
+ cucumber-gherkin (~> 22.0, >= 22.0.0)
+ cucumber-html-formatter (~> 17.0, >= 17.0.0)
+ cucumber-messages (~> 17.1, >= 17.1.1)
+ cucumber-wire (~> 6.2, >= 6.2.0)
+ diff-lcs (~> 1.4, >= 1.4.4)
+ mime-types (~> 3.3, >= 3.3.1)
+ multi_test (~> 0.1, >= 0.1.2)
+ sys-uname (~> 1.2, >= 1.2.2)
+ cucumber-core (10.1.1)
+ cucumber-gherkin (~> 22.0, >= 22.0.0)
+ cucumber-messages (~> 17.1, >= 17.1.1)
+ cucumber-tag-expressions (~> 4.1, >= 4.1.0)
+ cucumber-create-meta (6.0.4)
+ cucumber-messages (~> 17.1, >= 17.1.1)
+ sys-uname (~> 1.2, >= 1.2.2)
+ cucumber-cucumber-expressions (14.0.0)
+ cucumber-gherkin (22.0.0)
+ cucumber-messages (~> 17.1, >= 17.1.1)
+ cucumber-html-formatter (17.0.0)
+ cucumber-messages (~> 17.1, >= 17.1.0)
+ cucumber-messages (17.1.1)
+ cucumber-tag-expressions (4.1.0)
+ cucumber-wire (6.2.1)
+ cucumber-core (~> 10.1, >= 10.1.0)
+ cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
+ diff-lcs (1.6.2)
+ ffi (1.17.4)
+ ffi (1.17.4-arm64-darwin)
+ ffi (1.17.4-x86_64-darwin)
+ logger (1.7.0)
+ memoist3 (1.0.0)
+ mime-types (3.7.0)
+ logger
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
+ mime-types-data (3.2026.0414)
+ multi_test (0.1.2)
+ sys-uname (1.5.1)
+ ffi (~> 1.1)
+ memoist3 (~> 1.0.0)
+
+PLATFORMS
Review Comment:
added x86_64-linux via bundle lock --add-platform (which also pins the precompiled ffi for the ci arch) and switched the deps stage to a frozen install, so gemfile/lock drift now fails the build instead of re-resolving.
##########
bdd/cpp/.bazelrc:
##########
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+common --enable_bzlmod
Review Comment:
added a ci config mirroring foreign/cpp (build:ci --lockfile_mode=error) and the dockerfile stage-1 build now runs with --config=ci, so the committed lock is enforced where the image is built. verified the committed lock passes error mode on amd64 before wiring it in.
##########
bdd/cpp/Dockerfile:
##########
@@ -0,0 +1,71 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# C++ BDD harness, built in three stages so the runtime image carries only what the test run
+# needs (~330 MB instead of ~10 GB for a single toolchain image):
+# 1. build - Bazel builds the cucumber-cpp wire server. bdd/cpp is its own Bazel module and
+# links the Iggy C++ SDK from foreign/cpp via local_path_override; rules_rust
+# fetches its own Rust toolchain, so no system Rust is needed.
+# 2. deps - Bundler installs the Ruby Cucumber runner (compiles the ffi native extension).
+# 3. runtime - copies the wire server binary and the vendored gems, then runs cucumber.
+# cucumber-cpp v0.8.0 is wire-only: the Ruby runner reads the shared feature files and drives
+# the C++ wire server over the wire protocol.
+
+# Stage 1: build the wire server with Bazel.
+FROM gcr.io/bazel-public/bazel:9.1.1 AS build
+
+USER root
+WORKDIR /workspace
+COPY . .
+
+RUN cd bdd/cpp \
+ && bazel build //:bdd_wire_server \
+ && cp bazel-bin/bdd_wire_server /tmp/bdd_wire_server
+
+# Stage 2: install the Ruby Cucumber runner. build-essential is needed to compile the ffi
+# native extension and never reaches the runtime image.
+FROM ruby:3.3-slim-trixie AS deps
Review Comment:
added the comment. verified it while at it: cucumber 7.1.0 on ruby 3.4.10 dies at require time with exactly that error — Hash.new(strict:, proc:) in multiline_argument/data_table.rb:78 — so the pin is indeed load-bearing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3488118458
##########
bdd/cpp/BUILD.bazel:
##########
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+load("@rules_cc//cc:defs.bzl", "cc_binary")
+
+# BDD wire server: links the C++ step definitions with cucumber-cpp's main(), which starts a
+# wire-protocol server on port 3902. A Ruby Cucumber runner drives the shared
+# basic_messaging.feature over the wire (cucumber-cpp v0.8.0 is wire-only). main() comes from
+# @cucumber-cpp//:cucumber-cpp via alwayslink, gtest provides the assertion macros, and
+# @iggy_cpp//:iggy-cpp provides the SDK (built from the sibling foreign/cpp module).
+cc_binary(
+ name = "bdd_wire_server",
+ srcs = glob([
+ "features/step_definitions/*.cpp",
+ "features/step_definitions/*.hpp",
+ ]),
+ copts = select({
+ "@platforms//os:windows": ["/utf-8"],
+ "//conditions:default": [
+ "-finput-charset=UTF-8",
+ "-fexec-charset=UTF-8",
+ ],
+ }),
+ includes = [
+ "features/step_definitions",
+ ],
+ testonly = True,
+ deps = [
+ "@cucumber-cpp//:cucumber-cpp",
+ "@googletest//:gtest",
+ "@iggy_cpp//:iggy-cpp",
+ ],
+)
Review Comment:
added all of those to the cc_binary copts, plus linkopts = ["-g"]. compiles clean under -Werror -Wpedantic.
##########
bdd/cpp/Dockerfile:
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# C++ BDD harness. bdd/cpp is a self-contained Bazel module: it builds the step definitions
+# into a cucumber-cpp wire server and pulls in the Iggy C++ SDK (foreign/cpp) via
+# local_path_override. A Ruby Cucumber runner reads the shared feature files and drives the
+# wire server over the wire protocol (cucumber-cpp v0.8.0 is wire-only). The image therefore
+# needs the Rust + Bazel + C++ toolchain (to build the wire server) and Ruby (to run cucumber).
+
+ARG RUST_VERSION=1.96
+FROM rust:${RUST_VERSION}-bookworm
+
+RUN apt-get update && apt-get install --yes --no-install-recommends \
+ build-essential \
+ ca-certificates \
+ curl \
+ git \
+ ruby-full \
+ && rm -rf /var/lib/apt/lists/*
+
+# Bazelisk resolves the Bazel version from bdd/cpp/.bazelversion.
+RUN curl -fsSL "https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-$(dpkg --print-architecture)" \
+ -o /usr/local/bin/bazel \
+ && chmod +x /usr/local/bin/bazel
+
+WORKDIR /workspace
+COPY . .
+
+# Build the cucumber-cpp wire server. bdd/cpp is its own Bazel module and links the Iggy C++
+# SDK pulled in from foreign/cpp via local_path_override.
+RUN cd bdd/cpp \
+ && bazel build //:bdd_wire_server \
+ && cp bazel-bin/bdd_wire_server /usr/local/bin/bdd_wire_server
+
+# Install the Cucumber runner (wire-protocol driver).
+RUN gem install bundler --no-document \
+ && cd bdd/cpp \
+ && bundle install
+
+RUN mkdir -p /workspace/bdd/cpp/features
+
+# Entrypoint: copy the mounted shared feature files, start the wire server, then run cucumber.
+RUN printf '%s\n' \
+ '#!/bin/bash' \
+ 'set -euo pipefail' \
+ 'if [ -d /app/features ]; then' \
+ ' cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true' \
+ 'fi' \
+ 'bdd_wire_server &' \
+ 'server_pid=$!' \
+ 'sleep 2' \
+ 'cd /workspace/bdd/cpp' \
+ 'set +e' \
+ 'bundle exec cucumber' \
+ 'status=$?' \
+ 'kill "$server_pid" 2>/dev/null || true' \
+ 'exit $status' \
+ > /entrypoint.sh \
+ && chmod +x /entrypoint.sh
Review Comment:
done — it's now bdd/cpp/scripts/entrypoint.sh (COPY'd in, shellcheck-clean).
##########
foreign/cpp/BUILD.bazel:
##########
@@ -129,6 +129,7 @@ cc_library(
deps = [
":iggy_cpp_static",
],
+ visibility = ["//visibility:public"],
)
Review Comment:
set version = "0.1.0" on the iggy_cpp module, and matched it in the bdd/cpp/MODULE.bazel bazel_dep.
##########
bdd/cpp/.bazelrc:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+common --enable_bzlmod
+
+# This harness resolves its module graph fresh in the build environment (Docker), so it does
+# not commit a MODULE.bazel.lock.
+common --lockfile_mode=off
+
+# cucumber-cpp and its transitive deps (asio, tclap, ...) are not clean under strict warnings.
+# Silence warnings for external sources so they never fail the wire-server build.
+build --per_file_copt=external/.*@-w
Review Comment:
right — removed it. the warning flags are on the target copts now, so external deps aren't affected.
##########
bdd/cpp/.bazelrc:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+common --enable_bzlmod
+
+# This harness resolves its module graph fresh in the build environment (Docker), so it does
+# not commit a MODULE.bazel.lock.
+common --lockfile_mode=off
Review Comment:
removed lockfile_mode=off and committed MODULE.bazel.lock.
##########
bdd/cpp/MODULE.bazel:
##########
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+module(
+ name = "iggy_cpp_bdd",
+)
+
+bazel_dep(name = "rules_cc", version = "0.2.18")
+bazel_dep(name = "platforms", version = "1.1.0")
+bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
+bazel_dep(name = "cucumber-cpp", version = "0.8.0.bcr.1")
Review Comment:
no — it was only used by the windows copts select, and the wire server is linux-only, so i dropped both the select and the platforms dep.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3525082702
##########
bdd/cpp/scripts/entrypoint.sh:
##########
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Copy the mounted shared feature files, start the cucumber-cpp wire server, then run the
+# Ruby Cucumber driver against it.
+set -euo pipefail
+
+if [ -d /app/features ]; then
+ cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true
+fi
+
+bdd_wire_server &
+server_pid=$!
+sleep 2
+
+cd /workspace/bdd/cpp || exit 1
+
+set +e
+bundle exec cucumber
Review Comment:
>@slbotbm i'd like to take the rust/go ones — will open a separate pr adding --strict equivalents to both runners after this lands.
@seokjin0414 could you create an issue for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4792198425
/author
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4786020784
@seokjin0414 I didn't understand why did you use cmake instead of bazel. I think it would be possible to use bazel in bdd/cpp. you could define `iggy_cpp` as a bazel dependency in `bdd/cpp/MODULE.bazel`, and then locally define the path to `iggy_cpp` as `../../foreign/cpp`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3479310990
##########
bdd/cpp/Dockerfile:
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# C++ BDD harness. bdd/cpp is a self-contained Bazel module: it builds the step definitions
+# into a cucumber-cpp wire server and pulls in the Iggy C++ SDK (foreign/cpp) via
+# local_path_override. A Ruby Cucumber runner reads the shared feature files and drives the
+# wire server over the wire protocol (cucumber-cpp v0.8.0 is wire-only). The image therefore
+# needs the Rust + Bazel + C++ toolchain (to build the wire server) and Ruby (to run cucumber).
+
+ARG RUST_VERSION=1.96
+FROM rust:${RUST_VERSION}-bookworm
+
+RUN apt-get update && apt-get install --yes --no-install-recommends \
+ build-essential \
+ ca-certificates \
+ curl \
+ git \
+ ruby-full \
+ && rm -rf /var/lib/apt/lists/*
+
+# Bazelisk resolves the Bazel version from bdd/cpp/.bazelversion.
+RUN curl -fsSL "https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-$(dpkg --print-architecture)" \
+ -o /usr/local/bin/bazel \
+ && chmod +x /usr/local/bin/bazel
+
+WORKDIR /workspace
+COPY . .
+
+# Build the cucumber-cpp wire server. bdd/cpp is its own Bazel module and links the Iggy C++
+# SDK pulled in from foreign/cpp via local_path_override.
+RUN cd bdd/cpp \
+ && bazel build //:bdd_wire_server \
+ && cp bazel-bin/bdd_wire_server /usr/local/bin/bdd_wire_server
+
+# Install the Cucumber runner (wire-protocol driver).
+RUN gem install bundler --no-document \
+ && cd bdd/cpp \
+ && bundle install
+
+RUN mkdir -p /workspace/bdd/cpp/features
+
+# Entrypoint: copy the mounted shared feature files, start the wire server, then run cucumber.
+RUN printf '%s\n' \
+ '#!/bin/bash' \
+ 'set -euo pipefail' \
+ 'if [ -d /app/features ]; then' \
+ ' cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true' \
+ 'fi' \
+ 'bdd_wire_server &' \
+ 'server_pid=$!' \
+ 'sleep 2' \
+ 'cd /workspace/bdd/cpp' \
+ 'set +e' \
+ 'bundle exec cucumber' \
+ 'status=$?' \
+ 'kill "$server_pid" 2>/dev/null || true' \
+ 'exit $status' \
+ > /entrypoint.sh \
+ && chmod +x /entrypoint.sh
Review Comment:
Let's add a real scripts/entrypoint.sh instead of creating it on the fly.
##########
bdd/cpp/BUILD.bazel:
##########
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+load("@rules_cc//cc:defs.bzl", "cc_binary")
+
+# BDD wire server: links the C++ step definitions with cucumber-cpp's main(), which starts a
+# wire-protocol server on port 3902. A Ruby Cucumber runner drives the shared
+# basic_messaging.feature over the wire (cucumber-cpp v0.8.0 is wire-only). main() comes from
+# @cucumber-cpp//:cucumber-cpp via alwayslink, gtest provides the assertion macros, and
+# @iggy_cpp//:iggy-cpp provides the SDK (built from the sibling foreign/cpp module).
+cc_binary(
+ name = "bdd_wire_server",
+ srcs = glob([
+ "features/step_definitions/*.cpp",
+ "features/step_definitions/*.hpp",
+ ]),
+ copts = select({
+ "@platforms//os:windows": ["/utf-8"],
+ "//conditions:default": [
+ "-finput-charset=UTF-8",
+ "-fexec-charset=UTF-8",
+ ],
+ }),
+ includes = [
+ "features/step_definitions",
+ ],
+ testonly = True,
+ deps = [
+ "@cucumber-cpp//:cucumber-cpp",
+ "@googletest//:gtest",
+ "@iggy_cpp//:iggy-cpp",
+ ],
+)
Review Comment:
Let's add the following flags: -Wall, -Wpedantic, -Werror, -Wextra, -g3, -O0, -fno-omit-frame-pointer, -DDEBUG
Also `linkopts = ["-g"]`
##########
foreign/cpp/BUILD.bazel:
##########
@@ -129,6 +129,7 @@ cc_library(
deps = [
":iggy_cpp_static",
],
+ visibility = ["//visibility:public"],
)
Review Comment:
Let's add a version to iggy_cpp (0.1.0)
##########
bdd/cpp/.bazelrc:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+common --enable_bzlmod
+
+# This harness resolves its module graph fresh in the build environment (Docker), so it does
+# not commit a MODULE.bazel.lock.
+common --lockfile_mode=off
+
+# cucumber-cpp and its transitive deps (asio, tclap, ...) are not clean under strict warnings.
+# Silence warnings for external sources so they never fail the wire-server build.
+build --per_file_copt=external/.*@-w
Review Comment:
By adding the flags to BUILD.bazel, this is not required anymore.
##########
bdd/cpp/MODULE.bazel:
##########
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+module(
+ name = "iggy_cpp_bdd",
+)
+
+bazel_dep(name = "rules_cc", version = "0.2.18")
+bazel_dep(name = "platforms", version = "1.1.0")
+bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
+bazel_dep(name = "cucumber-cpp", version = "0.8.0.bcr.1")
Review Comment:
Is platforms required?
##########
bdd/cpp/.bazelrc:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+common --enable_bzlmod
+
+# This harness resolves its module graph fresh in the build environment (Docker), so it does
+# not commit a MODULE.bazel.lock.
+common --lockfile_mode=off
Review Comment:
Please remove this and commit the lockfile
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4784410823
@slbotbm
no worries! ended up moving it to bdd/cpp anyway. i kept it out of foreign/cpp by building the wire server with CMake (FetchContent cucumber-cpp + the cxx staticlib) instead of Bazel, so it's self-contained like the other bdd dirs and
foreign/cpp now only carries the reserve() fix.
can switch it to a Bazel target under foreign/cpp if you'd prefer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4778404691
ignore the above, i didn't read the description😅
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4778122095
@seokjin0414 the test should be in he root bdd/ folder, not inside of foreign/cpp
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4806693168
Let's also commit the ruby lockfile as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3518898860
##########
bdd/cpp/scripts/entrypoint.sh:
##########
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Copy the mounted shared feature files, start the cucumber-cpp wire server, then run the
+# Ruby Cucumber driver against it.
+set -euo pipefail
+
+if [ -d /app/features ]; then
+ cp -f /app/features/*.feature /workspace/bdd/cpp/features/ 2>/dev/null || true
+fi
+
+bdd_wire_server &
+server_pid=$!
+sleep 2
+
+cd /workspace/bdd/cpp || exit 1
+
+set +e
+bundle exec cucumber
Review Comment:
@seokjin0414 would you like to create a PR for the rust and go bdd tests, or should i?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3554:
URL: https://github.com/apache/iggy/pull/3554#discussion_r3493263432
##########
bdd/cpp/Dockerfile:
##########
Review Comment:
Let's change this to a 3-stage build: the first stage uses `gcr.io/bazel-public/bazel:9.1.1` and builds `bdd_wire_server` using bazel, the second stage uses `ruby:3.3-slim-trixie` and installs the rube deps using bundler, and the third step also uses `ruby:3.3-slim-trixie`, copying the ruby deps + `bdd_wire_server` from previous stages and runs the test. This reduces the final image from ~10 gb to 330 mb on my machine
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(bdd): add C++ SDK BDD tests for basic messaging [iggy]
Posted by "seokjin0414 (via GitHub)" <gi...@apache.org>.
seokjin0414 commented on PR #3554:
URL: https://github.com/apache/iggy/pull/3554#issuecomment-4826579361
also addressed the two non-inline ones: added bdd/cpp/.clang-format (copied from foreign/cpp), and committed bdd/cpp/Gemfile.lock for the ruby side. rebased onto master — CI is green.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org