mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
build: make scripts for remote testing usable
This updates `scripts/remote_tests_{rust,python}.sh`.
The scripts were previously used to run tests
from CI on remote faster machine,
but they are still usable to run tests remotely
e.g. from a laptop that is on battery.
This commit is contained in:
@@ -26,10 +26,10 @@ and an own build machine.
|
|||||||
i.e. `deltachat-rpc-client` and `deltachat-rpc-server`.
|
i.e. `deltachat-rpc-client` and `deltachat-rpc-server`.
|
||||||
|
|
||||||
- `remote_tests_python.sh` rsyncs to a build machine and runs
|
- `remote_tests_python.sh` rsyncs to a build machine and runs
|
||||||
`run-python-test.sh` remotely on the build machine.
|
JSON-RPC Python tests remotely on the build machine.
|
||||||
|
|
||||||
- `remote_tests_rust.sh` rsyncs to the build machine and runs
|
- `remote_tests_rust.sh` rsyncs to the build machine and runs
|
||||||
`run-rust-test.sh` remotely on the build machine.
|
Rust tests remotely on the build machine.
|
||||||
|
|
||||||
- `run-doxygen.sh` generates C-docs which are then uploaded to https://c.delta.chat/
|
- `run-doxygen.sh` generates C-docs which are then uploaded to https://c.delta.chat/
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
BUILD_ID=${1:?specify build ID}
|
set -x
|
||||||
|
if ! test -v SSHTARGET; then
|
||||||
SSHTARGET=${SSHTARGET-ci@b1.delta.chat}
|
echo >&2 SSHTARGET is not set
|
||||||
BUILDDIR=ci_builds/$BUILD_ID
|
exit 1
|
||||||
|
fi
|
||||||
|
BUILDDIR=ci_builds/chatmailcore
|
||||||
|
|
||||||
echo "--- Copying files to $SSHTARGET:$BUILDDIR"
|
echo "--- Copying files to $SSHTARGET:$BUILDDIR"
|
||||||
|
|
||||||
set -xe
|
rsync -az --delete --mkpath --files-from=<(git ls-files) ./ "$SSHTARGET:$BUILDDIR"
|
||||||
|
|
||||||
ssh -oBatchMode=yes -oStrictHostKeyChecking=no $SSHTARGET mkdir -p "$BUILDDIR"
|
|
||||||
git ls-files >.rsynclist
|
|
||||||
# we seem to need .git for setuptools_scm versioning
|
|
||||||
find .git >>.rsynclist
|
|
||||||
rsync --delete --files-from=.rsynclist -az ./ "$SSHTARGET:$BUILDDIR"
|
|
||||||
|
|
||||||
set +x
|
|
||||||
|
|
||||||
echo "--- Running Python tests remotely"
|
echo "--- Running Python tests remotely"
|
||||||
|
|
||||||
ssh $SSHTARGET <<_HERE
|
ssh -oBatchMode=yes -- "$SSHTARGET" <<_HERE
|
||||||
set +x -e
|
set +x -e
|
||||||
|
|
||||||
# make sure all processes exit when ssh dies
|
# make sure all processes exit when ssh dies
|
||||||
shopt -s huponexit
|
shopt -s huponexit
|
||||||
|
|
||||||
export RUSTC_WRAPPER=\`which sccache\`
|
export RUSTC_WRAPPER=\`command -v sccache\`
|
||||||
cd $BUILDDIR
|
cd $BUILDDIR
|
||||||
export TARGET=release
|
|
||||||
export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN
|
export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN
|
||||||
|
|
||||||
#we rely on tox/virtualenv being available in the host
|
scripts/make-rpc-testenv.sh
|
||||||
#rm -rf virtualenv venv
|
. venv/bin/activate
|
||||||
#virtualenv -q -p python3.7 venv
|
|
||||||
#source venv/bin/activate
|
|
||||||
#pip install -q tox virtualenv
|
|
||||||
|
|
||||||
set -x
|
cd deltachat-rpc-client
|
||||||
which python
|
pytest -n6 $@
|
||||||
source \$HOME/venv/bin/activate
|
|
||||||
which python
|
|
||||||
|
|
||||||
bash scripts/run-python-test.sh
|
|
||||||
_HERE
|
_HERE
|
||||||
|
|||||||
@@ -1,29 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
BUILD_ID=${1:?specify build ID}
|
if ! test -v SSHTARGET; then
|
||||||
|
echo >&2 SSHTARGET is not set
|
||||||
SSHTARGET=${SSHTARGET-ci@b1.delta.chat}
|
exit 1
|
||||||
BUILDDIR=ci_builds/$BUILD_ID
|
fi
|
||||||
|
BUILDDIR=ci_builds/chatmailcore
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "--- Copying files to $SSHTARGET:$BUILDDIR"
|
echo "--- Copying files to $SSHTARGET:$BUILDDIR"
|
||||||
|
|
||||||
ssh -oBatchMode=yes -oStrictHostKeyChecking=no $SSHTARGET mkdir -p "$BUILDDIR"
|
rsync -az --delete --mkpath --files-from=<(git ls-files) ./ "$SSHTARGET:$BUILDDIR"
|
||||||
git ls-files >.rsynclist
|
|
||||||
rsync --delete --files-from=.rsynclist -az ./ "$SSHTARGET:$BUILDDIR"
|
|
||||||
|
|
||||||
echo "--- Running Rust tests remotely"
|
echo "--- Running Rust tests remotely"
|
||||||
|
|
||||||
ssh $SSHTARGET <<_HERE
|
ssh -oBatchMode=yes -- "$SSHTARGET" <<_HERE
|
||||||
set +x -e
|
set +x -e
|
||||||
# make sure all processes exit when ssh dies
|
# make sure all processes exit when ssh dies
|
||||||
shopt -s huponexit
|
shopt -s huponexit
|
||||||
export RUSTC_WRAPPER=\`which sccache\`
|
export RUSTC_WRAPPER=\`command -v sccache\`
|
||||||
cd $BUILDDIR
|
cd $BUILDDIR
|
||||||
export TARGET=x86_64-unknown-linux-gnu
|
|
||||||
export RUSTC_WRAPPER=sccache
|
|
||||||
|
|
||||||
bash scripts/run-rust-test.sh
|
cargo nextest run
|
||||||
_HERE
|
_HERE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user