Skip to content

Commit ab70936

Browse files
committed
Fix test artifact file names
1 parent c2437c1 commit ab70936

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

tools/ci/circle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313

1414
# VARIABLES #
1515

16-
# Determine the root project directory:
17-
root_dir=$(dirname "$0")/../..
18-
root_dir=$(cd "${root_dir}" && echo $PWD)
19-
2016
# Define a username:
2117
username="${CIRCLE_USERNAME}"
2218

@@ -26,11 +22,18 @@ total_nodes="${CIRCLE_NODE_TOTAL}"
2622
# Get the VM index:
2723
index="${CIRCLE_NODE_INDEX}"
2824

25+
# Define an output directory to store unit test results:
26+
tests_log_dir="${CIRCLE_TEST_REPORTS}/junit"
27+
2928
# Define an output file to store log output:
3029
log_file='/var/log/circle-ci.log'
3130

32-
# Define an output directory to store unit test results:
33-
tests_log_dir="${CIRCLE_TEST_REPORTS}/junit"
31+
# Determine the root project directory:
32+
root_dir=$(dirname "$0")/../..
33+
root_dir=$(cd "${root_dir}" && echo $PWD)
34+
35+
# Define the project source code directory:
36+
base_dir="${root_dir}/lib/node_modules"
3437

3538
# Define the pattern for test filenames:
3639
tests_pattern='test*.js'
@@ -271,14 +274,14 @@ run_tests() {
271274
# Extract the test directory:
272275
dir=$(dirname ${test})
273276

274-
# Remove the root directory path from the test directory path (using POSIX shell variable expansion):
275-
path="${dir#${root_dir}/}"
277+
# Remove the base source code directory path from the test directory path (using POSIX shell variable expansion):
278+
path="${dir#${base_dir}/}"
276279

277280
# Slugify the path (basic algorithm):
278281
slug="$(echo ${path} | sed -e 's/[^[:alnum:]]/_/g' | tr -s '-' | tr A-Z a-z)"
279282

280283
# Define the output log file path:
281-
log_file="$2/test_results${slug}.xml"
284+
log_file="$2/test-results.${slug}.xml"
282285

283286
# Create the log file:
284287
create_log_file "${log_file}"

0 commit comments

Comments
 (0)