Skip to content

Commit

Permalink
ci: сокращен вывод скриптов локального тестирования
Browse files Browse the repository at this point in the history
  • Loading branch information
alkoleft committed Dec 6, 2024
1 parent 5e427ee commit 604f56d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
12 changes: 6 additions & 6 deletions tools/local-test/scripts/lib/prepare-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ BASE_ARGUMENTS="$CONNECTION_STRING /DisableStartupDialogs /DisableStartupMessage
DESIGNER_COMMAND="$ONEC_PATH/1cv8 DESIGNER $BASE_ARGUMENTS"

echo "=========== Загрузка конфигурации ($JOB_NAME)"
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/configuration.cf /UpdateDBCfg
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/configuration.cf /UpdateDBCfg >&- 2>&-
SUCCESS=$?
cat $TMP_PATH/$JOB_NAME.log
# cat $TMP_PATH/$JOB_NAME.log

EXTENSIONS_SET=("smoke" "tests" "yaxunit")

for key in "${EXTENSIONS_SET[@]}";do
if [[ $SUCCESS -eq 0 ]]; then
echo "=========== Загрузка расширения $key ($JOB_NAME)"
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/$key.cfe -Extension $key /UpdateDBCfg
$DESIGNER_COMMAND /LoadCfg $BINARY_PATH/$key.cfe -Extension $key /UpdateDBCfg >&- 2>&-
SUCCESS=$?
cat $TMP_PATH/$JOB_NAME.log
# cat $TMP_PATH/$JOB_NAME.log
fi
done

if [[ $SUCCESS -eq 0 ]]; then
echo "=========== Снятие безопасного режима ($JOB_NAME)"
$ONEC_PATH/1cv8 ENTERPRISE $BASE_ARGUMENTS /Execute $LIB_PATH/DisableSafeMode.epf
$ONEC_PATH/1cv8 ENTERPRISE $BASE_ARGUMENTS /Execute $LIB_PATH/DisableSafeMode.epf >&- 2>&-
SUCCESS=$?
cat $TMP_PATH/$JOB_NAME.log
# cat $TMP_PATH/$JOB_NAME.log
fi

exit $SUCCESS
2 changes: 1 addition & 1 deletion tools/local-test/scripts/lib/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cat >$CONFIG <<EOL
EOL

echo "=========== Тестирование $JOB_NAME"
$ONEC_PATH/$APP ENTERPRISE $CONNECTION_STRING /DisableSplash /DisableStartupDialogs /DisableStartupMessages $RUN_MODE /C "RunUnitTests=$CONFIG"
$ONEC_PATH/$APP ENTERPRISE $CONNECTION_STRING /DisableSplash /DisableStartupDialogs /DisableStartupMessages $RUN_MODE /C "RunUnitTests=$CONFIG" > /dev/null

