mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 23:09:11 +00:00
split tests
This commit is contained in:
35
test-ng.sh
vendored
Executable file
35
test-ng.sh
vendored
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# author: deadc0de6 (https://github.com/deadc0de6)
|
||||||
|
# Copyright (c) 2023, deadc0de6
|
||||||
|
|
||||||
|
# stop on first error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
tmpworkdir="/tmp/dotdrop-tests-workdir"
|
||||||
|
export DOTDROP_WORKDIR="${tmpworkdir}"
|
||||||
|
|
||||||
|
workers=${DOTDROP_WORKERS}
|
||||||
|
if [ ! -z ${workers} ]; then
|
||||||
|
DOTDROP_WORKERS=${workers}
|
||||||
|
echo "ENABLE workers: ${workers}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# run bash tests
|
||||||
|
export DOTDROP_DEBUG="yes"
|
||||||
|
unset DOTDROP_FORCE_NODEBUG
|
||||||
|
workdir_tmp_exists="no"
|
||||||
|
[ -d "~/.config/dotdrop/tmp" ] && workdir_tmp_exists="yes"
|
||||||
|
if [ -z ${GITHUB_WORKFLOW} ]; then
|
||||||
|
## local
|
||||||
|
export COVERAGE_FILE=
|
||||||
|
tests-ng/tests-launcher.py
|
||||||
|
else
|
||||||
|
## CI/CD
|
||||||
|
export COVERAGE_FILE="${cur}/.coverage"
|
||||||
|
tests-ng/tests-launcher.py 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# clear workdir
|
||||||
|
[ "${workdir_tmp_exists}" = "no" ] && rm -rf ~/.config/dotdrop/tmp
|
||||||
|
# clear temp workdir
|
||||||
|
rm -rf "${tmpworkdir}"
|
||||||
27
test-unittest.sh
vendored
Executable file
27
test-unittest.sh
vendored
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# author: deadc0de6 (https://github.com/deadc0de6)
|
||||||
|
# Copyright (c) 2023, deadc0de6
|
||||||
|
|
||||||
|
# stop on first error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
workers=${DOTDROP_WORKERS}
|
||||||
|
if [ ! -z ${workers} ]; then
|
||||||
|
unset DOTDROP_WORKERS
|
||||||
|
echo "DISABLE workers"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# execute tests with coverage
|
||||||
|
if [ -z ${GITHUB_WORKFLOW} ]; then
|
||||||
|
## local
|
||||||
|
export COVERAGE_FILE=
|
||||||
|
# do not print debugs when running tests (faster)
|
||||||
|
# tests
|
||||||
|
PYTHONPATH="dotdrop" nose2 --with-coverage --coverage dotdrop --plugin=nose2.plugins.mp -N0
|
||||||
|
else
|
||||||
|
## CI/CD
|
||||||
|
export COVERAGE_FILE="${cur}/.coverage"
|
||||||
|
# tests
|
||||||
|
PYTHONPATH="dotdrop" nose2 --with-coverage --coverage dotdrop
|
||||||
|
fi
|
||||||
|
#PYTHONPATH="dotdrop" python3 -m pytest tests
|
||||||
57
tests.sh
vendored
57
tests.sh
vendored
@@ -24,56 +24,13 @@ ${cur}/test-syntax.sh
|
|||||||
echo "checking documentation..."
|
echo "checking documentation..."
|
||||||
${cur}/test-doc.sh
|
${cur}/test-doc.sh
|
||||||
|
|
||||||
workers=${DOTDROP_WORKERS}
|
# unittest
|
||||||
if [ ! -z ${workers} ]; then
|
echo "unittest..."
|
||||||
unset DOTDROP_WORKERS
|
${cur}/test-unittest.sh
|
||||||
echo "DISABLE workers"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# execute tests with coverage
|
# tests-ng
|
||||||
echo "unit tests..."
|
echo "tests-ng..."
|
||||||
if [ -z ${GITHUB_WORKFLOW} ]; then
|
${cur}/test-ng.sh
|
||||||
## local
|
|
||||||
export COVERAGE_FILE=
|
|
||||||
# do not print debugs when running tests (faster)
|
|
||||||
# tests
|
|
||||||
PYTHONPATH="dotdrop" nose2 --with-coverage --coverage dotdrop --plugin=nose2.plugins.mp -N0
|
|
||||||
else
|
|
||||||
## CI/CD
|
|
||||||
export COVERAGE_FILE="${cur}/.coverage"
|
|
||||||
# tests
|
|
||||||
PYTHONPATH="dotdrop" nose2 --with-coverage --coverage dotdrop
|
|
||||||
fi
|
|
||||||
#PYTHONPATH="dotdrop" python3 -m pytest tests
|
|
||||||
|
|
||||||
tmpworkdir="/tmp/dotdrop-tests-workdir"
|
|
||||||
export DOTDROP_WORKDIR="${tmpworkdir}"
|
|
||||||
|
|
||||||
if [ ! -z ${workers} ]; then
|
|
||||||
DOTDROP_WORKERS=${workers}
|
|
||||||
echo "ENABLE workers: ${workers}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# run bash tests
|
|
||||||
echo "CICD tests..."
|
|
||||||
export DOTDROP_DEBUG="yes"
|
|
||||||
unset DOTDROP_FORCE_NODEBUG
|
|
||||||
workdir_tmp_exists="no"
|
|
||||||
[ -d "~/.config/dotdrop/tmp" ] && workdir_tmp_exists="yes"
|
|
||||||
if [ -z ${GITHUB_WORKFLOW} ]; then
|
|
||||||
## local
|
|
||||||
export COVERAGE_FILE=
|
|
||||||
tests-ng/tests-launcher.py
|
|
||||||
else
|
|
||||||
## CI/CD
|
|
||||||
export COVERAGE_FILE="${cur}/.coverage"
|
|
||||||
tests-ng/tests-launcher.py 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# clear workdir
|
|
||||||
[ "${workdir_tmp_exists}" = "no" ] && rm -rf ~/.config/dotdrop/tmp
|
|
||||||
# clear temp workdir
|
|
||||||
rm -rf "${tmpworkdir}"
|
|
||||||
|
|
||||||
## done
|
## done
|
||||||
echo "All test finished successfully"
|
echo "All tests finished successfully"
|
||||||
|
|||||||
Reference in New Issue
Block a user