mirror of
https://github.com/bia-technologies/yaxunit.git
synced 2024-11-24 08:22:22 +02:00
test: скрипты локального тестирования
This commit is contained in:
parent
1cb9e19e3c
commit
ff7b28f488
1
.gitignore
vendored
1
.gitignore
vendored
@ -37,3 +37,4 @@ tests/.settings/*
|
|||||||
documentation/api/
|
documentation/api/
|
||||||
*.jar
|
*.jar
|
||||||
/tools/**/distr/
|
/tools/**/distr/
|
||||||
|
workpath/
|
2
tools/local-test/.env
Normal file
2
tools/local-test/.env
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export EDT_VERSION=2023.3.5+10
|
||||||
|
export ONEC_VERSION=8.3.21.1895
|
BIN
tools/local-test/scripts/DisableSafeMode.epf
Normal file
BIN
tools/local-test/scripts/DisableSafeMode.epf
Normal file
Binary file not shown.
27
tools/local-test/scripts/build-artifacts.sh
Executable file
27
tools/local-test/scripts/build-artifacts.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
TEMP_DB_PATH=$TMP_PATH/file-db
|
||||||
|
rm -rf $TEMP_DB_PATH/*
|
||||||
|
rm -rf $$BINARY_PATH/*
|
||||||
|
|
||||||
|
echo "=========== Создание информационной базы"
|
||||||
|
$ONEC_PATH/ibcmd infobase create --db-path=$TEMP_DB_PATH --import=$EXPORT_PATH/configuration --apply --force
|
||||||
|
|
||||||
|
echo "=========== Импорт расширения Smoke"
|
||||||
|
$ONEC_PATH/ibcmd infobase config import --db-path=$TEMP_DB_PATH --extension=Smoke $EXPORT_PATH/smoke
|
||||||
|
|
||||||
|
echo "=========== Импорт расширения tests"
|
||||||
|
$ONEC_PATH/ibcmd infobase config import --db-path=$TEMP_DB_PATH --extension=tests $EXPORT_PATH/tests
|
||||||
|
|
||||||
|
echo "=========== Импорт расширения YAXUNIT"
|
||||||
|
$ONEC_PATH/ibcmd infobase config import --db-path=$TEMP_DB_PATH --extension=YAXUNIT $EXPORT_PATH/yaxunit
|
||||||
|
|
||||||
|
echo "=========== Сохрание тестовой конфигурации"
|
||||||
|
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH $BINARY_PATH/configuration.cf
|
||||||
|
|
||||||
|
echo "=========== Сохрание расширения YAxUnit"
|
||||||
|
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH --extension=YAXUNIT $BINARY_PATH/yaxunit.cfe
|
||||||
|
|
||||||
|
echo "=========== Сохрание расширения с тестами"
|
||||||
|
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH --extension=tests $BINARY_PATH/tests.cfe
|
||||||
|
|
||||||
|
echo "=========== Сохрание расширения с дымовыми тестами"
|
||||||
|
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH --extension=Smoke $BINARY_PATH/smoke.cfe
|
13
tools/local-test/scripts/convert-to-xml.sh
Executable file
13
tools/local-test/scripts/convert-to-xml.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
rm -rf $EXPORT_PATH/*
|
||||||
|
|
||||||
|
echo "Конвертация configuration"
|
||||||
|
$EDT_PATH/1cedtcli -data $TMP_PATH/ws -timeout 300 -command export --configuration-files $EXPORT_PATH/configuration --project $ROOT_PATH/fixtures/demo-configuration
|
||||||
|
|
||||||
|
echo "Конвертация yaxunit"
|
||||||
|
$EDT_PATH/1cedtcli -data $TMP_PATH/ws -timeout 300 -command export --configuration-files $EXPORT_PATH/yaxunit --project $ROOT_PATH/exts/yaxunit
|
||||||
|
|
||||||
|
echo "Конвертация smoke"
|
||||||
|
$EDT_PATH/1cedtcli -data $TMP_PATH/ws -timeout 300 -command export --configuration-files $EXPORT_PATH/smoke --project $ROOT_PATH/exts/smoke
|
||||||
|
|
||||||
|
echo "Конвертация тесты"
|
||||||
|
$EDT_PATH/1cedtcli -data $TMP_PATH/ws -timeout 300 -command export --configuration-files $EXPORT_PATH/tests --project $ROOT_PATH/tests
|
23
tools/local-test/scripts/create-ib.sh
Executable file
23
tools/local-test/scripts/create-ib.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
CONNECTION_STRING=$1
|
||||||
|
JOB_NAME=$2
|
||||||
|
|
||||||
|
BASE_ARGUMENTS="$CONNECTION_STRING /DisableStartupDialogs /DisableStartupMessages"
|
||||||
|
DESIGNER_COMMAND="$ONEC_PATH/1cv8 DESIGNER $BASE_ARGUMENTS"
|
||||||
|
|
||||||
|
echo "=========== Создание информационной базы ($JOB_NAME)"
|
||||||
|
$ONEC_PATH/1cv8 CREATEINFOBASE File=$TEMP_DB_PATH
|
||||||
|
|
||||||
|
echo "=========== Загрузка конфигурации ($JOB_NAME)"
|
||||||
|
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/configuration.cf /UpdateDBCfg
|
||||||
|
|
||||||
|
echo "=========== Загрузка расширения YAXUNIT ($JOB_NAME)"
|
||||||
|
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/yaxunit.cfe -Extension YAXUNIT /UpdateDBCfg
|
||||||
|
|
||||||
|
echo "=========== Загрузка расширения tests ($JOB_NAME)"
|
||||||
|
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/tests.cfe -Extension tests /UpdateDBCfg
|
||||||
|
|
||||||
|
echo "=========== Загрузка расширения Smoke ($JOB_NAME)"
|
||||||
|
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/smoke.cfe -Extension Smoke /UpdateDBCfg
|
||||||
|
|
||||||
|
echo "=========== Снятие безопасного режима ($JOB_NAME)"
|
||||||
|
$ONEC_PATH/1cv8 ENTERPRISE $BASE_ARGUMENTS /Execute $SCRIPTPATH/DisableSafeMode.epf
|
40
tools/local-test/scripts/make.sh
Executable file
40
tools/local-test/scripts/make.sh
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
export SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
|
|
||||||
|
source $SCRIPTPATH/../.env
|
||||||
|
|
||||||
|
export EDT_PATH=/opt/1C/1CE/components/1c-edt-$EDT_VERSION-x86_64
|
||||||
|
export ONEC_PATH=/opt/1cv8/x86_64/$ONEC_VERSION
|
||||||
|
|
||||||
|
export WORK_PATH=$(realpath $SCRIPTPATH/../workpath)
|
||||||
|
export ROOT_PATH=$(realpath $SCRIPTPATH/../../../)
|
||||||
|
|
||||||
|
export TMP_PATH=$WORK_PATH/tmp
|
||||||
|
export DB_PATH=$WORK_PATH/file-db
|
||||||
|
export EXPORT_PATH=$WORK_PATH/export
|
||||||
|
export BINARY_PATH=$WORK_PATH/binary
|
||||||
|
export RESULT_PATH=$WORK_PATH/result
|
||||||
|
|
||||||
|
|
||||||
|
mkdir -p $DB_PATH
|
||||||
|
mkdir -p $EXPORT_PATH
|
||||||
|
mkdir -p $BINARY_PATH
|
||||||
|
|
||||||
|
mkdir -p $TMP_PATH
|
||||||
|
mkdir -p $RESULT_PATH
|
||||||
|
|
||||||
|
rm -rf $TMP_PATH/*
|
||||||
|
rm -rf $RESULT_PATH/*
|
||||||
|
|
||||||
|
cat >~/.1cv8/1C/1cv8/conf/conf.cfg <<EOL
|
||||||
|
DisableUnsafeActionProtection=.*
|
||||||
|
EOL
|
||||||
|
|
||||||
|
# $SCRIPTPATH/convert-to-xml.sh
|
||||||
|
# $SCRIPTPATH/build-artifacts.sh
|
||||||
|
|
||||||
|
echo "=================== Запуск тестирования ========================="
|
||||||
|
$SCRIPTPATH/test-filedb-ordinary.sh &
|
||||||
|
$SCRIPTPATH/test-filedb-thick.sh &
|
||||||
|
$SCRIPTPATH/test-filedb-thin.sh &
|
||||||
|
|
||||||
|
wait
|
27
tools/local-test/scripts/run-tests.sh
Executable file
27
tools/local-test/scripts/run-tests.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
MODE=$1
|
||||||
|
CONNECTION_STRING=$2
|
||||||
|
JOB_NAME=$3
|
||||||
|
|
||||||
|
CONFIG=$TMP_PATH/yaxunit-config-$JOB_NAME.json
|
||||||
|
|
||||||
|
case "$MODE" in
|
||||||
|
"ordinary" ) APP=1cv8; RUN_MODE="/RunModeOrdinaryApplication";;
|
||||||
|
"thick" ) APP=1cv8; RUN_MODE="/RunModeManagedApplication";;
|
||||||
|
"thin" ) APP=1cv8c;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cat >$CONFIG <<EOL
|
||||||
|
{
|
||||||
|
"reportFormat": "jUnit",
|
||||||
|
"reportPath": "$RESULT_PATH/report-$JOB_NAME.xml",
|
||||||
|
"closeAfterTests": true,
|
||||||
|
"exitCode": "$RESULT_PATH/exit-code-$JOB_NAME.txt",
|
||||||
|
"projectPath": "$ROOT_PATH",
|
||||||
|
"logging": {
|
||||||
|
"console": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
|
||||||
|
echo "Тестирование"
|
||||||
|
$ONEC_PATH/$APP ENTERPRISE $CONNECTION_STRING $RUN_MODE /DisableStartupDialogs /DisableStartupMessages /C "RunUnitTests=$CONFIG"
|
6
tools/local-test/scripts/test-filedb-ordinary.sh
Executable file
6
tools/local-test/scripts/test-filedb-ordinary.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
JOB_NAME=OrdinaryApplication
|
||||||
|
TEMP_DB_PATH=$DB_PATH/$JOB_NAME
|
||||||
|
|
||||||
|
$SCRIPTPATH/create-ib.sh /F$TEMP_DB_PATH $JOB_NAME
|
||||||
|
|
||||||
|
$SCRIPTPATH/run-tests.sh ordinary /F$TEMP_DB_PATH $JOB_NAME
|
6
tools/local-test/scripts/test-filedb-thick.sh
Executable file
6
tools/local-test/scripts/test-filedb-thick.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
JOB_NAME=ThickManagmentApplication
|
||||||
|
TEMP_DB_PATH=$DB_PATH/$JOB_NAME
|
||||||
|
|
||||||
|
$SCRIPTPATH/create-ib.sh /F$TEMP_DB_PATH $JOB_NAME
|
||||||
|
|
||||||
|
$SCRIPTPATH/run-tests.sh thick /F$TEMP_DB_PATH $JOB_NAME
|
6
tools/local-test/scripts/test-filedb-thin.sh
Executable file
6
tools/local-test/scripts/test-filedb-thin.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
JOB_NAME=ThinManagmentApplication
|
||||||
|
TEMP_DB_PATH=$DB_PATH/$JOB_NAME
|
||||||
|
|
||||||
|
$SCRIPTPATH/create-ib.sh /F$TEMP_DB_PATH $JOB_NAME
|
||||||
|
|
||||||
|
$SCRIPTPATH/run-tests.sh thin /F$TEMP_DB_PATH $JOB_NAME
|
@ -4,50 +4,11 @@
|
|||||||
"version": "2.1",
|
"version": "2.1",
|
||||||
"ФорматEDT": true
|
"ФорматEDT": true
|
||||||
},
|
},
|
||||||
"АвтоТестирование": {
|
|
||||||
"Выполнять": true,
|
|
||||||
"ВыполнятьБазовые": true,
|
|
||||||
"ВыполнятьxUnit": true,
|
|
||||||
"ТестыxUnitВРасширении": true,
|
|
||||||
"ИсполнительxUnitВРасширении": true,
|
|
||||||
"ВыполнятьVanessa": false,
|
|
||||||
"ПредварительнаяПодготовкаБазы": false,
|
|
||||||
"ПередаватьПокрытиеТестамиВСонар": false
|
|
||||||
},
|
|
||||||
"АвтоДокументирование": {
|
|
||||||
"Выполнять": false,
|
|
||||||
"КодПространстваConfluence": "yaxunit",
|
|
||||||
"ПоследнийОбработанныйКоммит": "",
|
|
||||||
"Шаблоны": ""
|
|
||||||
},
|
|
||||||
"АнализИсходников": {
|
|
||||||
"Выполнять": true,
|
|
||||||
"ДочерниеПроекты": []
|
|
||||||
},
|
|
||||||
"АвтоСборка": {
|
|
||||||
"ВключитьНомерСборки": true,
|
|
||||||
"ОбновлятьВерсиюКонфигурации": false,
|
|
||||||
"КаталогРасположенияСборок": "\\\\dellin.local\\bia\\СРПО\\1с_install\\Конфигурации ДЛ\\yaxunit",
|
|
||||||
"КаталогРасположенияСборокRelease": "\\\\dellin.local\\bia\\СРПО\\1с_install\\Конфигурации ДЛ\\yaxunit\\releases",
|
|
||||||
"КаталогРасположенияОбразов": "\\\\dellin.local\\bia\\СРПО\\1с_install\\Конфигурации ДЛ\\БСП\\spec",
|
|
||||||
"ВыполнятьНаСервернойБазе": false
|
|
||||||
},
|
|
||||||
"Уведомления": {
|
|
||||||
"Выполнять": true,
|
|
||||||
"Ответственные": [{
|
|
||||||
"Адресат": "arch-bots",
|
|
||||||
"Транспорт": "rocketchat"
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
"СвязанныеПроекты": {
|
|
||||||
"bsp": {
|
|
||||||
"Репозиторий": "git@gitlab.dellin.ru:orais/bsp/bsp.git",
|
|
||||||
"Ветка": "master",
|
|
||||||
"Назначение": "Основная конфигурация"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Precommt4onecСценарии": {
|
"Precommt4onecСценарии": {
|
||||||
"ИспользоватьСценарииРепозитория": true,
|
"ИспользоватьСценарииРепозитория": true,
|
||||||
"КаталогЛокальныхСценариев": "tools\\precommit"
|
"ОтключенныеСценарии": [
|
||||||
|
"РазборОтчетовОбработокРасширений.os"
|
||||||
|
],
|
||||||
|
"КаталогЛокальныхСценариев": "tools/precommit"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user