Skip to content

Commit

Permalink
test: скрипт запуска тестирования
Browse files Browse the repository at this point in the history
  • Loading branch information
alkoleft committed Aug 30, 2024
1 parent 8ece153 commit 4fc0f51
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/local-test/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export EDT_VERSION=2023.3.5+10
export ONEC_VERSION=8.3.21.1895
61 changes: 61 additions & 0 deletions tools/local-test/test-by-ibcmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
source .env

SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

WORK_PATH=/tmp/yaxunit-test
EDT_PATH=/opt/1C/1CE/components/1c-edt-$EDT_VERSION-x86_64
ONEC_PATH=/opt/1cv8/x86_64/$ONEC_VERSION
PROJECT_PATH=$SCRIPTPATH/../..
DB_PATH=$WORK_PATH/file-db
mkdir -p $WORK_PATH

# echo "Конвертация configuration"
# $EDT_PATH/1cedtcli -data $WORK_PATH/ws -timeout 300 -command export --configuration-files $WORK_PATH/configuration --project $PROJECT_PATH/fixtures/demo-configuration

# echo "Конвертация yaxunit"
# $EDT_PATH/1cedtcli -data $WORK_PATH/ws -timeout 300 -command export --configuration-files $WORK_PATH/yaxunit --project $PROJECT_PATH/exts/yaxunit

# echo "Конвертация smoke"
# $EDT_PATH/1cedtcli -data $WORK_PATH/ws -timeout 300 -command export --configuration-files $WORK_PATH/smoke --project $PROJECT_PATH/exts/smoke

# echo "Конвертация тесты"
# $EDT_PATH/1cedtcli -data $WORK_PATH/ws -timeout 300 -command export --configuration-files $WORK_PATH/tests --project $PROJECT_PATH/tests

rm -rf $DB_PATH
echo "=========== Создание информационной базы"
$ONEC_PATH/ibcmd infobase create --db-path=$DB_PATH --import=$WORK_PATH/configuration --apply --force

echo "=========== Импорт расширения Smoke"
$ONEC_PATH/ibcmd infobase config import --db-path=$DB_PATH --extension=Smoke $WORK_PATH/smoke
$ONEC_PATH/ibcmd infobase config apply --db-path=$DB_PATH --extension=Smoke --force

echo "=========== Импорт расширения tests"
$ONEC_PATH/ibcmd infobase config import --db-path=$DB_PATH --extension=tests $WORK_PATH/tests
$ONEC_PATH/ibcmd infobase config apply --db-path=$DB_PATH --extension=tests --force

echo "=========== Импорт расширения YAXUNIT"
$ONEC_PATH/ibcmd infobase config import --db-path=$DB_PATH --extension=YAXUNIT $WORK_PATH/yaxunit
$ONEC_PATH/ibcmd infobase config apply --db-path=$DB_PATH --extension=YAXUNIT --force

$ONEC_PATH/ibcmd infobase config extension update --db-path=$DB_PATH --name=Smoke --safe-mode=no --unsafe-action-protection=no
$ONEC_PATH/ibcmd infobase config extension update --db-path=$DB_PATH --name=tests --safe-mode=no --unsafe-action-protection=no
$ONEC_PATH/ibcmd infobase config extension update --db-path=$DB_PATH --name=YAXUNIT --safe-mode=no --unsafe-action-protection=no

cat >$WORK_PATH/yaxunit-config.json <<EOL
{
"reportFormat": "jUnit",
"reportPath": "$WORK_PATH/report.xml",
"closeAfterTests": true,
"exitCode": "$WORK_PATH/exit-code.txt",
"logging": {
"console": true
}
}
EOL

$ONEC_PATH/ibsrv --db-path=$DB_PATH --daemon
IBSRV_PID=$!
echo "IBSRV PID=$IBSRV_PID"

$ONEC_PATH/1cv8c /WS "http://localhost:8314" /C"RunUnitTests=$WORK_PATH/yaxunit-config.json" /DisableStartupDialogs /DisableStartupMessages /DisableUnrecoverableErrorMessage
kill $IBSRV_PID
9 changes: 9 additions & 0 deletions tools/local-test/yaxunit-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"reportFormat": "jUnit",
"reportPath": "report.xml",
"closeAfterTests": true,
"exitCode": "exit-code.txt",
"logging": {
"console": true
}
}

0 comments on commit 4fc0f51

Please sign in to comment.