Skip to content

Specify fwts data directory for snap checkbox (Bugfix)#2323

Open
tomli380576 wants to merge 6 commits intomainfrom
actually-fix-fwts-klog-path
Open

Specify fwts data directory for snap checkbox (Bugfix)#2323
tomli380576 wants to merge 6 commits intomainfrom
actually-fix-fwts-klog-path

Conversation

@tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Feb 9, 2026

(I accidentally broke #2252 during rebase xD this PR is a copy of that based on the current main)

Description

This PR fixes #1997 by specifying the -j option in fwts when we detect that we are in a snap environment.

Resolved issues

  1. Snap and Debian checkbox produces inconsistent fwts klog result #1997
  2. Fixed a few unbound variables and undefined variable access

Documentation

Basically we are telling fwts to read the directory in checkbox runtime instead of whatever /usr/share/fwts is inside a snap.

-j, --json-data-path         Specify path to fwts json data files - default is /usr/share/fwts

Tests

Original unit tests

Real hardware with snaps built here:

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 55.32%. Comparing base (958af61) to head (21d333c).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...kbox-support/checkbox_support/scripts/fwts_test.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2323      +/-   ##
==========================================
+ Coverage   55.24%   55.32%   +0.07%     
==========================================
  Files         413      413              
  Lines       44448    44618     +170     
  Branches     8194     8247      +53     
==========================================
+ Hits        24556    24683     +127     
- Misses      19032    19073      +41     
- Partials      860      862       +2     
Flag Coverage Δ
checkbox-support 71.39% <90.00%> (+0.50%) ⬆️
provider-base 32.10% <100.00%> (-0.08%) ⬇️
provider-certification-client 57.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tomli380576 tomli380576 requested a review from Copilot February 9, 2026 07:09
Copy link
Contributor

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

Fixes fwts execution inside snap-based checkbox by ensuring fwts reads its JSON data files from the checkbox runtime, and adds regression coverage for the new behavior.

Changes:

  • Added get_fwts_base_cmd() to select the correct fwts invocation (snap vs deb).
  • Updated fwts command construction in main() to use the new base command.
  • Added unit tests covering snap/deb environment command selection and error behavior.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 8 comments.

File Description
checkbox-support/checkbox_support/scripts/fwts_test.py Introduces snap-aware fwts base command and uses it when building fwts invocations.
checkbox-support/checkbox_support/scripts/tests/test_fwts_test.py Adds unit tests validating base command selection and snap-directory error handling.

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

Comment on lines +187 to +189
"We are in a snap environment, "
+ "but '{}' ".format(fwts_json_data_dir)
+ "doesn't exist"
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The SystemExit message is a bit hard to read due to string concatenation and the extra space inside "but '{}' ". Consider simplifying into a single formatted string and making it more actionable (e.g., explicitly stating the expected directory and hinting that the snap/checkbox-runtime may be corrupted or missing the fwts data files). This will also make tests/assertions cleaner.

Suggested change
"We are in a snap environment, "
+ "but '{}' ".format(fwts_json_data_dir)
+ "doesn't exist"
"FWTS JSON data directory '{}' does not exist under the "
"CHECKBOX_RUNTIME snap directory. The snap/checkbox-runtime "
"may be corrupted or missing the FWTS data files.".format(
fwts_json_data_dir
)

Copilot uses AI. Check for mistakes.
tomli380576 and others added 4 commits February 9, 2026 15:11
@tomli380576 tomli380576 marked this pull request as ready for review February 12, 2026 04:55
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.

Snap and Debian checkbox produces inconsistent fwts klog result

1 participant