From 2d1670948752a54c9b67797c83e9fdb563ebd0b1 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Tue, 17 Dec 2019 13:52:09 -0800 Subject: [PATCH] Small tidy and speed up of the travis build (#6181) Summary: Cuts about 30-60 seconds to from each Travis Linux build, and about 15 minutes from each macOS build Pull Request resolved: https://github.com/facebook/rocksdb/pull/6181 Differential Revision: D19098357 Pulled By: pdillinger fbshipit-source-id: 863dd1ab09076ad9b03c2b7914908359628315ae --- .travis.yml | 27 +++++++++++++++++++-------- db/db_block_cache_test.cc | 23 +++++++++++++---------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f1df274c..5d91a4e7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,25 +6,34 @@ os: compiler: - clang - gcc -osx_image: xcode8.3 +osx_image: xcode9.4 jdk: - openjdk7 cache: - ccache - - apt addons: apt: sources: - ubuntu-toolchain-r-test packages: - - curl - - g++-8 - - libbz2-dev - libgflags-dev + - libbz2-dev + - liblz4-dev - libsnappy-dev - - mingw-w64 + - liblzma-dev # xv + - libzstd-dev - zlib1g-dev + homebrew: + update: true + packages: + - ccache + - gflags + - lz4 + - snappy + - xz + - zstd + env: - TEST_GROUP=platform_dependent # 16-18 minutes - TEST_GROUP=1 # 33-35 minutes @@ -60,15 +69,17 @@ matrix: - os : osx compiler: gcc -# https://docs.travis-ci.com/user/caching/#ccache-cache install: - if [ "${TRAVIS_OS_NAME}" == osx ]; then - brew install ccache gflags zstd lz4 snappy xz; PATH=$PATH:/usr/local/opt/ccache/libexec; fi - if [ "${JOB_NAME}" == cmake-gcc8 ]; then + sudo apt-get install -y g++-8; CC=gcc-8 && CXX=g++-8; fi + - if [ "${JOB_NAME}" == cmake-mingw ]; then + sudo apt-get install -y mingw-w64 ; + fi - if [[ "${JOB_NAME}" == cmake* ]] && [ "${TRAVIS_OS_NAME}" == linux ]; then mkdir cmake-dist && curl -sfSL https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-Linux-x86_64.tar.gz | tar --strip-components=1 -C cmake-dist -xz && export PATH=$PWD/cmake-dist/bin:$PATH; fi diff --git a/db/db_block_cache_test.cc b/db/db_block_cache_test.cc index 89c2dbd5d..b89369c8f 100644 --- a/db/db_block_cache_test.cc +++ b/db/db_block_cache_test.cc @@ -10,6 +10,7 @@ #include "cache/lru_cache.h" #include "db/db_test_util.h" #include "port/stack_trace.h" +#include "util/compression.h" namespace rocksdb { @@ -685,16 +686,18 @@ TEST_F(DBBlockCacheTest, CacheCompressionDict) { // Try all the available libraries that support dictionary compression std::vector compression_types; -#ifdef ZLIB - compression_types.push_back(kZlibCompression); -#endif // ZLIB -#if LZ4_VERSION_NUMBER >= 10400 - compression_types.push_back(kLZ4Compression); - compression_types.push_back(kLZ4HCCompression); -#endif // LZ4_VERSION_NUMBER >= 10400 -#if ZSTD_VERSION_NUMBER >= 500 - compression_types.push_back(kZSTD); -#endif // ZSTD_VERSION_NUMBER >= 500 + if (Zlib_Supported()) { + compression_types.push_back(kZlibCompression); + } + if (LZ4_Supported()) { + compression_types.push_back(kLZ4Compression); + compression_types.push_back(kLZ4HCCompression); + } + if (ZSTD_Supported()) { + compression_types.push_back(kZSTD); + } else if (ZSTDNotFinal_Supported()) { + compression_types.push_back(kZSTDNotFinalCompression); + } Random rnd(301); for (auto compression_type : compression_types) { Options options = CurrentOptions();