From fc4b2b280ad3e9f332844116a4c9e57eb843def0 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 2 Nov 2021 18:10:05 -0300 Subject: [PATCH] 17944: Configures a vocabulary file previous to the Cypress run. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/store/vocabulary/vocabulary-actions.ts | 1 - tools/arvados_config.yml | 1 + tools/example-vocabulary.json | 213 +++++++++++++++++++++ tools/run-integration-tests.sh | 4 + 4 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 tools/example-vocabulary.json diff --git a/src/store/vocabulary/vocabulary-actions.ts b/src/store/vocabulary/vocabulary-actions.ts index 2ca344bb..d73c01fe 100644 --- a/src/store/vocabulary/vocabulary-actions.ts +++ b/src/store/vocabulary/vocabulary-actions.ts @@ -10,7 +10,6 @@ import { isVocabulary } from 'models/vocabulary'; export const loadVocabulary = async (dispatch: Dispatch, _: {}, { vocabularyService }: ServiceRepository) => { const vocabulary = await vocabularyService.getVocabulary(); - dispatch(propertiesActions.SET_PROPERTY({ key: VOCABULARY_PROPERTY_NAME, value: isVocabulary(vocabulary) diff --git a/tools/arvados_config.yml b/tools/arvados_config.yml index 369046e6..55dc8a02 100644 --- a/tools/arvados_config.yml +++ b/tools/arvados_config.yml @@ -4,6 +4,7 @@ Clusters: SystemRootToken: systemusertesttoken1234567890aoeuidhtnsqjkxbmwvzpy API: RequestTimeout: 30s + VocabularyPath: "" TLS: Insecure: true Collections: diff --git a/tools/example-vocabulary.json b/tools/example-vocabulary.json new file mode 100644 index 00000000..59d4de7a --- /dev/null +++ b/tools/example-vocabulary.json @@ -0,0 +1,213 @@ +{ + "strict_tags": false, + "tags": { + "IDTAGFRUITS": { + "strict": false, + "labels": [ + {"label": "Fruit"} + ], + "values": { + "IDVALFRUITS1": { + "labels": [ + {"label": "Pineapple"} + ] + }, + "IDVALFRUITS2": { + "labels": [ + {"label": "Tomato"} + ] + }, + "IDVALFRUITS3": { + "labels": [ + {"label": "Orange"} + ] + }, + "IDVALFRUITS4": { + "labels": [ + {"label": "Banana"} + ] + }, + "IDVALFRUITS5": { + "labels": [ + {"label": "Advocado"} + ] + }, + "IDVALFRUITS6": { + "labels": [ + {"label": "Lemon"} + ] + }, + "IDVALFRUITS7": { + "labels": [ + {"label": "Apple"} + ] + }, + "IDVALFRUITS8": { + "labels": [ + {"label": "Peach"} + ] + }, + "IDVALFRUITS9": { + "labels": [ + {"label": "Strawberry"} + ] + } + } + }, + "IDTAGANIMALS": { + "strict": false, + "labels": [ + {"label": "Animal" }, + {"label": "Creature"} + ], + "values": { + "IDVALANIMALS1": { + "labels": [ + {"label": "Human"}, + {"label": "Homo sapiens"} + ] + }, + "IDVALANIMALS2": { + "labels": [ + {"label": "Dog"}, + {"label": "Canis lupus familiaris"} + ] + }, + "IDVALANIMALS3": { + "labels": [ + {"label": "Elephant"}, + {"label": "Loxodonta"} + ] + }, + "IDVALANIMALS4": { + "labels": [ + {"label": "Eagle"}, + {"label": "Haliaeetus leucocephalus"} + ] + } + } + }, + "IDTAGCOLORS": { + "strict": false, + "labels": [ + {"label": "Color"} + ], + "values": { + "IDVALCOLORS1": { + "labels": [ + {"label": "Yellow"} + ] + }, + "IDVALCOLORS2": { + "labels": [ + {"label": "Red"} + ] + }, + "IDVALCOLORS3": { + "labels": [ + {"label": "Magenta"} + ] + }, + "IDVALCOLORS4": { + "labels": [ + {"label": "Green"} + ] + } + } + }, + "IDTAGCOMMENT": { + "labels": [ + {"label": "Comment"}, + {"label": "Text"} + ] + }, + "IDTAGCATEGORIES": { + "strict": true, + "labels": [ + {"label": "Category"} + ], + "values": { + "IDTAGCAT1": { + "labels": [ + {"label": "Experimental"} + ] + }, + "IDTAGCAT2": { + "labels": [ + {"label": "Development"} + ] + }, + "IDTAGCAT3": { + "labels": [ + {"label": "Production"} + ] + } + } + }, + "IDTAGIMPORTANCES": { + "strict": true, + "labels": [ + {"label": "Importance"}, + {"label": "Priority"} + ], + "values": { + "IDVALIMPORTANCES1": { + "labels": [ + {"label": "Critical"}, + {"label": "Urgent"}, + {"label": "High"} + ] + }, + "IDVALIMPORTANCES2": { + "labels": [ + {"label": "Normal"}, + {"label": "Moderate"} + ] + }, + "IDVALIMPORTANCES3": { + "labels": [ + {"label": "Low"} + ] + } + } + }, + "IDTAGSIZES": { + "strict": true, + "labels": [ + {"label": "Size"} + ], + "values": { + "IDVALSIZES1": { + "labels": [ + {"label": "XS"}, + {"label": "x-small"} + ] + }, + "IDVALSIZES2": { + "labels": [ + {"label": "S"}, + {"label": "small"} + ] + }, + "IDVALSIZES3": { + "labels": [ + {"label": "M"}, + {"label": "medium"} + ] + }, + "IDVALSIZES4": { + "labels": [ + {"label": "L"}, + {"label": "large"} + ] + }, + "IDVALSIZES5": { + "labels": [ + {"label": "XL"}, + {"label": "x-large"} + ] + } + } + } + } +} \ No newline at end of file diff --git a/tools/run-integration-tests.sh b/tools/run-integration-tests.sh index 159bfc1c..bf4c3ba4 100755 --- a/tools/run-integration-tests.sh +++ b/tools/run-integration-tests.sh @@ -70,6 +70,7 @@ echo "ARVADOS_DIR is ${ARVADOS_DIR}" ARVADOS_LOG=${ARVADOS_DIR}/arvados.log ARVADOS_CONF=${WB2_DIR}/tools/arvados_config.yml +VOCABULARY_CONF=${WB2_DIR}/tools/example-vocabulary.json if [ ! -f "${WB2_DIR}/src/index.tsx" ]; then echo "ERROR: '${WB2_DIR}' isn't workbench2's directory" @@ -104,6 +105,9 @@ echo "Installing dev dependencies..." ~/go/bin/arvados-server install -type test || exit 1 echo "Launching arvados in test mode..." +VOC_DIR=$(mktemp -d | cut -d \/ -f3) # Removes the /tmp/ part +cp ${VOCABULARY_CONF} /tmp/${VOC_DIR}/voc.json +sed -i "s/VocabularyPath: \".*\"/VocabularyPath: \"\/tmp\/${VOC_DIR}\/voc.json\"/" ${ARVADOS_CONF} coproc arvboot (~/go/bin/arvados-server boot \ -type test \ -config ${ARVADOS_CONF} \ -- 2.30.2