Skip to content

Commit

Permalink
Try CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kenneth-jia committed Jul 1, 2024
1 parent a146d10 commit cf35e89
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Checks: "*,\
-llvmlibc-restrict-system-libc-headers,\
-llvmlibc-callee-namespace,\
-llvmlibc-implementation-in-namespace,\
-llvmlibc-inline-function-decl,\
-altera-*,\
-fuchsia-*,\
-google-readability-namespace-comments,\
Expand All @@ -14,6 +15,7 @@ Checks: "*,\
-modernize-deprecated-headers,\
-modernize-use-trailing-return-type,\
-modernize-concat-nested-namespaces,\
-modernize-type-traits,\
-hicpp-special-member-functions,\
-hicpp-vararg,\
-hicpp-no-malloc,\
Expand All @@ -36,15 +38,22 @@ Checks: "*,\
-cppcoreguidelines-pro-type-union-access,\
-misc-non-private-member-variables-in-classes,\
-misc-no-recursion,\
-misc-include-cleaner,\
-readability-magic-numbers,\
-readability-implicit-bool-conversion,\
-readability-braces-around-statements,\
-readability-isolate-declaration,\
-readability-identifier-length,\
-readability-function-cognitive-complexity,\
-readability-avoid-nested-conditional-operator,\
-bugprone-empty-catch,\
-bugprone-unused-return-value,\
-bugprone-easily-swappable-parameters,\
-bugprone-exception-escape,\
-bugprone-optional-value-conversion,\
-cert-err58-cpp,\
-performance-avoid-endl,\
-performance-enum-size,\
-clang-analyzer-optin.performance.Padding"


22 changes: 14 additions & 8 deletions .github/workflows/kafka_api_ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,21 @@ jobs:
# Install googletest
vcpkg install gtest
cp -v "C:\VCPKG\INSTALLED\x86-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x86-windows\lib\"
cp -v "C:\VCPKG\INSTALLED\x86-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x86-windows\lib\"
ls "C:\VCPKG\INSTALLED"
ls "C:\VCPKG\INSTALLED\x64-windows"
ls "C:\VCPKG\INSTALLED\x64-windows\lib"
cp -v "C:\VCPKG\INSTALLED\x64-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x64-windows\lib\"
cp -v "C:\VCPKG\INSTALLED\x64-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x64-windows\lib\"
# Install boost headers/libraries
vcpkg install boost-optional
vcpkg install boost-algorithm
vcpkg install boost-program-options
cp -v "C:\VCPKG\INSTALLED\x86-windows\lib\boost_program_options-vc140-mt.lib" "C:\VCPKG\INSTALLED\x86-windows\lib\boost_program_options.lib"
ls "C:\VCPKG\INSTALLED\x64-windows\lib"
cp -v "C:\VCPKG\INSTALLED\x64-windows\lib\boost_program_options-vc144-mt-x64-1_85.lib" "C:\VCPKG\INSTALLED\x64-windows\lib\boost_program_options.lib"
# Install rapidjson
vcpkg install rapidjson
Expand All @@ -319,11 +325,11 @@ jobs:
run: |
cd $Env:BUILD_SUB_DIR
$Env:GTEST_ROOT='C:\VCPKG\INSTALLED\x86-windows\'
$Env:BOOST_ROOT='C:\VCPKG\INSTALLED\x86-windows\'
$Env:LIBRDKAFKA_INCLUDE_DIR='C:\VCPKG\INSTALLED\x86-windows\include\'
$Env:LIBRDKAFKA_LIBRARY_DIR='C:\VCPKG\INSTALLED\x86-windows\lib\'
$Env:RAPIDJSON_INCLUDE_DIRS='C:\VCPKG\INSTALLED\x86-windows\include\'
$Env:GTEST_ROOT='C:\VCPKG\INSTALLED\x64-windows\'
$Env:BOOST_ROOT='C:\VCPKG\INSTALLED\x64-windows\'
$Env:LIBRDKAFKA_INCLUDE_DIR='C:\VCPKG\INSTALLED\x64-windows\include\'
$Env:LIBRDKAFKA_LIBRARY_DIR='C:\VCPKG\INSTALLED\x64-windows\lib\'
$Env:RAPIDJSON_INCLUDE_DIRS='C:\VCPKG\INSTALLED\x64-windows\include\'
cmake -B ./ -A Win32 -S ../.. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kafka_api_demo_conan_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Prepare
run: |
pip3 install conan==1.59.0
pip3 install conan==1.64.1
- name: Build (non-windows)
if: ${{!contains(matrix.os, 'windows')}}
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-local-kafka-cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def main():
cmd = 'lsof -nP -iTCP:{0} | grep LISTEN'.format(brokerPort)
cmdCall = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(out, err) = cmdCall.communicate();
matched = re.search('[^\s-]+ +([0-9]+) +.*', out.decode('utf-8'))
matched = re.search(r'[^\s-]+ +([0-9]+) +.*', out.decode('utf-8'))
if matched:
kafkaBrokerPids.append(matched.group(1))

Expand Down
2 changes: 0 additions & 2 deletions tests/integration/TestKafkaConsumer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include "gtest/gtest.h"

#include <boost/algorithm/string.hpp>

#include <atomic>
#include <chrono>
#include <cstring>
Expand Down
2 changes: 2 additions & 0 deletions tests/robustness/TestAdminClient.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "../utils/TestUtility.h"

#include "kafka/AdminClient.h"
#include "kafka/Types.h"
#include "kafka/Utility.h"

#include "gtest/gtest.h"

Expand Down
5 changes: 5 additions & 0 deletions tests/unit/TestBrokerMetadata.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#include "kafka/BrokerMetadata.h"
#include "kafka/Types.h"

#include "gtest/gtest.h"

#include <cstddef>
#include <string>
#include <vector>


TEST(BrokerMetadata, Node)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/TestUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ CreateKafkaTopic(const kafka::Topic& topic, int numPartitions, int replicationFa
class JoiningThread {
public:
template <typename F, typename... Args>
explicit JoiningThread(F&& f, Args&&... args): _t(f, args...) {}
explicit JoiningThread(F&& f, Args&&... args): _t(std::forward<F>(f), args...) {}
~JoiningThread() { if (_t.joinable()) _t.join(); }
private:
std::thread _t;
Expand Down

0 comments on commit cf35e89

Please sign in to comment.