Skip to content

Conversation

@arikgreen
Copy link
Contributor

Fixed test skipping bug on non SDW platforms, if the usbrelay module is not installed.

Fixed test skipping bug on non SDW platforms,
if the usbrelay module is not installed.

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
@arikgreen arikgreen force-pushed the arikgreen/test-jd-dsp-d3-fix-skip branch from 55c3fb9 to f77e83c Compare November 28, 2025 12:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a test skipping bug on non-SDW platforms when the usbrelay module is not installed. The changes improve the error handling logic to ensure the test properly skips when required dependencies are missing.

Key changes:

  • Refactored command existence checks and execution validation to use more concise error handling patterns
  • Ensured proper test skipping behavior when usbrelay is unavailable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


dlogi "Checking usbrelay availability..."
if ! command -v usbrelay > /dev/null; then
command -v usbrelay || {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The command -v usbrelay check will output to stdout when the command exists, which may clutter logs. The original code redirected this output to /dev/null. Consider adding > /dev/null to maintain clean output: command -v usbrelay > /dev/null || {

Suggested change
command -v usbrelay || {
command -v usbrelay > /dev/null || {

Copilot uses AI. Check for mistakes.

if ! usbrelay_switch --debug > /dev/null; then
}
usbrelay_switch --debug || {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The usbrelay_switch --debug command will output debug information to stdout/stderr when it succeeds, which may clutter logs. The original code redirected this output to /dev/null. Consider adding > /dev/null to maintain clean output: usbrelay_switch --debug > /dev/null || {

Suggested change
usbrelay_switch --debug || {
usbrelay_switch --debug > /dev/null || {

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@redzynix redzynix left a comment

Choose a reason for hiding this comment

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

Thanks Artur, this fix works as intended

@arikgreen arikgreen merged commit e13c1eb into thesofproject:main Nov 28, 2025
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants