Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/ci-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,35 @@ jobs:
run: make check-format

- name: Build
run: make -j8
run: |
# Build the libraries first to avoid possible link failures
cmake --build . -j8 --target pulsarShared pulsarStatic
cmake --build . -j8

- name: Run unit tests
run: RETRY_FAILED=3 ./run-unit-tests.sh

cpp20-build:
name: Build with the C++20 standard
runs-on: ubuntu-22.04
timeout-minutes: 60

steps:
- name: checkout
uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt-get update -y
sudo apt-get install -y libcurl4-openssl-dev libssl-dev \
protobuf-compiler libprotobuf-dev libboost-dev \
libboost-dev libboost-program-options-dev \
libzstd-dev libsnappy-dev libgmock-dev libgtest-dev
- name: CMake
run: cmake -B build -DBUILD_PERF_TOOLS=ON -DCMAKE_CXX_STANDARD=20
- name: Build
run: |
cmake --build build -j8 --target pulsarShared pulsarStatic
cmake --build build -j8

cpp-build-windows:
timeout-minutes: 120
Expand Down Expand Up @@ -281,7 +305,7 @@ jobs:
check-completion:
name: Check Completion
runs-on: ubuntu-latest
needs: [wireshark-dissector-build, unit-tests, cpp-build-windows, package, cpp-build-macos]
needs: [wireshark-dissector-build, unit-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos]

steps:
- run: true
4 changes: 2 additions & 2 deletions lib/ObjectPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ class ObjectPool {
}

private:
ObjectPool<Type, MaxSize>(const ObjectPool<Type, MaxSize>&);
ObjectPool<Type, MaxSize>& operator=(const ObjectPool<Type, MaxSize>&);
ObjectPool(const ObjectPool<Type, MaxSize>&);
ObjectPool& operator=(const ObjectPool<Type, MaxSize>&);
};
} // namespace pulsar
#endif /* LIB_OBJECTPOOL_H_ */
1 change: 1 addition & 0 deletions lib/ProducerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "OpSendMsg.h"
#include "ProducerConfigurationImpl.h"
#include "PulsarApi.pb.h"
#include "Semaphore.h"
#include "TimeUtils.h"
#include "TopicName.h"
#include "stats/ProducerStatsDisabled.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/ProducerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "PendingFailures.h"
#include "PeriodicTask.h"
#include "ProducerImplBase.h"
#include "Semaphore.h"

namespace pulsar {

Expand All @@ -53,6 +52,7 @@ class PulsarFriend;

class Producer;
class MemoryLimitController;
class Semaphore;
class TopicName;
struct OpSendMsg;

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ file(GLOB TEST_SOURCES *.cc c/*.cc)

add_executable(pulsar-tests ${TEST_SOURCES} ${PROTO_SOURCES})

target_include_directories(pulsar-tests PRIVATE ${PROJECT_SOURCE_DIR}/lib ${AUTOGEN_DIR}/lib)
target_include_directories(pulsar-tests PRIVATE ${AUTOGEN_DIR}/lib)

target_link_libraries(pulsar-tests ${CLIENT_LIBS} pulsarStatic $<$<CONFIG:Debug>:${GMOCKD_LIBRARY_PATH}> $<$<CONFIG:Debug>:${GTESTD_LIBRARY_PATH}> $<$<NOT:$<CONFIG:Debug>>:${GMOCK_LIBRARY_PATH}> $<$<NOT:$<CONFIG:Debug>>:${GTEST_LIBRARY_PATH}>)

Expand Down
2 changes: 1 addition & 1 deletion tests/InterceptorsTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <utility>

#include "HttpHelper.h"
#include "Latch.h"
#include "lib/Latch.h"
#include "lib/LogUtils.h"

DECLARE_LOG_OBJECT()
Expand Down
3 changes: 2 additions & 1 deletion tests/KeyValueImplTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
#include <KeyValueImpl.h>
#include <gtest/gtest.h>

#include "lib/KeyValueImpl.h"

using namespace pulsar;

TEST(KeyValueTest, testEncodeAndDeCode) {
Expand Down
8 changes: 4 additions & 4 deletions tests/LookupServiceTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
#include <BinaryProtoLookupService.h>
#include <Future.h>
#include <HTTPLookupService.h>
#include <Utils.h>
#include <gtest/gtest.h>
#include <pulsar/Authentication.h>
#include <pulsar/Client.h>
Expand All @@ -31,11 +27,15 @@

#include "HttpHelper.h"
#include "PulsarFriend.h"
#include "lib/BinaryProtoLookupService.h"
#include "lib/ClientConnection.h"
#include "lib/ConnectionPool.h"
#include "lib/Future.h"
#include "lib/HTTPLookupService.h"
#include "lib/LogUtils.h"
#include "lib/RetryableLookupService.h"
#include "lib/TimeUtils.h"
#include "lib/Utils.h"

DECLARE_LOG_OBJECT()

Expand Down
2 changes: 1 addition & 1 deletion tests/MessageChunkingTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <ctime>
#include <random>

#include "ChunkMessageIdImpl.h"
#include "PulsarFriend.h"
#include "WaitUtils.h"
#include "lib/ChunkMessageIdImpl.h"
#include "lib/LogUtils.h"

DECLARE_LOG_OBJECT()
Expand Down
2 changes: 1 addition & 1 deletion tests/MessageTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <string>

#include "MessageImpl.h"
#include "lib/MessageImpl.h"

using namespace pulsar;
TEST(MessageTest, testMessageContents) {
Expand Down
2 changes: 1 addition & 1 deletion tests/SchemaTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <pulsar/Client.h>

#include "PulsarFriend.h"
#include "SharedBuffer.h"
#include "lib/SharedBuffer.h"

using namespace pulsar;

Expand Down
4 changes: 2 additions & 2 deletions tests/TableViewTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <future>

#include "HttpHelper.h"
#include "LogUtils.h"
#include "PulsarFriend.h"
#include "TopicName.h"
#include "WaitUtils.h"
#include "lib/LogUtils.h"
#include "lib/TopicName.h"

using namespace pulsar;

Expand Down
3 changes: 2 additions & 1 deletion tests/c/c_SeekTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
* under the License.
*/

#include <TimeUtils.h>
#include <gtest/gtest.h>
#include <pulsar/c/client.h>

#include <future>

#include "lib/TimeUtils.h"

struct seek_ctx {
std::promise<pulsar_result> *promise;
};
Expand Down