Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ commands:
apt-get -q install -y git openssh-client curl ca-certificates make tar gzip
bash <(curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh)
- setup_remote_docker:
version: 20.10.2
version: 20.10.7
docker_layer_caching: true

checkout-all:
Expand Down Expand Up @@ -312,6 +312,22 @@ jobs:
- test-steps
- persist-artifacts

coverage:
docker:
- image: redisfab/rmbuilder:6.2.5-x64-bullseye
steps:
- early-returns
- checkout-all
- install-prerequisites
- run:
name: Build & Test
shell: /bin/bash -l -eo pipefail
command: |
make coverage SHOW=1
make upload-cov SHOW=1
no_output_timeout: 30m
- save-tests-logs

sanitize:
docker:
- image: redisfab/clang:13-x64-bullseye
Expand Down Expand Up @@ -478,6 +494,9 @@ workflows:
platform: [bionic]
- build-macos:
<<: *on-integ-and-version-tags
- coverage:
context: common
<<: *on-any-branch
- sanitize:
name: sanitize-<< matrix.san-type >>
matrix:
Expand Down
39 changes: 34 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export SAN
endif # SAN

ROOT=.
ifeq ($(wildcard $(ROOT)/deps/readies),)
$(shell git submodule update --init --recursive)
ifeq ($(wildcard $(ROOT)/deps/readies/*),)
$(info $(shell git submodule update --init --recursive &> /dev/null))
endif

MK.pyver:=3
include $(ROOT)/deps/readies/mk/main

Expand Down Expand Up @@ -52,6 +53,10 @@ make pytest # run flow tests using RLTest

make pack # build package (RAMP file)

make coverage # perform coverage analysis
make show-cov # show coverage analysis results (implies COV=1)
make upload-cov # upload coverage analysis results to codecov.io (implies COV=1)

make docker
make docker_push

Expand All @@ -73,6 +78,8 @@ endef

#----------------------------------------------------------------------------------------------

SRCDIR=src

MK_CUSTOM_CLEAN=1
BINDIR=$(BINROOT)

Expand All @@ -93,8 +100,7 @@ ifeq ($(DEBUG),1)
ifeq ($(SAN),)
TARGET_DIR=$(BINDIR)/target/debug
else
TARGET_DIR=$(BINDIR)/target/$(RUST_TARGET)/debug
CARGO_TOOLCHAIN = +nightly
NIGHTLY=1
CARGO_FLAGS += -Zbuild-std
RUST_FLAGS += -Zsanitizer=$(SAN)
ifeq ($(SAN),memory)
Expand All @@ -106,10 +112,20 @@ CARGO_FLAGS += --release
TARGET_DIR=$(BINDIR)/target/release
endif

ifeq ($(COV),1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add comments as to why. There's no way anyone remembers this in the future.

NIGHTLY=1
RUST_FLAGS += -Zinstrument-coverage
endif # COV

ifeq ($(PROFILE),1)
RUST_FLAGS += -g -C force-frame-pointers=yes
endif

ifeq ($(NIGHTLY),1)
TARGET_DIR=$(BINDIR)/target/$(RUST_TARGET)/debug
CARGO_TOOLCHAIN = +nightly
endif

export CARGO_TARGET_DIR=$(BINDIR)/target
TARGET=$(BINDIR)/$(MODULE_NAME)

Expand Down Expand Up @@ -141,7 +157,7 @@ RUST_SOEXT.freebsd=so
RUST_SOEXT.macos=dylib

build:
ifeq ($(SAN),)
ifneq ($(NIGHTLY),1)
$(SHOW)set -e ;\
export RUSTFLAGS="$(RUST_FLAGS)" ;\
cargo build --all --all-targets $(CARGO_FLAGS)
Expand Down Expand Up @@ -209,6 +225,19 @@ pack:

#----------------------------------------------------------------------------------------------

COV_EXCLUDE_DIRS += bin deps tests
COV_EXCLUDE.llvm += $(foreach D,$(COV_EXCLUDE_DIRS),'$(realpath $(ROOT))/$(D)/*')

coverage:
$(SHOW)$(MAKE) build COV=1
$(SHOW)$(COVERAGE_RESET.llvm)
-$(SHOW)$(MAKE) test COV=1
$(SHOW)$(COVERAGE_COLLECT_REPORT.llvm)

.PHONY: coverage

#----------------------------------------------------------------------------------------------

docker:
$(SHOW)make -C build/platforms build

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![CircleCI](https://circleci.com/gh/RedisJSON/RedisJSON/tree/master.svg?style=svg)](https://circleci.com/gh/RedisJSON/RedisJSON/tree/master)
[![macos](https://github.com/RedisJSON/RedisJSON/workflows/macos/badge.svg)](https://github.com/RedisJSON/RedisJSON/actions?query=workflow%3Amacos)
[![Dockerhub](https://img.shields.io/badge/dockerhub-redislabs%2Frejson-blue)](https://hub.docker.com/r/redislabs/rejson/tags/)
[![Codecov](https://codecov.io/gh/RedisJSON/RedisJSON/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisJSON/RedisJSON)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/RedisJSON/RedisJSON.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/RedisJSON/RedisJSON/alerts/)

# RedisJSON
Expand Down