Skip to content
Snippets Groups Projects
Unverified Commit 171c219f authored by bgallois's avatar bgallois
Browse files

ci: add benchmark tests

parent 228a9d7e
No related branches found
No related tags found
No related merge requests found
Pipeline #34188 waiting for manual action
This commit is part of merge request !188. Comments created here will be created in the context of that merge request.
...@@ -185,6 +185,21 @@ build_release_tag: ...@@ -185,6 +185,21 @@ build_release_tag:
IMAGE_TAG: "$CI_COMMIT_TAG" IMAGE_TAG: "$CI_COMMIT_TAG"
PODMAN_BUILD_OPTIONS: "--platform linux/amd64" PODMAN_BUILD_OPTIONS: "--platform linux/amd64"
run_benchmarks:
stage: tests
extends: .docker_build
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
variables:
IMAGE_NAME: "duniter/duniter-v2s-test"
IMAGE_TAG: "debug-sha-$CI_COMMIT_SHORT_SHA"
PODMAN_BUILD_OPTIONS: "--target build --build-arg benchmarks=1"
tests: tests:
stage: tests stage: tests
image: rust:1-bullseye image: rust:1-bullseye
......
...@@ -33,6 +33,11 @@ RUN if [ "$debug" = 0 ]; then \ ...@@ -33,6 +33,11 @@ RUN if [ "$debug" = 0 ]; then \
echo "TARGET_FOLDER=debug" >>/root/dynenv; \ echo "TARGET_FOLDER=debug" >>/root/dynenv; \
fi fi
ARG benchmarks=0
RUN if [ "$benchmarks" != 0 ]; then \
echo "BENCH_OPTIONS=runtime-benchmarks" >>/root/dynenv; \
fi
# Configure cross-build environment if need be # Configure cross-build environment if need be
RUN set -x && \ RUN set -x && \
if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \
...@@ -48,7 +53,7 @@ ARG chain="gdev" ...@@ -48,7 +53,7 @@ ARG chain="gdev"
RUN set -x && \ RUN set -x && \
cat /root/dynenv && \ cat /root/dynenv && \
. /root/dynenv && \ . /root/dynenv && \
cargo build --locked $CARGO_OPTIONS --no-default-features --features $chain --target "$RUST_ARCH_TRIPLET" && \ cargo build --locked $CARGO_OPTIONS --no-default-features --features $BENCH_OPTIONS $chain --target "$RUST_ARCH_TRIPLET" && \
mkdir -p build && \ mkdir -p build && \
mv target/$RUST_ARCH_TRIPLET/$TARGET_FOLDER/duniter build/ mv target/$RUST_ARCH_TRIPLET/$TARGET_FOLDER/duniter build/
...@@ -56,11 +61,17 @@ RUN set -x && \ ...@@ -56,11 +61,17 @@ RUN set -x && \
ARG cucumber=0 ARG cucumber=0
RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \ RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \
cargo ta && \ cargo ta && \
cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests --features runtime-benchmarks \
cd target/debug/deps/ && \ cd target/debug/deps/ && \
rm cucumber_tests-*.d && \ rm cucumber_tests-*.d && \
mv cucumber_tests* ../../../build/duniter-cucumber; \ mv cucumber_tests* ../../../build/duniter-cucumber; \
fi fi
# Run runtime benchmarks
RUN if [ "$benchmarks" != 0 ]; then \
build/duniter benchmark pallet --chain dev --execution=wasm --wasm-execution=compiled --pallet "*" --extrinsic "*" --steps 2 --repeat 1; \
fi
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Final Stage # Final Stage
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment