From cb2581031a53adabc5e60937266bcee041f9eea0 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Mon, 12 Oct 2020 10:45:21 -0700 Subject: [PATCH] Add macos tests to circleci (#7536) Summary: as title Pull Request resolved: https://github.com/facebook/rocksdb/pull/7536 Test Plan: see the new `build-macos` tests pass in circleci Reviewed By: jay-zhuang Differential Revision: D24243218 Pulled By: cheng-chang fbshipit-source-id: 9b5f8a859e54c99a9ebe7efff6f336458a5d42de --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++++++ util/rate_limiter_test.cc | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eafd8ff9a..7c7f8168f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,9 +10,26 @@ aliases: only_for_branches: master commands: + install-pyenv-on-macos: + steps: + - run: + name: Install pyenv on macos + command: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install pyenv + + increase-max-open-files-on-macos: + steps: + - run: + name: Increase max open files + command: | + sudo sysctl -w kern.maxfiles=1048576 + sudo sysctl -w kern.maxfilesperproc=1048576 + sudo launchctl limit maxfiles 1048576 + pre-steps: steps: - checkout + - run: pyenv install --skip-existing 3.5.9 - run: pyenv global 3.5.9 - run: name: Setup Environment Variables @@ -46,6 +63,13 @@ commands: name: Install gflags command: | sudo apt-get update -y && sudo apt-get install -y libgflags-dev + + install-gflags-on-macos: + steps: + - run: + name: Install gflags on macos + command: | + HOMEBREW_NO_AUTO_UPDATE=1 brew install gflags install-gtest-parallel: steps: @@ -63,6 +87,17 @@ executors: shell: bash.exe jobs: + build-macos: + macos: + xcode: 11.3.0 + steps: + - increase-max-open-files-on-macos + - install-pyenv-on-macos + - pre-steps + - install-gflags-on-macos + - run: ulimit -S -n 1048576 && OPT=-DCIRCLECI make V=1 J=32 -j32 check | .circleci/cat_ignore_eagain + - post-steps + build-linux: machine: image: ubuntu-1604:202007-01 @@ -419,3 +454,6 @@ workflows: build-linux-gcc-4-8: jobs: - build-linux-gcc-4-8 + build-macos: + jobs: + - build-macos diff --git a/util/rate_limiter_test.cc b/util/rate_limiter_test.cc index 87591923f..228837aa6 100644 --- a/util/rate_limiter_test.cc +++ b/util/rate_limiter_test.cc @@ -59,7 +59,7 @@ TEST_F(RateLimiterTest, Modes) { } } -#if !(defined(TRAVIS) && defined(OS_MACOSX)) +#if !((defined(TRAVIS) || defined(CIRCLECI)) && defined(OS_MACOSX)) TEST_F(RateLimiterTest, Rate) { auto* env = Env::Default(); struct Arg {