Skip to content

Remove misleading scons tests build target#19606

Merged
seanbudd merged 2 commits into
nvaccess:masterfrom
bramd:fix/remove-scons-tests-16799
Feb 13, 2026
Merged

Remove misleading scons tests build target#19606
seanbudd merged 2 commits into
nvaccess:masterfrom
bramd:fix/remove-scons-tests-16799

Conversation

@bramd

@bramd bramd commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #16799

Summary of the issue:

The scons tests command only ran translation string comment checks (equivalent to scons checkPot), which was misleading since users expected it to run all tests.

Description of user facing changes:

None.

Description of developer facing changes:

The scons tests build target has been removed. Running scons tests now produces an explicit error message directing users to the correct commands:

  • scons checkPot for translation string checks
  • rununittests.bat for unit tests
  • runsystemtests.bat for system tests
  • runlint.bat for linting

Description of development approach:

  • Removed the tests/sconscript file that defined the misleading tests target.
  • Inlined the checkPot target definition from tests/sconscript into the main sconstruct file.
  • Added an explicit tests alias that raises SCons.Errors.UserError with a helpful error message, preventing SCons from silently succeeding due to the existing tests/ directory.

Testing strategy:

  • Verified scons tests now exits with code 2 and displays the error message with alternative commands.
  • Verified scons checkPot continues to work correctly.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

The `scons tests` command only ran translation string comment checks
(equivalent to `scons checkPot`), which was misleading since users
expected it to run all tests. The target has been removed by inlining
the checkPot target definition from tests/sconscript into the main
sconstruct file and deleting the tests/sconscript file.

Individual test commands should be used instead:
- `scons checkPot` for translation string checks
- `rununittests.bat` for unit tests
- `runsystemtests.bat` for system tests
- `runlint.bat` for linting
@bramd bramd force-pushed the fix/remove-scons-tests-16799 branch from a615aa6 to 820400f Compare February 12, 2026 16:13
@bramd bramd marked this pull request as ready for review February 12, 2026 16:29
@bramd bramd requested a review from a team as a code owner February 12, 2026 16:29
@bramd bramd requested a review from seanbudd February 12, 2026 16:29
Comment thread sconstruct Outdated
@seanbudd seanbudd enabled auto-merge (squash) February 13, 2026 01:43
@seanbudd seanbudd merged commit 0c0f494 into nvaccess:master Feb 13, 2026
77 of 79 checks passed
@github-actions github-actions Bot added this to the 2026.2 milestone Feb 13, 2026
tareh7z pushed a commit to tareh7z/nvda that referenced this pull request Feb 16, 2026
Closes nvaccess#16799
Summary of the issue:

The scons tests command only ran translation string comment checks (equivalent to scons checkPot), which was misleading since users expected it to run all tests.
Description of user facing changes:

None.
Description of developer facing changes:

The scons tests build target has been removed. Running scons tests now produces an explicit error message directing users to the correct commands:

    scons checkPot for translation string checks
    rununittests.bat for unit tests
    runsystemtests.bat for system tests
    runlint.bat for linting

Description of development approach:

    Removed the tests/sconscript file that defined the misleading tests target.
    Inlined the checkPot target definition from tests/sconscript into the main sconstruct file.
    Added an explicit tests alias that raises SCons.Errors.UserError with a helpful error message, preventing SCons from silently succeeding due to the existing tests/ directory.
bramd added a commit to bramd/nvda that referenced this pull request Feb 23, 2026
Remove the checkPot target from sconstruct and provide a standalone
runcheckpot.bat script that calls scons pot then validates the output
with tests/checkPot.py. This follows up on PR nvaccess#19606 review feedback
to stop using SCons for checkPot entirely.

Also fixes tests/checkPot.py __main__ to call sys.exit() with the
error count so exit codes propagate correctly when run standalone.
bramd added a commit to bramd/nvda that referenced this pull request Feb 23, 2026
Remove the checkPot target from sconstruct and provide a standalone
runcheckpot.bat script that calls scons pot then validates the output
with tests/checkPot.py. This follows up on PR nvaccess#19606 review feedback
to stop using SCons for checkPot entirely.

Also fixes tests/checkPot.py __main__ to call sys.exit() with the
error count so exit codes propagate correctly when run standalone.
bramd added a commit to bramd/nvda that referenced this pull request Feb 23, 2026
Remove the checkPot target from sconstruct and provide a standalone
runcheckpot.bat script that calls scons pot then validates the output
with tests/checkPot.py. This follows up on PR nvaccess#19606 review feedback
to stop using SCons for checkPot entirely.

Also fixes tests/checkPot.py __main__ to call sys.exit() with the
error count so exit codes propagate correctly when run standalone.
seanbudd pushed a commit that referenced this pull request Mar 3, 2026
Link to issue number:

N/A
Summary of the issue:

scons checkPot is more a utility and not really part of the build. Having a separate runcheckpot.bat is consistent with other utilities like rununittests or runlint. This has been suggested in a comment on PR #19606. Since that PR was already merged, this change is done in this new PR.
Description of user facing changes:

None
Description of developer facing changes:

The scons checkPot command has been replaced with runcheckpot.bat. This script generates the pot file via scons pot, then runs tests/checkPot.py directly on the output. Any arguments (e.g. --all-cores, -j 1) are forwarded to the scons pot invocation. Since we need an up-to-date pot file to run checks and generating that file is part of the SCons build, we still have the overhead of calling SCons when running runcheckpot.bat.
Description of development approach:

    Created runcheckpot.bat following the naming and structure conventions of existing bat files (rununittests.bat, runlicensecheck.bat, etc.).
    Removed the checkPot target, action, and alias from sconstruct (the pot target is unchanged).
    Updated the pre-commit hook from language: system (invoking cmd.exe /c "scons checkPot") to language: script (invoking ./runcheckpot.bat), matching how other bat-based hooks are configured.
    Updated ci/scripts/tests/translationCheck.ps1 to call runcheckpot.bat.
    Fixed tests/checkPot.py __main__ block to call sys.exit() with the error count. Previously it only printed the count, which meant standalone invocation always exited 0 regardless of errors. This was not a problem when SCons used the return
    value directly, but is critical now that the script is invoked via bat file.
    Updated developer documentationchangelog entry.
@bramd bramd deleted the fix/remove-scons-tests-16799 branch March 23, 2026 10:54
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.

Remove scons tests

2 participants