This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sort intents and entities, fix encoding and add GENERIC type of autogenerate node (#5) * update readme with working examples plus some minor info prints and typos in scripts (#6) * fix empty GOTO blocks (#7) * add support for counterexamples (#11) * improve Travis CI (#12) * restricted files taken from xls dir (#26) * fix of reponse type format for supporting the buttons (#20) * add more complex example of dialog in T2C format to testing (#15) * add release notes for 180518 release (#27)
- Loading branch information
1 parent
575aa64
commit 36a72c7
Showing
30 changed files
with
619 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ generated/ | |
/.settings | ||
test.junit.xml | ||
data/intents/WEATHER-FAQ-CZ* | ||
log.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
|
||
END_TIME=$(date +%s%N -d "${ARTIFACTORY_KEEP_DAYS} day ago" | cut -b1-13) | ||
|
||
# TODO deleteOld does not work because travis does not update 'lastUpdate' nor 'lastModified' so we just delete files and folders remain | ||
|
||
#deleteOld() | ||
#{ | ||
# URL=${1} | ||
# local DEPTH=${2} | ||
# echo "Artifactory: process folder ${URL}"; | ||
# LAST_MODIFIED=`curl -s -X GET -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} ${URL} | grep "lastModified" | awk -F"\"" '{print $4}'`; | ||
# echo "Artifactory: last modified ${LAST_MODIFIED}"; | ||
# LAST_MODIFIED_MS=$(date +%s%N -d "${LAST_MODIFIED}" | cut -b1-13); | ||
# | ||
# if [ "${DEPTH}" -le "0" ]; then | ||
# echo "Maximal depth reached" | ||
# elif [ "${END_TIME}" -gt "${LAST_MODIFIED_MS}" ]; then | ||
# echo "Artifactory: deleting folder because it is older then ${ARTIFACTORY_KEEP_DAYS} days"; | ||
# #curl -X DELETE -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} "https://na.artifactory.swg-devops.com/artifactory/api/storage/iot-waw-trevis-generic-local/${1}" | ||
# else | ||
# echo "Artifactory: processing subfolders because folder it is newer then ${ARTIFACTORY_KEEP_DAYS} days"; | ||
# RESULTS=`curl -s -X GET -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} ${URL} | grep " \"uri" | awk -F"\"" '{print $4}'` | ||
# | ||
# local DEPTH=$((DEPTH-1)) | ||
# for RESULT in ${RESULTS}; do | ||
# deleteOld ${1}${RESULT} ${DEPTH}; | ||
# done | ||
# fi | ||
#} | ||
|
||
# Delete old folders | ||
#deleteOld "https://na.artifactory.swg-devops.com/artifactory/api/storage/iot-waw-trevis-generic-local" 2 | ||
#exit | ||
|
||
RESULTS=`curl -s -X GET -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} "https://na.artifactory.swg-devops.com/artifactory/api/search/creation?from=0&to=${END_TIME}&repos=iot-waw-trevis-generic-local" | grep uri | awk '{print $3}' | sed s'/.$//' | sed s'/.$//' | sed -r 's/^.{1}//'` | ||
|
||
# Delete old files | ||
for RESULT in ${RESULTS}; do | ||
PATH_TO_FILE=`curl -s -X GET -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} ${RESULT} | grep downloadUri | awk '{print $3}' | sed s'/.$//' | sed s'/.$//' | sed -r 's/^.{1}//'` | ||
echo "Artifactory: delete ${PATH_TO_FILE}" | ||
curl -X DELETE -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} ${PATH_TO_FILE} | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
PATH_TO_FILE=$1 | ||
|
||
DIR_URL=https://na.artifactory.swg-devops.com/artifactory/iot-waw-trevis-generic-local/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER} | ||
|
||
# TODO It does not work with nested folders | ||
echo "Artifactory: deploy ${PATH_TO_FILE}"; | ||
for FILENAME in ${PATH_TO_FILE}; do | ||
echo "Artifactory: deploy ${FILENAME} to ${DIR_URL}/${FILENAME}"; | ||
curl -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} -T ${FILENAME} ${DIR_URL}/${FILENAME}; | ||
echo "\n"; | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
ARTIFACTORY_API_KEY=$1 | ||
PATH_TO_FILE=$2 | ||
TARGET_FILE_PATH=$3 | ||
|
||
if [ -z "$3" ]; then | ||
TARGET_FILE_PATH=$2 | ||
fi | ||
|
||
DIR_URL=https://na.artifactory.swg-devops.com/artifactory/iot-waw-trevis-generic-local/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER} | ||
|
||
curl -H 'X-JFrog-Art-Api: '${ARTIFACTORY_API_KEY} -O ${DIR_URL}/${PATH_TO_FILE} | ||
|
||
mkdir -p `dirname ${TARGET_FILE_PATH}` | ||
mv `basename ${PATH_TO_FILE}` ${TARGET_FILE_PATH} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
#!/bin/sh | ||
|
||
# Those variables is needed to be exported or set as environment variables | ||
# export ARTIFACTORY_API_KEY= | ||
# export ARTIFACTORY_KEEP_DAYS= | ||
# export WA_PASSWORD= | ||
# export WA_USERNAME= | ||
# export WA_WORKSPACE_ID_DEVEL= | ||
# export WA_WORKSPACE_ID_MASTER= | ||
# export WA_WORKSPACE_ID_TEST= | ||
# export TRAVIS_BRANCH= | ||
# export TRAVIS_BUILD_NUMBER= | ||
# export TRAVIS_PULL_REQUEST= | ||
# export TRAVIS_EVENT_TYPE= | ||
|
||
stopIfFailed() | ||
{ | ||
if [ "$1" -ne "0" ]; then | ||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Previous command failed, stop the build!"; | ||
echo "--------------------------------------------------------------------------------"; | ||
exit 2 | ||
fi | ||
} | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Dialog, intents from XLS to XML, CSV"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p tests/data/dialog/generated; | ||
python scripts/dialog_xls2xml.py -x tests/data/xls/E_CZ_T2C_authoring.xlsx -gd tests/data/dialog/generated -gi "tests/data/intents" -ge "tests/data/entities" -v; | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh "tests/data/dialog/generated/*"; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Dialog from XML to JSON"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p outputs; | ||
python scripts/dialog_xml2json.py -dm tests/data/dialog/main.xml -of outputs -od dialog.json -s ../data_spec/dialog_schema.xml -v; | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/dialog.json; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Entities from CSV to JSON"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p outputs | ||
python scripts/entities_csv2json.py -ie tests/data/entities/ -oe entities.json -od outputs -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/entities.json | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Intents from CSV to JSON"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p outputs | ||
python scripts/intents_csv2json.py -ii tests/data/intents/ -od outputs -oi intents.json -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/intents.json | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Compose workspace"; | ||
echo "--------------------------------------------------------------------------------"; | ||
python scripts/workspace_compose.py -of outputs -ow workspace.json -oe entities.json -od dialog.json -oi intents.json -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/workspace.json | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Decompose workspace"; | ||
echo "--------------------------------------------------------------------------------"; | ||
python scripts/workspace_decompose.py outputs/workspace.json -i outputs/intentsOut.json -e outputs/entitiesOut.json -d outputs/dialogOut.json -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/intentsOut.json | ||
./ci/artifactory-deploy.sh outputs/entitiesOut.json | ||
./ci/artifactory-deploy.sh outputs/dialogOut.json | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Intents from JSON to CSV"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p outputs/intents | ||
python scripts/intents_json2csv.py outputs/intentsOut.json outputs/intents/ -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh "outputs/intents/*"; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Entities from JSON to CSV"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p outputs/entities | ||
python scripts/entities_json2csv.py outputs/entitiesOut.json outputs/entities -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh "outputs/entities/*"; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Dialog from JSON to XML"; | ||
echo "--------------------------------------------------------------------------------"; | ||
mkdir -p outputs/dialog | ||
python scripts/dialog_json2xml.py outputs/dialogOut.json -d outputs/dialog/ -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh "outputs/dialog/*"; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Deploy test workspace"; | ||
echo "--------------------------------------------------------------------------------"; | ||
python scripts/workspace_deploy.py -of outputs -ow workspace.json -c tests/test.cfg -v -cn $WA_USERNAME -cp $WA_PASSWORD -cid $WA_WORKSPACE_ID_TEST | ||
stopIfFailed $?; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Test workspace"; | ||
echo "--------------------------------------------------------------------------------"; | ||
# TODO Get rid of this when workspace_test.py allows cmd params | ||
cp tests/test.cfg tests/tmp.cfg; | ||
echo "username = ${WA_USERNAME}" >> tests/tmp.cfg; | ||
echo "password = ${WA_PASSWORD}" >> tests/tmp.cfg; | ||
echo "workspace_id = ${WA_WORKSPACE_ID_TEST}" >> tests/tmp.cfg; | ||
mkdir -p outputs/dialog | ||
python scripts/workspace_test.py tests/tmp.cfg tests/test_more_outputs.test outputs/test_more_outputs.out -v | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/test_more_outputs.out | ||
rm -f tests/tmp.cfg; | ||
|
||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Evaluate tests"; | ||
echo "--------------------------------------------------------------------------------"; | ||
python scripts/evaluate_tests.py tests/test_more_outputs.test outputs/test_more_outputs.out -o outputs/test_more_outputs.junit.xml | ||
stopIfFailed $?; | ||
./ci/artifactory-deploy.sh outputs/test_more_outputs.junit.xml | ||
|
||
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then | ||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Deploy master workspace"; | ||
echo "--------------------------------------------------------------------------------"; | ||
python scripts/workspace_deploy.py -of outputs -ow workspace.json -c tests/test.cfg -v -cn $WA_USERNAME -cp $WA_PASSWORD -cid $WA_WORKSPACE_ID_MASTER | ||
stopIfFailed $?; | ||
elif [ "$TRAVIS_BRANCH" = "devel" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then | ||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Deploy devel workspace"; | ||
echo "--------------------------------------------------------------------------------"; | ||
python scripts/workspace_deploy.py -of outputs -ow workspace.json -c tests/test.cfg -v -cn $WA_USERNAME -cp $WA_PASSWORD -cid $WA_WORKSPACE_ID_DEVEL | ||
stopIfFailed $?; | ||
fi | ||
|
||
if [ "$TRAVIS_BRANCH" = "devel" -a "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_EVENT_TYPE" = "cron" ]; then | ||
echo "--------------------------------------------------------------------------------"; | ||
echo "-- Cleanup Artifactory"; | ||
echo "--------------------------------------------------------------------------------"; | ||
./ci/artifactory-cleanup.sh | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.