Skip to content

Comments

tests: Remove obsolete xfail markers#811

Merged
seapagan merged 2 commits intomainfrom
fix/remove-obsolete-xfail-markers
Jan 12, 2026
Merged

tests: Remove obsolete xfail markers#811
seapagan merged 2 commits intomainfrom
fix/remove-obsolete-xfail-markers

Conversation

@seapagan
Copy link
Owner

@seapagan seapagan commented Jan 12, 2026

Summary

  • Removed obsolete @pytest.mark.xfail decorators from CLI tests that were marked for Python <3.10
  • Removed unused import sys from test file
  • Updated docstrings to remove outdated comments about pyfakefs issues

Details

The project requires Python 3.10+, so the xfail markers that were checking sys.version_info < (3, 10) are no longer necessary. These markers were added due to testing issues (pyfakefs/pytest-mock compatibility) that only affected older Python versions.

Test plan

  • All affected tests now pass without xfail markers
  • Code base uses Python 3.10+ as minimum version

Summary by CodeRabbit

Release Notes

  • New Features

    • Enforced password complexity and strength validation to improve account security.
    • Prevented password reuse by recording recent passwords and keeping only the most recent entries so users must choose new, unique passwords.
  • Tests

    • Enabled previously skipped/expected-failure tests so they now run across supported Python versions, broadening test coverage.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds password security requirements and history documentation in TODO.md; enables previously xfailed CLI tests by removing xfail decorators and a redundant import in two test modules, causing those tests to run across all supported Python versions.

Changes

Cohort / File(s) Summary
Documentation & Planning
TODO.md
Adds planned password security features: complexity validation (length, character mix, zxcvbn strength), user_password_history table schema (user_id, password_hash, created_at), reuse prevention against last N hashes, and sliding-window pruning.
CLI tests — custom command
tests/cli/test_cli_custom_command.py
Removes xfail markers from test_init_function and test_init_function_with_existing_metadata; trims docstrings referencing Path-specific filesystem quirks.
CLI tests — DB seed
tests/cli/test_cli_db_seed.py
Removes Python-version-based xfail decorators from four tests and deletes an unused sys import so tests run on all supported Python versions.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI/AuthService as Auth Service
  participant DB

  User->>Auth Service: Submit password change request (new_password)
  Auth Service->>Auth Service: Validate complexity (length, char mix, zxcvbn)
  alt complexity fails
    Auth Service->>User: Reject with validation errors
  else complexity passes
    Auth Service->>DB: Retrieve last N password hashes for user
    DB-->>Auth Service: Return recent password_hashes
    Auth Service->>Auth Service: Compare new_password against recent hashes
    alt reuse detected
      Auth Service->>User: Reject due to password reuse
    else not reused
      Auth Service->>Auth Service: Hash new_password
      Auth Service->>DB: Insert new `user_password_history` entry
      Auth Service->>DB: Prune older entries to keep last N
      DB-->>Auth Service: Acknowledge
      Auth Service->>User: Confirm password changed
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 I hopped through tests and plans today,
Removed the skips that hid away,
I nudged the rules for passwords strong,
Kept history safe where hashes belong,
A tiny rabbit clap—hip hip hooray! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'tests: Remove obsolete xfail markers' accurately summarises the main change in the pull request—removing deprecated xfail decorators from test files across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a02604 and 1c3fa8d.

📒 Files selected for processing (1)
  • TODO.md

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @TODO.md:
- Around line 52-57: Fix the grammatical break in the TODO: merge the sentence
fragment "by pruning older entries so only the most recent N are kept." with the
previous sentence by removing the stray period so it reads: "Maintain this as a
sliding window by pruning older entries so only the most recent N are kept."
Ensure spacing and punctuation are correct after the change.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 93678cc and 3a02604.

📒 Files selected for processing (3)
  • TODO.md
  • tests/cli/test_cli_custom_command.py
  • tests/cli/test_cli_db_seed.py
💤 Files with no reviewable changes (1)
  • tests/cli/test_cli_db_seed.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.14)
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.10)
🔇 Additional comments (2)
tests/cli/test_cli_custom_command.py (2)

105-122: LGTM - xfail marker removal and docstring update.

The removal of the obsolete @pytest.mark.xfail decorator is appropriate since the project now requires Python 3.10+ as the minimum version. The updated docstring correctly documents why os.path is used for existence checks with pyfakefs.


124-160: LGTM - consistent with the first test update.

Same appropriate changes: xfail marker removed and docstring updated to reflect the use of os.path for filesystem checks.

TODO.md Outdated
Comment on lines 52 to 57
- Implement password complexity checks (length, character mix, zxcvbn strength).
Store password history in a dedicated table (user_password_history) with
user_id, password_hash, and created_at fields (hash format identical to the
current password). On password change, forbid reuse of the last N passwords
(e.g. 3–5) by verifying against recent hashes. Maintain this as a sliding
window. by pruning older entries so only the most recent N are kept.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor grammatical issue in the TODO description.

There's a stray period before "by pruning" which breaks the sentence flow.

Suggested fix
- Implement password complexity checks (length, character mix, zxcvbn strength).
-  Store password history in a dedicated table (user_password_history) with
-  user_id, password_hash, and created_at fields (hash format identical to the
-  current password). On password change, forbid reuse of the last N passwords
-  (e.g. 3–5) by verifying against recent hashes. Maintain this as a sliding
-  window. by pruning older entries so only the most recent N are kept.
+ Implement password complexity checks (length, character mix, zxcvbn strength).
+  Store password history in a dedicated table (user_password_history) with
+  user_id, password_hash, and created_at fields (hash format identical to the
+  current password). On password change, forbid reuse of the last N passwords
+  (e.g. 3–5) by verifying against recent hashes. Maintain this as a sliding
+  window by pruning older entries so only the most recent N are kept.
🤖 Prompt for AI Agents
In @TODO.md around lines 52 - 57, Fix the grammatical break in the TODO: merge
the sentence fragment "by pruning older entries so only the most recent N are
kept." with the previous sentence by removing the stray period so it reads:
"Maintain this as a sliding window by pruning older entries so only the most
recent N are kept." Ensure spacing and punctuation are correct after the change.

@codacy-production
Copy link

codacy-production bot commented Jan 12, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (93678cc) 2424 2424 100.00%
Head commit (1c3fa8d) 2424 (+0) 2424 (+0) 100.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#811) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@seapagan seapagan force-pushed the fix/remove-obsolete-xfail-markers branch from 3a02604 to 1c3fa8d Compare January 12, 2026 18:43
@seapagan seapagan merged commit d59f79c into main Jan 12, 2026
12 of 15 checks passed
@seapagan seapagan deleted the fix/remove-obsolete-xfail-markers branch January 12, 2026 18:44
@seapagan seapagan self-assigned this Jan 15, 2026
@seapagan seapagan added the tests label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant