-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
118 lines (113 loc) · 5.48 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# (c) Copyright 2016 Hewlett-Packard Development Company, L.P.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License v2.0 which accompany this distribution.
#
# The Apache License is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
####################################################
# Inputs to this script:
# - CSLANG_VERSION_TAG
general:
artifacts:
- ${HOME}/test-functional/workdir/cli/cslang/logs/execution.log
machine:
environment:
REPO_HOME: "${HOME}/test-functional"
WORKDIR: "${REPO_HOME}/workdir"
CLI_PARENT_DIR: "${WORKDIR}/cli"
CLI_DIR: "${CLI_PARENT_DIR}/cslang-cli"
CLI_EXECUTABLE: "${CLI_DIR}/bin/cslang"
CLI_CONTENT: "${CLI_DIR}/content"
CLI_CONFIGURATION: "${CLI_DIR}/configuration"
CLI_LOGS_DIR: "${CLI_DIR}/logs"
CLI_LOGS_FILE_PATH: "${CLI_LOGS_DIR}/execution.log"
BUILDER_PARENT_DIR: "${WORKDIR}/builder"
BUILDER_DIR: "${BUILDER_PARENT_DIR}/cslang-builder"
BUILDER_LOGS_FILE_PATH: "${BUILDER_DIR}/logs/execution.log"
BUILDER_EXECUTABLE: "${BUILDER_DIR}/bin/cslang-builder"
TEST_CASES_DIR: "${REPO_HOME}/test_cases"
TEST_CASES_CLI_DIR: "${TEST_CASES_DIR}/cli"
TEST_CASES_CLI_INPUTS_DIR: "${TEST_CASES_CLI_DIR}/inputs_folder"
TEST_CASES_CLI_INPUTS_SCRIPTS_DIR: "${TEST_CASES_CLI_INPUTS_DIR}/scripts"
TEST_CASES_CLI_PROPS_DIR: "${TEST_CASES_CLI_DIR}/properties_folder"
TEST_CASES_CLI_PROPS_SCRIPTS_DIR: "${TEST_CASES_CLI_PROPS_DIR}/scripts"
TEST_CASES_CLI_LOG4J_DIR: "${TEST_CASES_CLI_DIR}/log4j"
TEST_CASES_CLI_LOG4J_SCRIPTS_DIR: "${TEST_CASES_CLI_LOG4J_DIR}/scripts"
TEST_CASES_CLI_ENCODING_DIR: "${TEST_CASES_CLI_DIR}/encoding"
TEST_CASES_CLI_ENCODING_SCRIPTS_DIR: "${TEST_CASES_CLI_ENCODING_DIR}/scripts"
TEST_CASES_CLI_SENSITIVE_DIR: "${TEST_CASES_CLI_DIR}/sensitive"
TEST_CASES_CLI_SENSITIVE_SCRIPTS_DIR: "${TEST_CASES_CLI_SENSITIVE_DIR}/scripts"
TEST_CASES_BUILDER_DIR: "${TEST_CASES_DIR}/builder"
TEST_CASES_BUILDER_SENSITIVE_DIR: "${TEST_CASES_BUILDER_DIR}/sensitive"
TEST_CASES_BUILDER_SENSITIVE_CSLANG_DIR: "${TEST_CASES_BUILDER_SENSITIVE_DIR}/cslang"
TEST_CASES_BUILDER_SENSITIVE_SCRIPTS_DIR: "${TEST_CASES_BUILDER_SENSITIVE_DIR}/scripts"
dependencies:
override:
- 'echo "Build uses CloudSlang version: ${CSLANG_VERSION_TAG}"'
test:
pre:
- mkdir -p "${CLI_PARENT_DIR}"
- > # download CLI
wget "https://github.com/CloudSlang/cloud-slang/releases/download/${CSLANG_VERSION_TAG}/cslang-cli-with-content.zip" -O "${CLI_PARENT_DIR}/cslang-cli.zip"
&& unzip "${CLI_PARENT_DIR}/cslang-cli.zip" -d "${CLI_PARENT_DIR}"
&& chmod +x "${CLI_EXECUTABLE}"
- > # download builder
wget "https://github.com/CloudSlang/cloud-slang/releases/download/${CSLANG_VERSION_TAG}/cslang-builder.zip" -O "${BUILDER_PARENT_DIR}/cslang-builder.zip"
&& unzip "${BUILDER_PARENT_DIR}/cslang-builder.zip" -d "${BUILDER_PARENT_DIR}"
&& chmod +x "${BUILDER_EXECUTABLE}"
override:
# sanity
- ${CLI_EXECUTABLE} run --f ${CLI_CONTENT}/io/cloudslang/base/print/print_text.sl --i text=cli_works
# CLI - inputs folder
- >
chmod +x ${TEST_CASES_CLI_INPUTS_SCRIPTS_DIR}/inputs_folder.sh &&
INPUTS_TARGET_DIR=${CLI_CONFIGURATION}
INPUTS_SRC_DIR=${TEST_CASES_CLI_INPUTS_DIR}/resources
INPUTS_FOLDER_NAME=inputs
CLI_EXECUTABLE=${CLI_EXECUTABLE}
TEST_FLOW=${TEST_CASES_CLI_INPUTS_DIR}/cslang/inputs_folder.sl
${TEST_CASES_CLI_INPUTS_SCRIPTS_DIR}/inputs_folder.sh
# CLI - properties folder
- >
chmod +x ${TEST_CASES_CLI_PROPS_SCRIPTS_DIR}/properties_folder.sh &&
PROPS_TARGET_DIR=${CLI_CONFIGURATION}
PROPS_SRC_DIR=${TEST_CASES_CLI_PROPS_DIR}/resources
PROPERTIES_FOLDER_NAME=properties
CLI_EXECUTABLE=${CLI_EXECUTABLE}
TEST_FLOW=${TEST_CASES_CLI_PROPS_DIR}/cslang/properties_folder.sl
${TEST_CASES_CLI_PROPS_SCRIPTS_DIR}/properties_folder.sh
# CLI - log4j
- >
chmod +x ${TEST_CASES_CLI_LOG4J_SCRIPTS_DIR}/log4j.sh &&
LOG4J_DIR=${CLI_CONFIGURATION}/logging
APP_HOME=${CLI_DIR}
RESOURCES_FOLDER=${TEST_CASES_CLI_LOG4J_DIR}/resources
CLI_EXECUTABLE=${CLI_EXECUTABLE}
CLI_CONTENT=${CLI_CONTENT}
${TEST_CASES_CLI_LOG4J_SCRIPTS_DIR}/log4j.sh
# CLI - encoding
- >
chmod +x ${TEST_CASES_CLI_ENCODING_SCRIPTS_DIR}/encoding.sh &&
INPUT_FILE_PATH=${TEST_CASES_CLI_ENCODING_DIR}/resources/inputs/utf8.inputs.yaml
CLI_EXECUTABLE=${CLI_EXECUTABLE}
TEST_FLOW=${CLI_CONTENT}/io/cloudslang/base/print/print_text.sl
${TEST_CASES_CLI_ENCODING_SCRIPTS_DIR}/encoding.sh
# CLI - sensitive
- >
chmod +x ${TEST_CASES_CLI_SENSITIVE_SCRIPTS_DIR}/sensitive.sh &&
CLI_EXECUTABLE=${CLI_EXECUTABLE}
TEST_FLOW_PATH=${TEST_CASES_CLI_SENSITIVE_DIR}/cslang/cloudslang/sensitive_flow.sl
CONTENT_CLASSPATH=${TEST_CASES_CLI_SENSITIVE_DIR}/cslang/
INPUTS_FILE_PATH=${TEST_CASES_CLI_SENSITIVE_DIR}/resources/inputs/sensitive.inputs.yaml
PASSWORD_INPUT_VALUE=secret_password
LOG_FILE_PATH=${CLI_LOGS_FILE_PATH}
${TEST_CASES_CLI_SENSITIVE_SCRIPTS_DIR}/sensitive.sh
# BUILDER - sensitive
- >
chmod +x ${TEST_CASES_BUILDER_SENSITIVE_SCRIPTS_DIR}/sensitive.sh &&
BUILDER_EXECUTABLE=${BUILDER_EXECUTABLE}
TEST_PARENT=${TEST_CASES_BUILDER_SENSITIVE_CSLANG_DIR}
PASSWORD_INPUT_VALUE=secret_password
LOG_FILE_PATH=${BUILDER_LOGS_FILE_PATH}
${TEST_CASES_BUILDER_SENSITIVE_SCRIPTS_DIR}/sensitive.sh