Skip to content

GH-46699: [CI][Dev] fix shellcheck errors in the ci/scripts/cpp_test.sh #46700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

hiroyuki-sato
Copy link
Collaborator

@hiroyuki-sato hiroyuki-sato commented Jun 4, 2025

Rationale for this change

ci/scripts/cpp_test.sh violates two shellcheck rules.

  • SC2071: < is for string comparisons. Use -lt instead.
  • SC2086: Double quote to prevent globbing and word splitting.
./ci/scripts/cpp_test.sh

In ./ci/scripts/cpp_test.sh line 22:
if [[ $# < 2 ]]; then
         ^-- SC2071 (error): < is for string comparisons. Use -lt instead.


In ./ci/scripts/cpp_test.sh line 87:
pushd ${build_dir}
      ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "${build_dir}"


In ./ci/scripts/cpp_test.sh line 103:
    --parallel ${n_jobs} \
               ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    --parallel "${n_jobs}" \


In ./ci/scripts/cpp_test.sh line 105:
    --timeout ${ARROW_CTEST_TIMEOUT:-300} \
              ^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    --timeout "${ARROW_CTEST_TIMEOUT:-300}" \


In ./ci/scripts/cpp_test.sh line 111:
    examples=$(find ${binary_output_dir} -executable -name "*example")
                    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    examples=$(find "${binary_output_dir}" -executable -name "*example")


In ./ci/scripts/cpp_test.sh line 129:
    ${binary_output_dir}/arrow-ipc-stream-fuzz ${ARROW_TEST_DATA}/arrow-ipc-stream/crash-*
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                               ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "${binary_output_dir}"/arrow-ipc-stream-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-stream/crash-*


In ./ci/scripts/cpp_test.sh line 130:
    ${binary_output_dir}/arrow-ipc-stream-fuzz ${ARROW_TEST_DATA}/arrow-ipc-stream/*-testcase-*
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                               ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "${binary_output_dir}"/arrow-ipc-stream-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-stream/*-testcase-*


In ./ci/scripts/cpp_test.sh line 131:
    ${binary_output_dir}/arrow-ipc-file-fuzz ${ARROW_TEST_DATA}/arrow-ipc-file/*-testcase-*
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                             ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "${binary_output_dir}"/arrow-ipc-file-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-file/*-testcase-*


In ./ci/scripts/cpp_test.sh line 132:
    ${binary_output_dir}/arrow-ipc-tensor-stream-fuzz ${ARROW_TEST_DATA}/arrow-ipc-tensor-stream/*-testcase-*
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                      ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "${binary_output_dir}"/arrow-ipc-tensor-stream-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-tensor-stream/*-testcase-*


In ./ci/scripts/cpp_test.sh line 134:
      ${binary_output_dir}/parquet-arrow-fuzz ${ARROW_TEST_DATA}/parquet/fuzzing/*-testcase-*
      ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                              ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
      "${binary_output_dir}"/parquet-arrow-fuzz "${ARROW_TEST_DATA}"/parquet/fuzzing/*-testcase-*

For more information:
  https://www.shellcheck.net/wiki/SC2071 -- < is for string comparisons. Use ...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

What changes are included in this PR?

  • Use -lt instead of <
  • Quote variables.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Copy link

github-actions bot commented Jun 4, 2025

⚠️ GitHub issue #46699 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting review Awaiting review label Jun 4, 2025
@kou
Copy link
Member

kou commented Jun 4, 2025

@github-actions crossbow submit -g cpp

@kou kou added the CI: Extra Run extra CI label Jun 4, 2025
Copy link

github-actions bot commented Jun 4, 2025

Revision: f195bb7

Submitted crossbow builds: ursacomputing/crossbow @ actions-6927c6452c

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou kou merged commit 23017e3 into apache:main Jun 5, 2025
35 of 37 checks passed
@kou kou removed the awaiting review Awaiting review label Jun 5, 2025
@github-actions github-actions bot added the awaiting merge Awaiting merge label Jun 5, 2025
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 23017e3.

There were 69 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge Awaiting merge CI: Extra Run extra CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants