Commit graph

8 commits

Author SHA1 Message Date
itzzdev09
1cc815f5b6 test: narrow the control-character skip and find Windows by SYSTEMROOT
Review feedback, both valid.

The control-character fixture caught every OSError, so an unwritable
temp directory or a full disk would have reported these security tests
as skipped instead of failing. It now skips only for errors that mean
the name itself is unrepresentable (EINVAL, EILSEQ, ENAMETOOLONG) and
re-raises everything else.

The mount-policy test derived the protected directory from the
checkout's drive, so a repo cloned to D: would look for D:\Windows,
miss, and skip the branch the test exists to cover. Ask Windows where
it is installed via SYSTEMROOT instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 12:45:17 +05:30
itzzdev09
a3d60a72a0 test: remove Unix-only and developer-specific assumptions from the suite
A full run on Windows 11 failed 31 tests, almost all because a fixture
assumed POSIX behaviour or read the developer's own Git configuration
rather than because Strix misbehaved. That noise hides real regressions.

- Resolve git with `shutil.which` instead of `/usr/bin/env git`, and skip
  the module when no git is present. This single line accounted for 19 of
  the 31 failures.
- Isolate every git subprocess from `GIT_CONFIG_GLOBAL`/`GIT_CONFIG_SYSTEM`
  and supply a commit identity, so a global `core.excludesFile`,
  `commit.gpgSign`, or `core.hooksPath` cannot change what a test sees.
- Create control-character filenames through a fixture that skips where
  the filesystem rejects them, instead of failing to build the fixture.
- Choose the protected system directory for the platform in the mount
  policy test. `check_mountable_dir` already handles both families, so on
  Windows this now exercises the real policy instead of failing early.
- Assert secret-file permissions through a fixture that keeps the POSIX
  0o600 check exact and, on Windows, skips with the reason stated rather
  than weakening the assertion. The device-identity test is split so its
  identity contract still runs everywhere.
- Pin mypy to `platform = "linux"` so type checking resolves the same
  APIs as CI and the container target. This removes the six
  `fcntl.flock`/`os.getuid`/`os.getgid` attribute errors reported on
  Windows without adding ignores that `warn_unused_ignores` would then
  flag on Linux.

Windows now reports 12 failures, all owned elsewhere: #1258 (7-8,
intermittent), #648/#652, #1288, and #1285.

Refs #1259

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 09:28:49 +05:30
Ahmed Allam
941c960650 fix(ci): make the pre-commit mypy hook and the test suite pass on a fresh checkout 2026-09-02 15:15:51 +03:00
yoni-at-strix
cbb0f57058
Reach MCP tools on demand instead of registering every one (#1175) 2026-08-26 16:31:08 -07:00
0xallam
a6d578c4a8 chore: nuke tests/ and the entire test toolchain
The test suite was carrying migration scars and a long tail of
low-density assertions over SDK-derived behavior. Drop it wholesale.

- Delete ``tests/`` (42 files, ~4900 LoC).
- Drop ``pytest`` / ``pytest-asyncio`` / ``pytest-cov`` /
  ``pytest-mock`` from the dev dependency group; ``uv sync``
  uninstalls the matching wheels.
- Strip the pytest + coverage config blocks, the
  ``flake8-pytest-style`` ruff selector, the ``tests/**`` per-file
  ignores, the ``[tool.mypy.overrides] tests.*`` block, and the
  ``"tests"`` entry from bandit's ``exclude_dirs``.
- Drop the ``test`` / ``test-cov`` Makefile targets; ``dev`` no
  longer depends on tests.
- Strip the ``# Testing`` block from ``.gitignore`` (``.coverage``,
  ``.pytest_cache/``, ``htmlcov/``, ``coverage.xml``, ``nosetests.xml``,
  ``.tox/``, ``.hypothesis/``).

ruff (27) and mypy (82) baselines unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 13:01:20 -07:00
Ahmed Allam
35dd9d0a8f refactor(tests): reorganize unit tests module structure 2025-12-04 00:02:14 +04:00
Ahmed Allam
6c5c0b0d1c chore: resolve linting errors in test modules 2025-12-04 00:02:14 +04:00
Jeong-Ryeol
65c3383ecc test: add initial unit tests for argument_parser module
Add comprehensive test suite for the argument_parser module including:
- Tests for _convert_to_bool with truthy/falsy values
- Tests for _convert_to_list with JSON and comma-separated inputs
- Tests for _convert_to_dict with valid/invalid JSON
- Tests for convert_string_to_type with various type annotations
- Tests for convert_arguments with typed functions
- Tests for ArgumentConversionError exception class

This establishes the foundation for the project's test infrastructure
with pytest configuration already in place.
2025-12-04 00:02:14 +04:00