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
This commit is contained in:
Adam Retter 2019-12-17 13:52:09 -08:00 committed by Facebook Github Bot
parent 39fcaf8246
commit 2d16709487
2 changed files with 32 additions and 18 deletions

View File

@ -6,25 +6,34 @@ os:
compiler: compiler:
- clang - clang
- gcc - gcc
osx_image: xcode8.3 osx_image: xcode9.4
jdk: jdk:
- openjdk7 - openjdk7
cache: cache:
- ccache - ccache
- apt
addons: addons:
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
packages: packages:
- curl
- g++-8
- libbz2-dev
- libgflags-dev - libgflags-dev
- libbz2-dev
- liblz4-dev
- libsnappy-dev - libsnappy-dev
- mingw-w64 - liblzma-dev # xv
- libzstd-dev
- zlib1g-dev - zlib1g-dev
homebrew:
update: true
packages:
- ccache
- gflags
- lz4
- snappy
- xz
- zstd
env: env:
- TEST_GROUP=platform_dependent # 16-18 minutes - TEST_GROUP=platform_dependent # 16-18 minutes
- TEST_GROUP=1 # 33-35 minutes - TEST_GROUP=1 # 33-35 minutes
@ -60,15 +69,17 @@ matrix:
- os : osx - os : osx
compiler: gcc compiler: gcc
# https://docs.travis-ci.com/user/caching/#ccache-cache
install: install:
- if [ "${TRAVIS_OS_NAME}" == osx ]; then - if [ "${TRAVIS_OS_NAME}" == osx ]; then
brew install ccache gflags zstd lz4 snappy xz;
PATH=$PATH:/usr/local/opt/ccache/libexec; PATH=$PATH:/usr/local/opt/ccache/libexec;
fi fi
- if [ "${JOB_NAME}" == cmake-gcc8 ]; then - if [ "${JOB_NAME}" == cmake-gcc8 ]; then
sudo apt-get install -y g++-8;
CC=gcc-8 && CXX=g++-8; CC=gcc-8 && CXX=g++-8;
fi fi
- if [ "${JOB_NAME}" == cmake-mingw ]; then
sudo apt-get install -y mingw-w64 ;
fi
- if [[ "${JOB_NAME}" == cmake* ]] && [ "${TRAVIS_OS_NAME}" == linux ]; then - 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; 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 fi

View File

@ -10,6 +10,7 @@
#include "cache/lru_cache.h" #include "cache/lru_cache.h"
#include "db/db_test_util.h" #include "db/db_test_util.h"
#include "port/stack_trace.h" #include "port/stack_trace.h"
#include "util/compression.h"
namespace rocksdb { namespace rocksdb {
@ -685,16 +686,18 @@ TEST_F(DBBlockCacheTest, CacheCompressionDict) {
// Try all the available libraries that support dictionary compression // Try all the available libraries that support dictionary compression
std::vector<CompressionType> compression_types; std::vector<CompressionType> compression_types;
#ifdef ZLIB if (Zlib_Supported()) {
compression_types.push_back(kZlibCompression); compression_types.push_back(kZlibCompression);
#endif // ZLIB }
#if LZ4_VERSION_NUMBER >= 10400 if (LZ4_Supported()) {
compression_types.push_back(kLZ4Compression); compression_types.push_back(kLZ4Compression);
compression_types.push_back(kLZ4HCCompression); compression_types.push_back(kLZ4HCCompression);
#endif // LZ4_VERSION_NUMBER >= 10400 }
#if ZSTD_VERSION_NUMBER >= 500 if (ZSTD_Supported()) {
compression_types.push_back(kZSTD); compression_types.push_back(kZSTD);
#endif // ZSTD_VERSION_NUMBER >= 500 } else if (ZSTDNotFinal_Supported()) {
compression_types.push_back(kZSTDNotFinalCompression);
}
Random rnd(301); Random rnd(301);
for (auto compression_type : compression_types) { for (auto compression_type : compression_types) {
Options options = CurrentOptions(); Options options = CurrentOptions();