Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/presubmit-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
run: pnpm run compile
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
bun-version: latest
- run: bun --version
- run: bash ci/run_conditional_tests.sh --strict
name: Run unit tests with Bun
env:
RUN_TESTS_MODE: RUN_UNIT_TESTS
BUILD_TYPE: presubmit
TEST_TYPE: units
TEST_CMD: bun run
TEST_CMD: bun --bun run
SHARD_TOTAL: ${{ needs.setup.outputs.shard-total }}
SHARD_INDEX: ${{ matrix.shard-index }}
GIT_DIFF_ARG: HEAD^1
Expand Down
5 changes: 4 additions & 1 deletion ci/run_conditional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,12 @@ for subdir in ${subdirs[@]}; do
echo "run samples tests for core/packages in ${d}"
should_test=true
fi
elif [[ "${TEST_TYPE}" == "lint" ]] || [[ "${TEST_TYPE}" == "units" ]]; then
echo "change detected in ${d} for ${TEST_TYPE} test"
should_test=true
elif [[ "${d}" == core/packages/* ]] || [[ "${d}" == core/dev-packages/* ]]; then
echo "skipping core package ${d} in non-core trigger"
elif [[ "${TEST_TYPE}" == "system" ]] || [[ "${TEST_TYPE}" == "lint" ]] || [[ "${TEST_TYPE}" == "units" ]]; then
elif [[ "${TEST_TYPE}" == "system" ]]; then
echo "change detected in ${d} for ${TEST_TYPE} test"
should_test=true
Comment on lines +223 to 230

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The current implementation duplicates the success block (echo "change detected..." and should_test=true) and splits the TEST_TYPE checks, making the control flow harder to follow. We can simplify this by combining the skip condition with the system test type check. This allows us to keep the success block unified and avoids duplicating code.

Suggested change
elif [[ "${TEST_TYPE}" == "lint" ]] || [[ "${TEST_TYPE}" == "units" ]]; then
echo "change detected in ${d} for ${TEST_TYPE} test"
should_test=true
elif [[ "${d}" == core/packages/* ]] || [[ "${d}" == core/dev-packages/* ]]; then
echo "skipping core package ${d} in non-core trigger"
elif [[ "${TEST_TYPE}" == "system" ]] || [[ "${TEST_TYPE}" == "lint" ]] || [[ "${TEST_TYPE}" == "units" ]]; then
elif [[ "${TEST_TYPE}" == "system" ]]; then
echo "change detected in ${d} for ${TEST_TYPE} test"
should_test=true
elif [[ ( "${d}" == core/packages/* || "${d}" == core/dev-packages/* ) && "${TEST_TYPE}" == "system" ]]; then
echo "skipping core package ${d} in non-core trigger"
elif [[ "${TEST_TYPE}" == "system" ]] || [[ "${TEST_TYPE}" == "lint" ]] || [[ "${TEST_TYPE}" == "units" ]]; then
echo "change detected in ${d} for ${TEST_TYPE} test"
should_test=true

elif [[ "${tests_with_credentials[*]}" =~ "${d}" ]] && [[ -n "${GOOGLE_APPLICATION_CREDENTIALS}" ]]; then
Expand Down
Loading