Skip to content
Open
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
14 changes: 4 additions & 10 deletions .github/workflows/build-lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,8 @@ jobs:
path: ${{ env.INTEGRATION_TEST_BIN }}
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}

- name: Install valgrind
run: make install-valgrind-if-missing

- name: Install binary dependencies
run: make install-bin-dependencies
- name: Prepare environment
run: make update-rust-tooling prepare-integration-test

- name: Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }}
id: run-integration-tests
Expand Down Expand Up @@ -217,11 +214,8 @@ jobs:
path: ${{ env.INTEGRATION_TEST_BIN }}
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}

- name: Install valgrind
run: make install-valgrind-if-missing

- name: Install binary dependencies
run: make install-bin-dependencies
- name: Prepare environment
run: make update-rust-tooling prepare-integration-test

- name: Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }}
id: run-integration-tests
Expand Down
28 changes: 17 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -259,31 +259,31 @@ build-examples:
cmake -DCASS_BUILD_INTEGRATION_TESTS=off -DCASS_BUILD_EXAMPLES=on -DCMAKE_BUILD_TYPE=Release .. && (make -j 4 || make);\
}

_update-rust-tooling:
update-rust-tooling:
@echo "Run rustup update"
@rustup update stable

check-cargo: install-cargo-if-missing _update-rust-tooling
check-cargo: install-cargo-if-missing
@echo "Running \"cargo check\" in ./scylla-rust-wrapper"
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo check --all-targets

fix-cargo:
@echo "Running \"cargo fix --verbose --all\" in ./scylla-rust-wrapper"
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo fix --verbose --all

check-cargo-clippy: install-cargo-if-missing _update-rust-tooling
check-cargo-clippy: install-cargo-if-missing
@echo "Running \"cargo clippy --verbose --all-targets -- -D warnings -Aclippy::uninlined_format_args\" in ./scylla-rust-wrapper"
@cd ${CURRENT_DIR}/scylla-rust-wrapper; RUSTFLAGS="${FULL_RUSTFLAGS}" cargo clippy --verbose --all-targets -- -D warnings -Aclippy::uninlined_format_args

fix-cargo-clippy: install-cargo-if-missing _update-rust-tooling
fix-cargo-clippy: install-cargo-if-missing
@echo "Running \"cargo clippy --verbose --all-targets --fix -- -D warnings -Aclippy::uninlined_format_args\" in ./scylla-rust-wrapper"
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo clippy --verbose --all-targets --fix -- -D warnings -Aclippy::uninlined_format_args

check-cargo-fmt: install-cargo-if-missing _update-rust-tooling
check-cargo-fmt: install-cargo-if-missing
@echo "Running \"cargo fmt --verbose --all -- --check\" in ./scylla-rust-wrapper"
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo fmt --verbose --all -- --check

fix-cargo-fmt: install-cargo-if-missing _update-rust-tooling
fix-cargo-fmt: install-cargo-if-missing
@echo "Running \"cargo fmt --verbose --all\" in ./scylla-rust-wrapper"
@cd ${CURRENT_DIR}/scylla-rust-wrapper; cargo fmt --verbose --all

Expand All @@ -299,10 +299,16 @@ check: check-clang-format check-cargo check-cargo-clippy check-cargo-fmt

fix: fix-clang-format fix-cargo fix-cargo-clippy fix-cargo-fmt

prepare-integration-test: update-apt-cache-if-needed install-valgrind-if-missing install-cargo-if-missing _update-rust-tooling
@sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
.prepare-environment-update-aio-max-nr:
@if (( $$(< /proc/sys/fs/aio-max-nr) < 2097152 )); then \
echo 2097152 | sudo tee /proc/sys/fs/aio-max-nr >/dev/null; \
fi

.prepare-environment-install-libc:
@dpkg -l libc6-dbg >/dev/null 2>&1 || sudo apt-get install -y libc6-dbg

prepare-integration-test: .prepare-environment-install-libc update-apt-cache-if-needed install-valgrind-if-missing install-cargo-if-missing

download-ccm-scylla-image: install-ccm-if-missing
@echo "Downloading scylla ${SCYLLA_VERSION} CCM image"
@rm -rf /tmp/download-scylla.ccm || true
Expand All @@ -317,7 +323,7 @@ download-ccm-cassandra-image: install-ccm-if-missing
@ccm create ccm_1 -i 127.0.1. -n 3:0 -v "${CASSANDRA_VERSION}" --config-dir=/tmp/download-cassandra.ccm
@rm -rf /tmp/download-cassandra.ccm

run-test-integration-scylla: prepare-integration-test download-ccm-scylla-image
run-test-integration-scylla: .prepare-environment-update-aio-max-nr prepare-integration-test
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correctly that it will still call prepare-integration-test, which is something that prepares the environment? What it does:

  • prepare-environment-install-libc which calls dpkg
  • update-apt-cache-if-needed which calls apt-get
  • install-valgrind-if-missing which calls apt

It is fine to check if required tools are installed, and error out if not, but lets not implicitly install them. Installing in separate target is fine. Can you remove prepare-integration-test from user-facing targets (such as run-test-integration-scylla)?

ifdef DONT_REBUILD_INTEGRATION_BIN
run-test-integration-scylla: build-integration-test-bin-if-missing
else
Expand All @@ -328,7 +334,7 @@ endif
@echo "Running timeout sensitive tests on scylla ${SCYLLA_VERSION}"
build/cassandra-integration-tests --scylla --version=${SCYLLA_VERSION} --category=CASSANDRA --verbose=ccm --gtest_filter="${SCYLLA_NO_VALGRIND_TEST_FILTER}"

run-test-integration-cassandra: prepare-integration-test download-ccm-cassandra-image install-java8-if-missing
run-test-integration-cassandra: install-java8-if-missing prepare-integration-test
ifdef DONT_REBUILD_INTEGRATION_BIN
run-test-integration-cassandra: build-integration-test-bin-if-missing
else
Expand All @@ -339,7 +345,7 @@ endif
@echo "Running timeout sensitive tests on cassandra ${CASSANDRA_VERSION}"
build/cassandra-integration-tests --version=${CASSANDRA_VERSION} --category=CASSANDRA --verbose=ccm --gtest_filter="${CASSANDRA_NO_VALGRIND_TEST_FILTER}"

run-test-unit: install-cargo-if-missing _update-rust-tooling
run-test-unit: install-cargo-if-missing
@cd ${CURRENT_DIR}/scylla-rust-wrapper; RUSTFLAGS="${FULL_RUSTFLAGS}" cargo test

# Currently not used.
Expand Down
Loading