Skip to content

Commit c9ecdc2

Browse files
authored
[DENG-9685] Speed up test_run_query_no_query_file integration test (#8415)
1 parent 58e2320 commit c9ecdc2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

script/entrypoint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ elif [ "$1" = "query" ]; then
3737
# query [options] FILE
3838
# we dispatch to a script that inspects metadata and emulates the following call:
3939
# bq query [options] < FILE
40+
if [ "$#" -lt 2 ]; then
41+
echo "Error: 'query' command requires at least one argument (FILE)" >&2
42+
exit 1
43+
fi
4044
exec script/bqetl query run "${@: -1}" "${@:1:$#-1}"
4145
elif [ "$XCOM_PUSH" = "true" ]; then
4246
# KubernetesPodOperator will extract the contents of /airflow/xcom/return.json as an xcom

tests/test_entrypoint.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,7 @@ def test_run_query_no_query_file(self):
137137
check=True,
138138
capture_output=True,
139139
)
140-
assert b"No queries matching" in e.value.stderr
140+
assert (
141+
b"Error: 'query' command requires at least one argument (FILE)"
142+
in e.value.stderr
143+
)

0 commit comments

Comments
 (0)