diff --git a/.circleci/config.yml b/.circleci/config.yml index 430826646..654c87040 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ restore-workspace: &restore-workspace restore-cache: &restore-cache restore_cache: keys: - - cargo-v1-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} + - cargo-v2-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} - repo-source-{{ .Branch }}-{{ .Revision }} commands: @@ -23,20 +23,9 @@ commands: steps: - *restore-workspace - *restore-cache - - setup_remote_docker: - docker_layer_caching: true - # TODO: move into image - - run: - name: Install Docker client - command: | - set -x - VER="18.09.2" - curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz - tar -xz -C /tmp -f /tmp/docker-$VER.tgz - mv /tmp/docker/* /usr/bin - run: name: Test (<< parameters.target >>) - command: TARGET=<< parameters.target >> ci/run.sh + command: TARGET=<< parameters.target >> ci_scripts/run-rust-test.sh no_output_timeout: 15m jobs: @@ -52,7 +41,7 @@ jobs: command: cargo generate-lockfile - restore_cache: keys: - - cargo-v1-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} + - cargo-v2-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} - run: rustup install $(cat rust-toolchain) - run: rustup default $(cat rust-toolchain) - run: rustup component add --toolchain $(cat rust-toolchain) rustfmt @@ -61,13 +50,14 @@ jobs: - run: cargo fetch - run: rustc +stable --version - run: rustc +$(cat rust-toolchain) --version - - run: rm -rf .git + # make sure this git repo doesn't grow too big + - run: git gc - persist_to_workspace: root: /mnt paths: - crate - save_cache: - key: cargo-v1-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} + key: cargo-v2-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}-{{ arch }} paths: - "~/.cargo" - "~/.rustup" @@ -102,7 +92,7 @@ jobs: - run: cargo fetch - run: name: Test - command: TARGET=x86_64-apple-darwin ci/run.sh + command: TARGET=x86_64-apple-darwin ci_scripts/run-rust-test.sh test_x86_64-unknown-linux-gnu: executor: default @@ -124,18 +114,18 @@ jobs: build_test_docs_wheel: - machine: True - steps: - - checkout - # - run: docker pull deltachat/doxygen - - run: docker pull deltachat/coredeps - - run: - name: build docs, run tests and build wheels - command: ci_scripts/ci_run.sh - environment: + docker: + - image: deltachat/coredeps + environment: TESTS: 1 DOCS: 1 - + working_directory: /mnt/crate + steps: + - *restore-workspace + - *restore-cache + - run: + name: build docs, run tests and build wheels + command: ci_scripts/run-python.sh - run: name: copying docs and wheels to workspace command: | @@ -143,7 +133,6 @@ jobs: # cp -av docs workspace/c-docs cp -av python/.docker-tox/wheelhouse workspace/ cp -av python/doc/_build/ workspace/py-docs - - persist_to_workspace: root: workspace paths: @@ -176,15 +165,16 @@ workflows: test: jobs: - - build_test_docs_wheel + - cargo_fetch + - build_test_docs_wheel: + requires: + - cargo_fetch - upload_docs_wheels: requires: - build_test_docs_wheel - - cargo_fetch - rustfmt: requires: - cargo_fetch - - clippy: requires: - cargo_fetch diff --git a/ci_scripts/ci_run.sh b/ci_scripts/ci_run.sh deleted file mode 100755 index a8c38e5f6..000000000 --- a/ci_scripts/ci_run.sh +++ /dev/null @@ -1,22 +0,0 @@ -# perform CI jobs on PRs and after merges to master. -# triggered from .circleci/config.yml - -set -e -x - -export BRANCH=${CIRCLE_BRANCH:-test7} - -# run doxygen on c-source (needed by later doc-generation steps). -# XXX modifies the host filesystem docs/xml and docs/html directories -# XXX which you can then only remove with sudo as they belong to root - -# XXX we don't do doxygen doc generation with Rust anymore, needs to be -# substituted with rust-docs -#if [ -n "$DOCS" ] ; then -# docker run --rm -it -v $PWD:/mnt -w /mnt/docs deltachat/doxygen doxygen -#fi - -# run everything else inside docker (TESTS, DOCS, WHEELS) -docker run -e DCC_PY_LIVECONFIG -e BRANCH -e TESTS -e DOCS \ - --rm -it -v $(pwd):/mnt -w /mnt \ - deltachat/coredeps ci_scripts/run_all.sh - diff --git a/ci_scripts/run_all.sh b/ci_scripts/run-python.sh similarity index 63% rename from ci_scripts/run_all.sh rename to ci_scripts/run-python.sh index a55fb5129..f7fe602b4 100755 --- a/ci_scripts/run_all.sh +++ b/ci_scripts/run-python.sh @@ -36,20 +36,21 @@ if [ -n "$TESTS" ]; then rm -rf src/deltachat/__pycache__ export PYTHONDONTWRITEBYTECODE=1 - # run tox - # XXX we don't run liveconfig tests because they hang sometimes - # see https://github.com/deltachat/deltachat-core-rust/issues/331 - # unset DCC_PY_LIVECONFIG + # run tox. The circle-ci project env-var-setting DCC_PY_LIVECONFIG + # allows running of "liveconfig" tests but for speed reasons + # we run them only for the highest python version we support - tox --workdir "$TOXWORKDIR" -e lint,py35,py36,py37,auditwheels -- -k "not qr" - tox --workdir "$TOXWORKDIR" -e py35,py36,py37 -- -k "qr" + tox --workdir "$TOXWORKDIR" -e py37 + unset DCC_PY_LIVECONFIG + tox --workdir "$TOXWORKDIR" -p4 -e lint,py35,py36,doc + tox --workdir "$TOXWORKDIR" -e auditwheels popd fi -if [ -n "$DOCS" ]; then - echo ----------------------- - echo generating python docs - echo ----------------------- - (cd python && tox --workdir "$TOXWORKDIR" -e doc) -fi +# if [ -n "$DOCS" ]; then +# echo ----------------------- +# echo generating python docs +# echo ----------------------- +# (cd python && tox --workdir "$TOXWORKDIR" -e doc) +# fi diff --git a/ci/run.sh b/ci_scripts/run-rust-test.sh similarity index 92% rename from ci/run.sh rename to ci_scripts/run-rust-test.sh index e61a4abbc..1b922f1b4 100755 --- a/ci/run.sh +++ b/ci_scripts/run-rust-test.sh @@ -39,8 +39,4 @@ fi # Run all the test configurations: $CARGO_CMD $CARGO_SUBCMD $OPT -$CARGO_CMD $CARGO_SUBCMD $OPT_RELEASE $CARGO_CMD $CARGO_SUBCMD $OPT_RELEASE_IGNORED - -# Build the ffi lib -$CARGO_CMD $CARGO_SUBCMD $OPT_FFI_RELEASE diff --git a/python/tests/test_increation.py b/python/tests/test_increation.py index b43d5552c..97f906453 100644 --- a/python/tests/test_increation.py +++ b/python/tests/test_increation.py @@ -4,7 +4,7 @@ from deltachat import const from conftest import wait_configuration_progress, wait_msgs_changed -class TestInCreation: +class TestOnlineInCreation: def test_forward_increation(self, acfactory, data, lp): ac1 = acfactory.get_online_configuring_account() ac2 = acfactory.get_online_configuring_account() diff --git a/python/tox.ini b/python/tox.ini index 51392338d..a61e033ef 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -19,12 +19,12 @@ deps = pytest-rerunfailures pytest-timeout pytest-xdist - auditwheel pdbpp requests [testenv:auditwheels] skipsdist = True +deps = auditwheel commands = python tests/auditwheels.py {toxworkdir}/wheelhouse @@ -45,7 +45,7 @@ commands = [testenv:doc] basepython = python3.5 deps = - sphinx==2.0.1 + sphinx==2.2.0 breathe changedir = doc