Hello community, here is the log from the commit of package dd-opentracing-cpp for openSUSE:Factory checked in at 2019-12-18 14:45:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dd-opentracing-cpp (Old) and /work/SRC/openSUSE:Factory/.dd-opentracing-cpp.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dd-opentracing-cpp" Wed Dec 18 14:45:22 2019 rev:3 rq:757566 version:1.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/dd-opentracing-cpp/dd-opentracing-cpp.changes 2019-08-09 16:53:36.145465559 +0200 +++ /work/SRC/openSUSE:Factory/.dd-opentracing-cpp.new.4691/dd-opentracing-cpp.changes 2019-12-18 14:48:23.985940850 +0100 @@ -1,0 +2,11 @@ +Tue Dec 17 14:30:41 UTC 2019 - [email protected] + +- Update to version 1.1.2: + * Fix nginx example / sandbox (#114) + * Generate int64 values instead of uint64 (#116) + * version bump for 1.1.1 and version check scripts enforced by CI (#113) + * Build / install updates (#112) + * Changed how tests are built for faster compilation (#109) + * Replace ':' in span tag keys with '.' (#107) + +------------------------------------------------------------------- Old: ---- dd-opentracing-cpp-1.0.1.tar.xz New: ---- dd-opentracing-cpp-1.1.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dd-opentracing-cpp.spec ++++++ --- /var/tmp/diff_new_pack.tfXj5t/_old 2019-12-18 14:48:24.381941031 +0100 +++ /var/tmp/diff_new_pack.tfXj5t/_new 2019-12-18 14:48:24.381941031 +0100 @@ -20,7 +20,7 @@ %define libname libdd_opentracing%{soversion} Name: dd-opentracing-cpp -Version: 1.0.1 +Version: 1.1.2 Release: 0 Summary: Datadog Opentracing C++ client License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.tfXj5t/_old 2019-12-18 14:48:24.405941042 +0100 +++ /var/tmp/diff_new_pack.tfXj5t/_new 2019-12-18 14:48:24.409941044 +0100 @@ -6,7 +6,7 @@ <param name="filename">dd-opentracing-cpp</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="revision">v1.0.1</param> + <param name="revision">v1.1.2</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.tfXj5t/_old 2019-12-18 14:48:24.421941049 +0100 +++ /var/tmp/diff_new_pack.tfXj5t/_new 2019-12-18 14:48:24.425941051 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/DataDog/dd-opentracing-cpp.git</param> - <param name="changesrevision">11311abc9160ceee63cfdb2e027e82f48a5348a0</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">6b157f78361700630d0d46438ed62de08f652ac3</param></service></servicedata> \ No newline at end of file ++++++ dd-opentracing-cpp-1.0.1.tar.xz -> dd-opentracing-cpp-1.1.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/.circleci/config.yml new/dd-opentracing-cpp-1.1.2/.circleci/config.yml --- old/dd-opentracing-cpp-1.0.1/.circleci/config.yml 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/.circleci/config.yml 2019-11-13 00:09:56.000000000 +0100 @@ -28,6 +28,9 @@ fi done - run: + name: Check version info is up-to-date + command: ./test/version/version_check + - run: name: Build source dependencies command: | ./scripts/install_dependencies.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/CMakeLists.txt new/dd-opentracing-cpp-1.1.2/CMakeLists.txt --- old/dd-opentracing-cpp-1.0.1/CMakeLists.txt 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/CMakeLists.txt 2019-11-13 00:09:56.000000000 +0100 @@ -22,6 +22,14 @@ # Configure the compiler. set(CMAKE_CXX_STANDARD 14) +# Includes +set(CMAKE_INCLUDE_PATH 3rd_party/include deps/include) +include_directories(SYSTEM 3rd_party/include deps/include) +include_directories(include) + +# Libraries +set(CMAKE_LIBRARY_PATH deps/lib) + # Dependencies find_path(OPENTRACING_INCLUDE_DIR NAMES opentracing/tracer.h) find_library(OPENTRACING_LIB opentracing) @@ -29,24 +37,19 @@ find_library(MSGPACK_LIB msgpack) find_package(CURL) find_package(Threads REQUIRED) -# Code Sanitizers, for testing. + +# Code Sanitizers set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH}) find_package(Sanitizers) -set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} Threads::Threads) - -# Includes -include_directories(SYSTEM 3rd_party/include) -include_directories(SYSTEM ${OPENTRACING_INCLUDE_DIR} ${CURL_INCLUDE_DIRS}) -include_directories(include) - # Code install(DIRECTORY include/datadog DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) file(GLOB DD_OPENTRACING_SOURCES "src/*.cpp") add_compile_options(-Wall -Wextra -Werror -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast -std=c++14) - # Outputs +set(DATADOG_LINK_LIBRARIES ${OPENTRACING_LIB} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} Threads::Threads) + ## Shared lib if(BUILD_SHARED) add_library(dd_opentracing SHARED ${DD_OPENTRACING_SOURCES}) @@ -64,8 +67,6 @@ add_library(dd_opentracing-static STATIC ${DD_OPENTRACING_SOURCES}) add_sanitizers(dd_opentracing-static) set_target_properties(dd_opentracing-static PROPERTIES OUTPUT_NAME dd_opentracing) - target_link_libraries(dd_opentracing-static ${DATADOG_LINK_LIBRARIES} datadog) - install(TARGETS dd_opentracing-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/examples/nginx-tracing/Dockerfile new/dd-opentracing-cpp-1.1.2/examples/nginx-tracing/Dockerfile --- old/dd-opentracing-cpp-1.0.1/examples/nginx-tracing/Dockerfile 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/examples/nginx-tracing/Dockerfile 2019-11-13 00:09:56.000000000 +0100 @@ -1,7 +1,7 @@ # Builds and runs a simple nginx server, traced by Datadog FROM ubuntu:18.04 -ARG NGINX_VERSION=1.14.0 +ARG NGINX_VERSION=1.14.2 RUN apt-get update && \ apt-get install -y git gnupg wget tar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/examples/nginx-tracing/docker-compose.yml new/dd-opentracing-cpp-1.1.2/examples/nginx-tracing/docker-compose.yml --- old/dd-opentracing-cpp-1.0.1/examples/nginx-tracing/docker-compose.yml 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/examples/nginx-tracing/docker-compose.yml 2019-11-13 00:09:56.000000000 +0100 @@ -16,5 +16,3 @@ - DD_API_KEY - 'DD_APM_ENABLED=true' image: 'datadog/agent' - ports: - - "127.0.0.1:8126:8126" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/include/datadog/version.h new/dd-opentracing-cpp-1.1.2/include/datadog/version.h --- old/dd-opentracing-cpp-1.0.1/include/datadog/version.h 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/include/datadog/version.h 2019-11-13 00:09:56.000000000 +0100 @@ -6,7 +6,7 @@ namespace datadog { namespace version { -const std::string tracer_version = "v1.0.1"; +const std::string tracer_version = "v1.1.2"; const std::string cpp_version = std::to_string(__cplusplus); } // namespace version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/scripts/install_dependencies.sh new/dd-opentracing-cpp-1.1.2/scripts/install_dependencies.sh --- old/dd-opentracing-cpp-1.0.1/scripts/install_dependencies.sh 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/scripts/install_dependencies.sh 2019-11-13 00:09:56.000000000 +0100 @@ -1,11 +1,25 @@ -#!/bin/sh +#!/bin/bash set -e +install_dir=$(mkdir -p "${0%/*}/../deps" && cd "${0%/*}/../deps" && echo "$PWD") +if [[ ! -d "$install_dir" ]]; then + echo "Unable to determine install directory" + exit 1 +fi OPENTRACING_VERSION=${OPENTRACING_VERSION:-1.5.1} -CURL_VERSION=${CURL_VERSION:-7.64.0} -MSGPACK_VERSION=${MSGPACK_VERSION:-3.1.1} +CURL_VERSION=${CURL_VERSION:-7.66.0} +MSGPACK_VERSION=${MSGPACK_VERSION:-3.2.0} ZLIB_VERSION=${ZLIB_VERSION:-1.2.11} +# Just report versions and exit. +if [[ "$1" == "versions" ]]; then + echo "opentracing:$OPENTRACING_VERSION" + echo "curl:$CURL_VERSION" + echo "msgpack:$MSGPACK_VERSION" + echo "zlib:$ZLIB_VERSION" + exit 0 +fi + # Allow specifying dependencies not to install. By default we want to compile # our own versions, but under some circumstances (eg building opentracing-nginx # docker images) some of these dependencies are already provided. @@ -33,11 +47,12 @@ # OpenTracing if [ "$BUILD_OPENTRACING" -eq "1" ]; then - wget https://github.com/opentracing/opentracing-cpp/archive/v${OPENTRACING_VERSION}.tar.gz -O opentracing-cpp.tar.gz - tar zxvf opentracing-cpp.tar.gz - mkdir opentracing-cpp-${OPENTRACING_VERSION}/.build - cd opentracing-cpp-${OPENTRACING_VERSION}/.build - cmake -DCMAKE_BUILD_TYPE=Release \ + wget "https://github.com/opentracing/opentracing-cpp/archive/v${OPENTRACING_VERSION}.tar.gz" -O opentracing-cpp.tar.gz + tar zxf opentracing-cpp.tar.gz + mkdir -p "opentracing-cpp-${OPENTRACING_VERSION}/.build" + cd "opentracing-cpp-${OPENTRACING_VERSION}/.build" + cmake -DCMAKE_INSTALL_PREFIX="$install_dir" \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS="-fPIC" \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ @@ -46,36 +61,45 @@ make make install cd ../.. + rm -r "opentracing-cpp-${OPENTRACING_VERSION}/" + rm opentracing-cpp.tar.gz fi # Zlib if [ "$BUILD_ZLIB" -eq "1" ]; then - wget https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz - tar zxf zlib-${ZLIB_VERSION}.tar.gz - cd zlib-${ZLIB_VERSION} - CFLAGS="$CFLAGS -fPIC" ./configure --static + wget "https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz" + tar zxf "zlib-${ZLIB_VERSION}.tar.gz" + mkdir -p "zlib-${ZLIB_VERSION}" + cd "zlib-${ZLIB_VERSION}" + CFLAGS="$CFLAGS -fPIC" ./configure --prefix="$install_dir" --static make && make install cd .. + rm -r "zlib-${ZLIB_VERSION}" + rm "zlib-${ZLIB_VERSION}.tar.gz" fi # Msgpack if [ "$BUILD_MSGPACK" -eq "1" ]; then - wget https://github.com/msgpack/msgpack-c/releases/download/cpp-${MSGPACK_VERSION}/msgpack-${MSGPACK_VERSION}.tar.gz -O msgpack.tar.gz - tar zxvf msgpack.tar.gz - mkdir msgpack-${MSGPACK_VERSION}/.build - cd msgpack-${MSGPACK_VERSION}/.build - cmake -DBUILD_SHARED_LIBS=OFF .. + wget "https://github.com/msgpack/msgpack-c/releases/download/cpp-${MSGPACK_VERSION}/msgpack-${MSGPACK_VERSION}.tar.gz" -O msgpack.tar.gz + tar zxf msgpack.tar.gz + mkdir -p "msgpack-${MSGPACK_VERSION}/.build" + cd "msgpack-${MSGPACK_VERSION}/.build" + cmake -DCMAKE_INSTALL_PREFIX="$install_dir" -DBUILD_SHARED_LIBS=OFF .. make make install cd ../.. + rm -r "msgpack-${MSGPACK_VERSION}/" + rm msgpack.tar.gz fi # Libcurl if [ "$BUILD_CURL" -eq "1" ]; then - wget https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz - tar zxf curl-${CURL_VERSION}.tar.gz - cd curl-${CURL_VERSION} - ./configure --disable-ftp \ + wget "https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz" + tar zxf "curl-${CURL_VERSION}.tar.gz" + mkdir -p "curl-${CURL_VERSION}" + cd "curl-${CURL_VERSION}" + ./configure --prefix="$install_dir" \ + --disable-ftp \ --disable-ldap \ --disable-dict \ --disable-telnet \ @@ -93,4 +117,6 @@ --with-pic make && make install cd .. + rm -r "curl-${CURL_VERSION}/" + rm "curl-${CURL_VERSION}.tar.gz" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/src/span.cpp new/dd-opentracing-cpp-1.1.2/src/span.cpp --- old/dd-opentracing-cpp-1.0.1/src/span.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/src/span.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -300,12 +300,24 @@ }; } // namespace +// Normalizes the tag key. +// For now: +// - ':' is replaced with '.' +// Further normalization may be done in the future, such as +// converting to lowercase, and replacing spaces and other punctuation +// with underscore. +std::string normalizeTagKey(std::string tag) { + std::replace(tag.begin(), tag.end(), ':', '.'); + return tag; +} + void Span::SetTag(ot::string_view key, const ot::Value &value) noexcept { + std::string k = normalizeTagKey(key); std::string result; apply_visitor(VariantVisitor{result}, value); { std::lock_guard<std::mutex> lock_guard{mutex_}; - span_->meta[key] = result; + span_->meta[k] = result; } // Normally special tags are processed at Span Finish, but this cannot be done for @@ -313,7 +325,7 @@ // assigned immutably. // The sampling tags are "sampling.priority", "manual.keep" and "manual.drop". // Doesn't need to be in the same mutex lock as above. - if (key == ::ot::ext::sampling_priority) { + if (k == ::ot::ext::sampling_priority) { // https://github.com/opentracing/specification/blob/master/semantic_conventions.md#span-tags-table // "sampling.priority" try { @@ -329,9 +341,9 @@ } catch (const std::out_of_range &oor) { std::cerr << "Unable to parse " << ::ot::ext::sampling_priority << " tag" << std::endl; } - } else if (key == tags::manual_keep) { + } else if (k == tags::manual_keep) { setSamplingPriority(std::make_unique<UserSamplingPriority>(UserSamplingPriority::UserKeep)); - } else if (key == tags::manual_drop) { + } else if (k == tags::manual_drop) { setSamplingPriority(std::make_unique<UserSamplingPriority>(UserSamplingPriority::UserDrop)); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/src/tracer.cpp new/dd-opentracing-cpp-1.1.2/src/tracer.cpp --- old/dd-opentracing-cpp-1.0.1/src/tracer.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/src/tracer.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -37,7 +37,7 @@ uint64_t getId() { static TlsRandomNumberGenerator rng; - static thread_local std::uniform_int_distribution<uint64_t> distribution; + static thread_local std::uniform_int_distribution<int64_t> distribution; return distribution(TlsRandomNumberGenerator::generator()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/CMakeLists.txt new/dd-opentracing-cpp-1.1.2/test/CMakeLists.txt --- old/dd-opentracing-cpp-1.0.1/test/CMakeLists.txt 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/CMakeLists.txt 2019-11-13 00:09:56.000000000 +0100 @@ -1,8 +1,11 @@ +add_library(catch STATIC test_main.cpp) + macro(_datadog_test TEST_NAME) add_executable(${TEST_NAME} ${ARGN}) add_sanitizers(${TEST_NAME}) target_link_libraries(${TEST_NAME} ${DATADOG_LINK_LIBRARIES} - dd_opentracing) + dd_opentracing + catch) add_test(${TEST_NAME} ${TEST_NAME}) endmacro() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/agent_writer_test.cpp new/dd-opentracing-cpp-1.1.2/test/agent_writer_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/agent_writer_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/agent_writer_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -5,7 +5,6 @@ #include <ctime> -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/opentracing_test.cpp new/dd-opentracing-cpp-1.1.2/test/opentracing_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/opentracing_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/opentracing_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -1,7 +1,6 @@ #include <datadog/opentracing.h> #include "mocks.h" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/propagation_test.cpp new/dd-opentracing-cpp-1.1.2/test/propagation_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/propagation_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/propagation_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -7,7 +7,6 @@ #include "../src/tracer.h" #include "mocks.h" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; namespace tags = datadog::tags; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/sample_test.cpp new/dd-opentracing-cpp-1.1.2/test/sample_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/sample_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/sample_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -6,7 +6,6 @@ #include <ctime> -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/span_buffer_test.cpp new/dd-opentracing-cpp-1.1.2/test/span_buffer_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/span_buffer_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/span_buffer_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -2,7 +2,6 @@ #include "../src/sample.h" #include "mocks.h" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/span_test.cpp new/dd-opentracing-cpp-1.1.2/test/span_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/span_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/span_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -7,7 +7,6 @@ #include "../src/sample.h" #include "mocks.h" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; namespace tags = datadog::tags; @@ -136,7 +135,7 @@ span.SetTag("double", 6.283185); span.SetTag("int64_t", -69); span.SetTag("uint64_t", 420); - span.SetTag("std::string", std::string("hi there")); + span.SetTag("string", std::string("hi there")); span.SetTag("nullptr", nullptr); span.SetTag("char*", "hi there"); span.SetTag("list", std::vector<ot::Value>{"hi", 420, true}); @@ -159,13 +158,30 @@ {"double", "6.283185"}, {"int64_t", "-69"}, {"uint64_t", "420"}, - {"std::string", "hi there"}, + {"string", "hi there"}, {"nullptr", "nullptr"}, {"char*", "hi there"}, {"list", "[\"hi\",420,true]"}, }); } + SECTION("replaces colons with dots in tag key") { + auto span_id = get_id(); + Span span{nullptr, buffer, get_time, sampler, + span_id, span_id, 0, SpanContext{span_id, span_id, "", {}}, + get_time(), "", "", "", + "", ""}; + + span.SetTag("foo:bar:baz", "x"); + + span.FinishWithOptions(finish_options); + + auto& result = buffer->traces(100).finished_spans->at(0); + REQUIRE(result->meta == std::unordered_map<std::string, std::string>{ + {"foo.bar.baz", "x"}, + }); + } + SECTION("maps datadog tags to span data") { auto span_id = get_id(); Span span{nullptr, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/test_main.cpp new/dd-opentracing-cpp-1.1.2/test/test_main.cpp --- old/dd-opentracing-cpp-1.0.1/test/test_main.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/dd-opentracing-cpp-1.1.2/test/test_main.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -0,0 +1,2 @@ +#define CATCH_CONFIG_MAIN +#include <catch2/catch.hpp> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/tracer_factory_test.cpp new/dd-opentracing-cpp-1.1.2/test/tracer_factory_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/tracer_factory_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/tracer_factory_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -4,7 +4,6 @@ // Source file needed to ensure compilation of templated class TracerFactory<MockTracer> #include "../src/tracer_factory.cpp" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/tracer_options_test.cpp new/dd-opentracing-cpp-1.1.2/test/tracer_options_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/tracer_options_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/tracer_options_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -1,6 +1,5 @@ #include "../src/tracer_options.h" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/tracer_test.cpp new/dd-opentracing-cpp-1.1.2/test/tracer_test.cpp --- old/dd-opentracing-cpp-1.0.1/test/tracer_test.cpp 2019-07-26 03:17:26.000000000 +0200 +++ new/dd-opentracing-cpp-1.1.2/test/tracer_test.cpp 2019-11-13 00:09:56.000000000 +0100 @@ -1,10 +1,10 @@ #include "../src/tracer.h" +#include <unistd.h> #include <ctime> #include "../src/sample.h" #include "../src/span.h" #include "mocks.h" -#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> using namespace datadog::opentracing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/updates-needed/upstream/curl new/dd-opentracing-cpp-1.1.2/test/updates-needed/upstream/curl --- old/dd-opentracing-cpp-1.0.1/test/updates-needed/upstream/curl 1970-01-01 01:00:00.000000000 +0100 +++ new/dd-opentracing-cpp-1.1.2/test/updates-needed/upstream/curl 2019-11-13 00:09:56.000000000 +0100 @@ -0,0 +1,35 @@ +#!/bin/bash +# Checks if the version of cURL has become outdated and needs an update. +# Details are parsed from https://curl.haxx.se/docs/releases.csv and the outcome can be +# - unknown (eg: couldn't download or parse CSV file) +# - up-to-date (yay) +# - vulnerable, update and release required +# - outdated, not vulnerable but still could be updated + +current_version=$(${0%/*}/../../../scripts/install_dependencies.sh versions | awk -F':' '$1 == "curl" { print $2; exit; }') + +if [[ -z "$current_version" ]]; then + echo "Unable to determine current version of curl." + exit 1 +fi + +# This ironically requires curl installed +curl_releases=$(curl -s https://curl.haxx.se/docs/releases.csv) + +latest=$(awk -F';' '{ print $2; exit; }' <<< "$curl_releases" ) +if [[ $current_version == $latest ]]; then + echo "Up to date: $latest" + exit 0 +fi + +read -r age bugfixes changes vulns _ < <(awk -F';' -v "ver=$current_version" '$2 == ver { print $7, $9, $11, $3; exit; }' <<< "$curl_releases") + +if ((vulns > 0)); then + echo "Vulnerable: $vulns reported vulnerabilities for this release. Update from $current_version to $latest" + exit 1 +fi + +echo "Outdated: $current_version is from $age days ago and contains $bugfixes bug fixes and $changes other changes." +if ((age > 100)); then + exit 1 +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/version/current_version.cc new/dd-opentracing-cpp-1.1.2/test/version/current_version.cc --- old/dd-opentracing-cpp-1.0.1/test/version/current_version.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/dd-opentracing-cpp-1.1.2/test/version/current_version.cc 2019-11-13 00:09:56.000000000 +0100 @@ -0,0 +1,8 @@ +#include <datadog/version.h> + +#include <iostream> + +int main() { + std::cout << datadog::version::tracer_version << std::endl; + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dd-opentracing-cpp-1.0.1/test/version/version_check new/dd-opentracing-cpp-1.1.2/test/version/version_check --- old/dd-opentracing-cpp-1.0.1/test/version/version_check 1970-01-01 01:00:00.000000000 +0100 +++ new/dd-opentracing-cpp-1.1.2/test/version/version_check 2019-11-13 00:09:56.000000000 +0100 @@ -0,0 +1,43 @@ +#!/bin/bash + +if ! cd "${0%/*}"; then + echo "failed to change working directory" + exit 1 +fi + +if ! type git > /dev/null; then + echo "git not available." + exit 0 +fi + +if ! type g++ > /dev/null; then + echo "g++ not available." + exit 0 +fi + +if ! g++ -I"$(git rev-parse --show-toplevel)"/include -o current_version current_version.cc; then + echo "failed to compile current_version.cc" + exit 1 +fi +if ! version=$(./current_version); then + echo "failed to execute current_version" + exit 1 +fi +if ! [[ "$version" ]]; then + echo "empty version info" + exit 1 +fi +rm ./current_version + +if ! git rev-parse "$version" &>/dev/null; then + # already updated + exit 0 +fi + +head_ts=$(git show -s --format=%ct HEAD) +vers_ts=$(git show -s --format=%ct "$version") + +if ((head_ts > vers_ts)); then + echo "version tag is outdated and needs an update" + exit 1 +fi
