Skip to content

Commit 0138562

Browse files
authored
Update bazel build script and bazel rule (#463)
* Update bazel rule and script * Use `options:NSXMLDocumentTidyXML` to strip away any invalid characters outputted by the tests
1 parent 1e63319 commit 0138562

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

bptestrunner/bluepill_batch_test.bzl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ def _bluepill_batch_test_impl(ctx):
5050
substitutions = {
5151
"test_bundle_paths": " ".join(test_bundle_paths),
5252
"test_host_paths": " ".join(test_host_paths),
53-
"bp_test_plan": test_plan_file.basename,
53+
"bp_test_plan": test_plan_file.short_path,
5454
"bp_path": ctx.executable._bp_exec.short_path,
5555
"bluepill_path": ctx.executable._bluepill_exec.short_path,
5656
"target_name": ctx.attr.name,
5757
}
5858
if ctx.attr.config_file:
59-
runfiles += [ctx.file.config_file]
59+
runfiles.append(ctx.file.config_file)
6060
substitutions["bp_config_file"] = ctx.file.config_file.path
6161
if ctx.attr.time_estimates:
62-
runfiles += [ctx.file.time_estimates]
62+
runfiles.append(ctx.file.time_estimates)
6363
substitutions["bp_test_time_estimates_json"] = ctx.file.time_estimates.path
6464
ctx.actions.expand_template(
6565
template = ctx.file._test_runner_template,
@@ -134,13 +134,11 @@ as possible between simulators.
134134
},
135135
doc = """
136136
Test rule to aggregate a list of test rules and pass them for bluepill for execution
137-
138137
Outputs:
139138
Runfiles:
140139
files: The files needed during runtime for the test to be performed. It contains the
141140
test plan json file, bluepill config file if specified, xctest bundles, test hosts.
142-
143141
This rule WILL disregard the bluepill output folder configuration if it's set in the
144142
config json file. Instead it will copy all the outputs to ./bazel-testlogs/$TARGET_NAME/test.outputs/
145143
""",
146-
)
144+
)

bptestrunner/bluepill_batch_test_runner.template.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,22 @@ if [ -f "$BP_TEST_ESTIMATE_JSON" ]; then
6060
TIME_ESTIMATE_ARG="--test-time-estimates-json $(basename "$BP_TEST_ESTIMATE_JSON")"
6161
fi
6262

63-
# Copy bluepill, bp executable and the rule generated test plan file to working folder
63+
# Copy rule-generated test plan file to working folder
6464
cp "$BP_TEST_PLAN" $BP_WORKING_FOLDER
65+
BP_TEST_PLAN_ARG="$(basename "$BP_TEST_PLAN")"
66+
67+
# Copy bluepill and bp executables to working folder
6568
cp "$BP_PATH" $BP_WORKING_FOLDER
6669
cp "$BLUEPILL_PATH" $BP_WORKING_FOLDER
6770

6871
# Run bluepill
6972
# NOTE: we override output folder here and disregard the one in the config file.
7073
# So we know where to grab the output files for the next step.
71-
echo "Running ./bluepill --test-plan-path "${BP_TEST_PLAN}" -o "outputs" ${CONFIG_ARG} ${TIME_ESTIMATE_ARG}"
74+
echo "Running ./bluepill --test-plan-path "${BP_TEST_PLAN_ARG}" -o "outputs" ${CONFIG_ARG} ${TIME_ESTIMATE_ARG}"
7275

7376
cd $BP_WORKING_FOLDER
7477
RC=0
75-
(./bluepill --test-plan-path "${BP_TEST_PLAN}" -o "outputs" ${CONFIG_ARG} ${TIME_ESTIMATE_ARG}) || RC=$?
78+
(./bluepill --test-plan-path "${BP_TEST_PLAN_ARG}" -o "outputs" ${CONFIG_ARG} ${TIME_ESTIMATE_ARG}) || RC=$?
7679
# Move Bluepill output to bazel-testlogs
7780
ditto "outputs" "$TEST_UNDECLARED_OUTPUTS_DIR"
7881
rm -rf "outputs"

0 commit comments

Comments
 (0)