File tree Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,12 @@ function substitute_placeholders {
84
84
s/example-db/$INFLUX_DATABASE/g;
85
85
s/get-started/$INFLUX_DATABASE/g;
86
86
/os.getenv("MANAGEMENT_TOKEN")/! s/INFLUX_MANAGEMENT_TOKEN/$MANAGEMENT_TOKEN/g;
87
+ /os.getenv("ORG_NAME")/! s/ORG_NAME/$INFLUX_ORG_NAME/g;
88
+ /os.getenv("ORG_ID")/! s/ORG_ID/$INFLUX_ORG/g;
89
+ /os.getenv("PASSWORD")/! s/PASSWORD/$INFLUX_PASSWORD/g;
87
90
/os.getenv("ORG_ID")/! s/ORG_ID/$INFLUX_ORG/g;
88
91
/os.getenv("RETENTION_POLICY")/! s/RETENTION_POLICY_NAME\|RETENTION_POLICY/$INFLUX_RETENTION_POLICY/g;
92
+ /os.getenv("USERNAME")/! s/USERNAME/$INFLUX_USERNAME/g;
89
93
s/CONFIG_NAME/CONFIG_$(shuf -i 0-100 -n1)/g;
90
94
s/TEST_RUN/TEST_RUN_$(date +%s)/g;
91
95
s|/path/to/custom/assets-dir|/app/custom-assets|g;' \
@@ -109,16 +113,6 @@ function substitute_placeholders {
109
113
done
110
114
}
111
115
112
- setup () {
113
- # Set up the environment for the tests.
114
- # Parse YAML config files into dotenv files to be used by tests.
115
- mkdir -p /app/appdata && (parse_yaml /src/data/products.yml > /app/appdata/.env.products)
116
-
117
- # Miscellaneous test setup.
118
- # For macOS samples.
119
- mkdir -p ~ /Downloads && rm -rf ~ /Downloads/*
120
- }
121
-
122
116
prepare_tests () {
123
117
echo " Preparing test files: $* "
124
118
SRC_FILES=" $* "
@@ -130,7 +124,6 @@ prepare_tests() {
130
124
done
131
125
cd /app
132
126
substitute_placeholders
133
- setup
134
127
}
135
128
136
129
prepare_tests " $* "
Original file line number Diff line number Diff line change @@ -23,6 +23,32 @@ tests="${*:2}"
23
23
rm -rf /app/" ${CONTENT_PATH} " /*
24
24
bash /src/test/scripts/prepare-content.sh $tests
25
25
26
+
27
+
28
+ setup () {
29
+ # Set up the environment for the tests.
30
+
31
+ # # Store test configuration in /app/appdata.
32
+ mkdir -p /app/appdata
33
+
34
+ # # Parse YAML config files into dotenv files to be used by tests.
35
+ # # You must source the parse_yaml function before you can use it.
36
+ source /usr/local/bin/parse_yaml
37
+ parse_yaml /src/data/products.yml > /app/appdata/.env.products
38
+ chmod -R +x /app/appdata/
39
+
40
+ # # Source non-sensitive environment variables for all test runners.
41
+ set -a
42
+ source /app/appdata/.env.*
43
+ set +a
44
+
45
+ # Miscellaneous test setup.
46
+ # For macOS samples.
47
+ mkdir -p ~ /Downloads && rm -rf ~ /Downloads/*
48
+ }
49
+
50
+ setup
51
+
26
52
if [[ $runner == " pytest" ]]; then
27
53
pytest \
28
54
-s \
You can’t perform that action at this time.
0 commit comments