Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
ci: massively reduce tests
Browse files Browse the repository at this point in the history
  • Loading branch information
5chdn committed Dec 12, 2018
1 parent 323295c commit 6369f0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 98 deletions.
2 changes: 0 additions & 2 deletions clique.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ sed -i '/\#driver\:\ local/d' docker-compose.yaml
sed -i '/driver\_opts\:/d' docker-compose.yaml
sed -i '/o\:\ uid\=1000\,gid\=1000/d' docker-compose.yaml

cat docker-compose.yaml

docker-compose up
99 changes: 3 additions & 96 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,100 +1,7 @@
#!/bin/sh
# Running Parity Full Test Suite

FEATURES="json-tests,ci-skip-issue"
OPTIONS="--release"
VALIDATE=1
THREADS=8

case $1 in
--no-json)
FEATURES="ipc"
shift # past argument=value
;;
--no-release)
OPTIONS=""
shift
;;
--no-validate)
VALIDATE=0
shift
;;
--no-run)
OPTIONS="--no-run"
shift
;;
*)
# unknown option
;;
esac

set -e


validate () {
if [ "$VALIDATE" -eq "1" ]
then
echo "________Validate build________"
time cargo check $@ --no-default-features
time cargo check $@ --manifest-path util/io/Cargo.toml --no-default-features
time cargo check $@ --manifest-path util/io/Cargo.toml --features "mio"

# Validate chainspecs
echo "________Validate chainspecs________"
time ./scripts/validate_chainspecs.sh
else
echo "# not validating due to \$VALIDATE!=1"
fi
}

cpp_test () {
case $CARGO_TARGET in
(x86_64-unknown-linux-gnu)
# Running the C++ example
echo "________Running the C++ example________"
cd parity-clib-examples/cpp && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j $THREADS && \
./parity-example && \
cd .. && \
rm -rf build && \
cd ../..
;;
(*)
echo "________Skipping the C++ example________"
;;
esac
}

cargo_test () {
echo "________Running Parity Full Test Suite________"
git submodule update --init --recursive
time cargo test $OPTIONS --features "$FEATURES" --all $@ -- --test-threads $THREADS
}


if [ "$CARGO_TARGET" ]
then
validate --target $CARGO_TARGET
else
validate
fi

test "${RUN_TESTS}" = "all" && cpp_test

if [ "$CARGO_TARGET" ]
then

case "${RUN_TESTS}" in
(cargo|all)
cargo_test --target $CARGO_TARGET $@
;;
('')
cargo_test --no-run --target $CARGO_TARGET $@
;;
esac
else
cargo_test $@
fi
git submodule update --init --recursive
$TRAVIS_BUILD_DIR/scripts/validate_chainspecs.sh
cargo test --features json-tests,ci-skip-issue --all $@ -- --test-threads 8

0 comments on commit 6369f0b

Please sign in to comment.