Skip to content

Commit 7fc3bb7

Browse files
nchammasmarmbrus
authored andcommitted
[SPARK-3534] Fix expansion of testing arguments to sbt
Testing arguments to `sbt` need to be passed as an array, not a single, long string. Fixes a bug introduced in #2420. Author: Nicholas Chammas <nicholas.chammas@gmail.com> Closes #2437 from nchammas/selective-testing and squashes the following commits: a9f9c1c [Nicholas Chammas] fix printing of sbt test arguments cf57cbf [Nicholas Chammas] fix sbt test arguments e33b978 [Nicholas Chammas] Merge pull request #2 from apache/master 0b47ca4 [Nicholas Chammas] Merge branch 'master' of github.com:nchammas/spark 8051486 [Nicholas Chammas] Merge pull request #1 from apache/master 03180a4 [Nicholas Chammas] Merge branch 'master' of github.com:nchammas/spark d4c5f43 [Nicholas Chammas] Merge pull request #6 from apache/master
1 parent b3830b2 commit 7fc3bb7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dev/run-tests

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,28 @@ echo "========================================================================="
141141

142142
{
143143
# If the Spark SQL tests are enabled, run the tests with the Hive profiles enabled.
144+
# This must be a single argument, as it is.
144145
if [ -n "$_RUN_SQL_TESTS" ]; then
145146
SBT_MAVEN_PROFILES_ARGS="$SBT_MAVEN_PROFILES_ARGS -Phive"
146147
fi
147148

148149
if [ -n "$_SQL_TESTS_ONLY" ]; then
149-
SBT_MAVEN_TEST_ARGS="catalyst/test sql/test hive/test"
150+
# This must be an array of individual arguments. Otherwise, having one long string
151+
#+ will be interpreted as a single test, which doesn't work.
152+
SBT_MAVEN_TEST_ARGS=("catalyst/test" "sql/test" "hive/test")
150153
else
151-
SBT_MAVEN_TEST_ARGS="test"
154+
SBT_MAVEN_TEST_ARGS=("test")
152155
fi
153156

154-
echo "[info] Running Spark tests with these arguments: $SBT_MAVEN_PROFILES_ARGS $SBT_MAVEN_TEST_ARGS"
157+
echo "[info] Running Spark tests with these arguments: $SBT_MAVEN_PROFILES_ARGS ${SBT_MAVEN_TEST_ARGS[@]}"
155158

156159
# NOTE: echo "q" is needed because sbt on encountering a build file with failure
157160
#+ (either resolution or compilation) prompts the user for input either q, r, etc
158161
#+ to quit or retry. This echo is there to make it not block.
159162
# QUESTION: Why doesn't 'yes "q"' work?
160163
# QUESTION: Why doesn't 'grep -v -e "^\[info\] Resolving"' work?
161164
echo -e "q\n" \
162-
| sbt/sbt "$SBT_MAVEN_PROFILES_ARGS" "$SBT_MAVEN_TEST_ARGS" \
165+
| sbt/sbt "$SBT_MAVEN_PROFILES_ARGS" "${SBT_MAVEN_TEST_ARGS[@]}" \
163166
| grep -v -e "info.*Resolving" -e "warn.*Merging" -e "info.*Including"
164167
}
165168

0 commit comments

Comments
 (0)