unit tests: fix runtests.sh not filtering tests when passed a subdirectory
Metadata
Current evaluation
Merged a one-line fix correcting runtests.sh to properly filter tests when a subdirectory is passed. Previously, the script ran the entire suite. Approved by two reviewers, passed CI, and merged.
Suggested action: —
No scores available.
Issue body
Instructions in `TESTING.md` for testing a subsuite don't work as expected: it just runs the whole suite.
Before:
```sh
$ ./runtests.sh tests/unit/commands
...
collected 3842 items
...
```
After:
```sh
$ ./runtests.sh tests/unit/commands
...
collected 295 items
...
```
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- `shellcheck` throws a bunch of warnings, but I believe these are not related with this change at all.
- [ ] Have you successfully run `./runtests.sh tests/unit`?
- 3 tests fail out of 3842 but, again, it must be a local setup issue:
```
FAILED tests/unit/test_config.py::TestConfig::test_save_encoded_to_file
FAILED tests/unit/commands/test_whoami.py::WhoamiCommandBaseTestCase::test_unknown_email_must_suggest_logout_and_login
FAILED tests/unit/commands/test_whoami.py::WhoamiCommandBaseTestCase::test_whoami_must_print_email_and_developer_id
```
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a one-line fix correcting runtests.sh to properly filter tests when a subdirectory is passed. Previously, the script ran the entire suite. Approved by two reviewers, passed CI, and merged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for runtests.sh to correctly filter tests when a subdirectory is passed. The contributor resolved branch and CI failures, after which the change was approved and merged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for runtests.sh to correctly filter tests when a subdirectory is passed. Previously executed the full suite regardless of input. CI branch issues were resolved prior to merge. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5375 test: fix command tests | snapcraft | merged | Merged after updating test fixtures to resolve failing command unit tests. Approved by two reviewers, passed CI checks, and modified two files with 17 additions and 9 deletions. | |
| #3719 tests: fix lifecycle tests to run on new directory | snapcraft | merged | Merged a fix for lifecycle tests to run in a new directory instead of the current one. Approved by a reviewer, passed CI, and changed three lines. | |
| #1928 tests: remove duplicate tests | snapcraft | merged | Merged changes that remove duplicate tests and clarify test base class names to prevent future duplication. Approved by two reviewers, passed CI, and reduced unit test execution time. | |
| #1015 tests: reorganize command tests into subdirectory. | snapcraft | merged | Reorganized command tests into a subdirectory to improve manageability. Merged following approval and CI checks, resolving Launchpad bug #1651908 and slightly increasing code coverage. | |
| #1787 tests: move refresh to unit folder | snapcraft | merged | Merged a fix moving a misplaced refresh test into the unit folder. The test was previously excluded from regular runs due to the new directory structure, causing false passes. Approved by one reviewer, passed CI, and merged. | |
| #3653 tests: pass proper type to run for version | snapcraft | merged | Merged a single-file change to pass the correct type to the run command for version testing. Approved by one reviewer with passing CI checks. | |
| #986 fix(tests): don't fail if you have additional JREs | craft-parts | merged | Merged a fix preventing test failures when additional JREs are installed. Approved by two reviewers, passed CI, and modified one file with two line changes. Resolves #985. | |
| #461 test: improve test coverage | fetch-service | merged | Merged to improve test coverage, adding 270 lines across three files. Approved by two reviewers with all CI checks passing. | |
| #4661 fix(test): use prime dir in some tests | snapcraft | merged | Merged a test fix updating specific tests to use the prime directory. Approved by two reviewers, passed CI and Codecov checks, and modified one file with eleven additions and six deletions. | |
| #1027 tests: fix broken unit test in master | snapcraft | merged | Merged a one-line fix resolving a broken unit test in master. Approved by one reviewer with no unresolved comments. Changes passed CI and maintained 96.37% code coverage. Integrated directly into the main branch. |