From 09ca3dbd247da7ded70259f64306f6ca1d3b26ba Mon Sep 17 00:00:00 2001 From: Brian Szmyd Date: Wed, 16 Aug 2023 09:52:56 -0700 Subject: [PATCH] Merge pull request #44 from szmyd/master Disable SPDK testing. --- .github/workflows/build_dependencies.yml | 33 +++++++++++++++++------- .github/workflows/merge_conan_build.yml | 16 +++++------- .github/workflows/pr_conan_build.yml | 14 +++------- .jenkins/Jenkinsfile | 2 +- CMakeLists.txt | 2 ++ README.md | 1 + cmake/debug_flags.cmake | 5 ++-- conanfile.py | 17 +++++++----- 8 files changed, 50 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build_dependencies.yml b/.github/workflows/build_dependencies.yml index 6cde5574..efa95054 100644 --- a/.github/workflows/build_dependencies.yml +++ b/.github/workflows/build_dependencies.yml @@ -131,18 +131,11 @@ jobs: - name: Build Cache run: | - conan install \ - -o prerelease=${{ inputs.prerelease }} \ - -o malloc_impl=${{ inputs.malloc-impl }} \ - -o testing=False \ - -s build_type=${{ inputs.build-type }} \ - --build missing \ - import/sisl conan install \ -o sisl:prerelease=${{ inputs.prerelease }} \ -o sisl:malloc_impl=${{ inputs.malloc-impl }} \ -o sisl:testing=False \ - -o testing=off \ + -o iomgr:testing=off \ -s build_type=${{ inputs.build-type }} \ --build missing \ . @@ -163,13 +156,35 @@ jobs: fail_on_cache_miss: true if: ${{ inputs.testing == 'True' && github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }} + - name: Code Coverage Run + run: | + conan install \ + -o sisl:prerelease=${{ inputs.prerelease }} \ + -o sisl:malloc_impl=${{ inputs.malloc-impl }} \ + -o sisl:testing=False \ + -o coverage=True \ + -o testing=epoll_mode \ + -s build_type=${{ inputs.build-type }} \ + --build missing \ + . + conan build . + if: ${{ inputs.testing == 'True' && inputs.platform == 'ubuntu-22.04' && inputs.build-type == 'Debug' && inputs.malloc-impl == 'libc' && inputs.prerelease == 'False' }} + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + gcov: true + if: ${{ inputs.testing == 'True' && inputs.platform == 'ubuntu-22.04' && inputs.build-type == 'Debug' && inputs.malloc-impl == 'libc' && inputs.prerelease == 'False' }} + + - name: Create and test Package run: | conan create \ -o sisl:prerelease=${{ inputs.prerelease }} \ -o sisl:malloc_impl=${{ inputs.malloc-impl }} \ -o sisl:testing=False \ - -o iomgr:testing=off \ + -o iomgr:testing='epoll_mode' \ -s build_type=${{ inputs.build-type }} \ --build missing \ . diff --git a/.github/workflows/merge_conan_build.yml b/.github/workflows/merge_conan_build.yml index 0a86a216..7d613c42 100644 --- a/.github/workflows/merge_conan_build.yml +++ b/.github/workflows/merge_conan_build.yml @@ -12,26 +12,22 @@ jobs: strategy: fail-fast: false matrix: - platform: ["ubuntu-22.04", "ubuntu-20.04"] + platform: ["ubuntu-22.04"] build-type: ["Debug", "Release"] malloc-impl: ["libc", "tcmalloc", "jemalloc"] prerelease: ["True", "False"] exclude: - - build-type: Debug - platform: ubuntu-20.04 - - malloc-impl: tcmalloc - platform: ubuntu-20.04 - - malloc-impl: jemalloc - platform: ubuntu-20.04 - malloc-impl: jemalloc build-type: Debug + - malloc-impl: tcmalloc + build-type: Debug + - malloc-impl: tcmalloc + prerelease: "True" - malloc-impl: jemalloc prerelease: "False" - malloc-impl: libc build-type: Release - platform: ubuntu-22.04 - - prerelease: "False" - build-type: Debug + uses: ./.github/workflows/build_commit.yml with: platform: ${{ matrix.platform }} diff --git a/.github/workflows/pr_conan_build.yml b/.github/workflows/pr_conan_build.yml index 4be049c5..c5631226 100644 --- a/.github/workflows/pr_conan_build.yml +++ b/.github/workflows/pr_conan_build.yml @@ -11,26 +11,20 @@ jobs: strategy: fail-fast: false matrix: - platform: ["ubuntu-22.04", "ubuntu-20.04"] + platform: ["ubuntu-22.04"] build-type: ["Debug", "Release"] malloc-impl: ["libc", "tcmalloc", "jemalloc"] prerelease: ["True", "False"] exclude: - - build-type: Debug - platform: ubuntu-20.04 - - malloc-impl: tcmalloc - platform: ubuntu-20.04 - - malloc-impl: jemalloc - platform: ubuntu-20.04 - malloc-impl: jemalloc build-type: Debug + - malloc-impl: tcmalloc + build-type: Debug - malloc-impl: jemalloc prerelease: "False" - malloc-impl: libc build-type: Release - platform: ubuntu-22.04 - - prerelease: "False" - build-type: Debug + uses: ./.github/workflows/build_commit.yml with: platform: ${{ matrix.platform }} diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 70bb2255..c563af62 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -124,7 +124,7 @@ pipeline { if (("${env.BRANCH_NAME}" =~ /PR-/) && ("$BUILD_TYPE" == "debug")) { sh "echo Skipping debug build for PR branch" } else { - sh "conan create -u ${BUILD_MISSING} -o sisl:prerelease=${PRERELEASE} -o ${PROJECT}:sanitize=${SANITIZE} -pr ${BUILD_PROFILE} . ${PROJECT}/${TAG}" + sh "conan create ${BUILD_MISSING} -o sisl:prerelease=${PRERELEASE} -o ${PROJECT}:sanitize=${SANITIZE} -pr ${BUILD_PROFILE} . ${PROJECT}/${TAG}" } } } diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d9cf2ef..ab3b116e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,9 @@ if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif () +if(BUILD_TESTING) enable_testing() +endif() add_subdirectory(src/) diff --git a/README.md b/README.md index 275ab771..cd2ef75d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # IOManager [![Conan Build](https://github.com/eBay/IOManager/actions/workflows/merge_conan_build.yml/badge.svg?branch=master)](https://github.com/eBay/IOManager/actions/workflows/merge_conan_build.yml) +[![CodeCov](https://codecov.io/gh/eBay/IOManager/branch/master/graph/badge.svg)](https://codecov.io/gh/eBay/IOManager) IOManager tries to bridge the gap in existing async framework to build full async networked database/storage/keyvalue storage. Motivation and design are explained below. diff --git a/cmake/debug_flags.cmake b/cmake/debug_flags.cmake index a0ad3d3f..7374b8e3 100644 --- a/cmake/debug_flags.cmake +++ b/cmake/debug_flags.cmake @@ -59,11 +59,10 @@ set (REALLY_NO_OPTIMIZATION_FLAGS "${REALLY_NO_OPTIMIZATION_FLAGS} -fno-web" set (REALLY_NO_OPTIMIZATION_FLAGS "${REALLY_NO_OPTIMIZATION_FLAGS} -fno-tree-slp-vectorize" )# E&C. set (REALLY_NO_OPTIMIZATION_FLAGS "${REALLY_NO_OPTIMIZATION_FLAGS} -fthreadsafe-statics" )# Slightly smaller in code that doesn't need to be TS. -if (DEFINED ${BUILD_COVERAGE}) +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${REALLY_NO_OPTIMIZATION_FLAGS}") +if (DEFINED BUILD_COVERAGE) if (${BUILD_COVERAGE}) include (cmake/CodeCoverage.cmake) APPEND_COVERAGE_COMPILER_FLAGS() - SETUP_TARGET_FOR_COVERAGE_GCOVR_XML(NAME coverage EXECUTABLE ctest DEPENDENCIES ) endif () endif () -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${REALLY_NO_OPTIMIZATION_FLAGS}") diff --git a/conanfile.py b/conanfile.py index 4d077611..00021f13 100644 --- a/conanfile.py +++ b/conanfile.py @@ -31,7 +31,7 @@ class IOMgrConan(ConanFile): 'grpc_support': True, 'sanitize': False, 'spdk': True, - 'testing': 'full', + 'testing': 'epoll_mode', 'sisl:prerelease': True, 'fiber_impl': 'boost', } @@ -74,15 +74,17 @@ def build(self): definitions = {'CMAKE_TEST_TARGET': self.options.testing, 'CMAKE_EXPORT_COMPILE_COMMANDS': 'ON', 'CONAN_CMAKE_SILENT_OUTPUT': 'ON', - 'MEMORY_SANITIZER_ON': 'OFF'} + 'MEMORY_SANITIZER_ON': 'OFF', + 'BUILD_TESTING': 'OFF', + } + if self.options.testing: + definitions['BUILD_TESTING'] = 'ON' - test_target = None if self.settings.build_type == "Debug": if self.options.sanitize: definitions['MEMORY_SANITIZER_ON'] = 'ON' - elif self.options.coverage: - definitions['BUILD_COVERAGE'] = 'ON' - test_target = 'coverage' + if self.options.coverage: + definitions['BUILD_COVERAGE'] = 'ON' if self.options.fiber_impl == "boost": definitions['FIBER_IMPL'] = 'boost' @@ -91,7 +93,8 @@ def build(self): cmake.configure(defs=definitions) cmake.build() - cmake.test(target=test_target, output_on_failure=True) + if self.options.testing: + cmake.test(output_on_failure=True) def package(self): copy(self, "LICENSE", self.source_folder, join(self.package_folder, "licenses"), keep_path=False)