RESULT=$(head -n 1 $RESULT_PATH/exit-code-$JOB_NAME.txt)
RESULT=${RESULT:1:1}
Expand Down
8 changes: 4 additions & 4 deletions tools/local-test/scripts/steps/build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ if [[ ${#extensions_set[@]} -eq 0 && $configuration_exists -eq 1 ]]; then
fi

echo " Создание информационной базы"
$ONEC_PATH/ibcmd infobase create --db-path=$TEMP_DB_PATH --import=$EXPORT_PATH/configuration --apply --force
$ONEC_PATH/ibcmd infobase create --db-path=$TEMP_DB_PATH --import=$EXPORT_PATH/configuration --apply --force > /dev/null

if [[ $configuration_exists -eq 0 ]]; then
echo " Сохрание тестовой конфигурации"
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH $BINARY_PATH/configuration.cf
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH $BINARY_PATH/configuration.cf > /dev/null
fi

for key in "${extensions_set[@]}";do
echo " Импорт расширения $key"
$ONEC_PATH/ibcmd infobase config import --db-path=$TEMP_DB_PATH --extension=$key $EXPORT_PATH/$key
$ONEC_PATH/ibcmd infobase config import --db-path=$TEMP_DB_PATH --extension=$key $EXPORT_PATH/$key > /dev/null
echo " Сохрание расширения $key"
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH --extension=$key $BINARY_PATH/$key.cfe
$ONEC_PATH/ibcmd infobase config save --db-path=$TEMP_DB_PATH --extension=$key $BINARY_PATH/$key.cfe > /dev/null
done
4 changes: 2 additions & 2 deletions tools/local-test/scripts/steps/run-filedb-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ CONNECTION_STRING=/F$TEST_DB_PATH
rm -rf $TEST_DB_PATH

echo "=========== Создание информационной базы ($JOB_NAME)"
$ONEC_PATH/1cv8 CREATEINFOBASE File=$TEST_DB_PATH /DisableStartupDialogs /DisableStartupMessages /Out $TMP_PATH/$JOB_NAME.log
cat $TMP_PATH/$JOB_NAME.log
$ONEC_PATH/1cv8 CREATEINFOBASE File=$TEST_DB_PATH /DisableStartupDialogs /DisableStartupMessages /Out $TMP_PATH/$JOB_NAME.log >&- 2>&-
# cat $TMP_PATH/$JOB_NAME.log

if $LIB_PATH/prepare-db.sh $CONNECTION_STRING $JOB_NAME; then
$LIB_PATH/run-tests.sh $MODE $CONNECTION_STRING $JOB_NAME
Expand Down
4 changes: 2 additions & 2 deletions tools/local-test/scripts/steps/run-serverdb-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ DB_NAME=DB_${MODE}Application
CONNECTION_STRING=/S\"localhost\\$DB_NAME\"

echo "=========== Создание информационной базы ($JOB_NAME)"
$ONEC_PATH/1cv8 CREATEINFOBASE Srvr=localhost\;Ref=$DB_NAME\;DBMS=PostgreSQL\;DBSrvr=localhost\;DB=$DB_NAME\;DBUID=postgres\;CrSQLDB=Y\;SchJobDn=Y /DisableStartupDialogs /DisableStartupMessages /Out $TMP_PATH/$JOB_NAME.log
cat $TMP_PATH/$JOB_NAME.log
$ONEC_PATH/1cv8 CREATEINFOBASE Srvr=localhost\;Ref=$DB_NAME\;DBMS=PostgreSQL\;DBSrvr=localhost\;DB=$DB_NAME\;DBUID=postgres\;CrSQLDB=Y\;SchJobDn=Y /DisableStartupDialogs /DisableStartupMessages /Out $TMP_PATH/$JOB_NAME.log >&- 2>&-
# cat $TMP_PATH/$JOB_NAME.log

if $LIB_PATH/prepare-db.sh $CONNECTION_STRING $JOB_NAME; then
$LIB_PATH/run-tests.sh $MODE $CONNECTION_STRING $JOB_NAME
Expand Down
21 changes: 21 additions & 0 deletions tools/local-test/scripts/test-it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@ export SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

source $SCRIPTPATH/../.env

if [[ -z "${EDT_VERSION}" ]]; then
>&2 echo 'Не установлена переменная $EDT_VERSION'
exit 1
fi

if [[ -z "$ONEC_VERSION" ]]; then
>&2 echo 'Не установлена переменная $ONEC_VERSION'
exit 1
fi


export EDT_PATH=/opt/1C/1CE/components/1c-edt-$EDT_VERSION-x86_64
export ONEC_PATH=/opt/1cv8/x86_64/$ONEC_VERSION

if [[ ! -d "${EDT_PATH}" ]]; then
>&2 echo "Не найдена инсталяция ${EDT_PATH}"
exit 1
fi

if [[ ! -d "$ONEC_PATH" ]]; then
>&2 echo "Не найдена инсталяция ${ONEC_PATH}"
exit 1
fi

export WORK_PATH=$(realpath $SCRIPTPATH/../workpath)
export ROOT_PATH=$(realpath $SCRIPTPATH/../../../)
export STEPS_PATH=$(realpath $SCRIPTPATH/steps)
Expand Down

0 comments on commit 604f56d

Please sign in to comment.