Bun fix the unit tests 3 - #9371
danieljbruce wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the conditional test execution logic in ci/run_conditional_tests.sh by reordering and splitting the checks for different TEST_TYPE values. The reviewer suggested simplifying this logic to avoid duplicating the success block and to make the control flow cleaner by combining the core package skip condition with the system test check.
| 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 |
There was a problem hiding this comment.
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.
| 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 |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