Skip to content

[codex] Make docs metadata assertions resilient#11

Merged
robertoecf merged 3 commits into
mainfrom
codex/pr9-test-resilience
May 5, 2026
Merged

[codex] Make docs metadata assertions resilient#11
robertoecf merged 3 commits into
mainfrom
codex/pr9-test-resilience

Conversation

@robertoecf
Copy link
Copy Markdown
Owner

@robertoecf robertoecf commented May 5, 2026

Summary

  • Addresses the remaining Gemini review comments from PR [codex] Add docs meta language regression #9.
  • Makes the /docs language assertion resilient while still scoped to the root <html> element.
  • Parses the document head and verifies the <meta name="description"> content directly instead of searching generic terms in the whole page body.

Root cause

The PR #9 regression test fixed the docs meta-language issue but initially used assertions that were either too tightly coupled to exact HTML text or too broad across the entire rendered page.

Review feedback addressed

Validation

  • PYTHONPATH="$PWD/src" /Users/macbook/repos/findata-br/.venv/bin/ruff format --check src/ tests/ scripts/
  • PYTHONPATH="$PWD/src" /Users/macbook/repos/findata-br/.venv/bin/ruff check src/ tests/ scripts/
  • PYTHONPATH="$PWD/src" /Users/macbook/repos/findata-br/.venv/bin/python -m mypy src/findata
  • PYTHONPATH="$PWD/src" /Users/macbook/repos/findata-br/.venv/bin/python -m pytest tests/ -q
  • git diff --check

Note

Leaving this PR open for explicit approval before merge/close.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

Test assertions in test_developer_docs_page were refined to check for more specific HTML and text markers independently. The test now asserts the lang="en" attribute and four individual section labels separately, rather than combined assertions.

Changes

Test Assertion Refinement

Layer / File(s) Summary
Test Assertions
tests/test_api.py
test_developer_docs_page replaces a single combined HTML/text assertion with granular checks: lang="en" attribute verification and separate assertions for "Developer console", "REST API", "OpenAPI schema", and "MCP endpoint" labels.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A test grows more precise today,
Each section checked in its own way,
No more combined assertions blurred,
Four labels and an lang attribute—heard!
Granular checks, both clear and tight,
Our docs are tested just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title '[codex] Make docs metadata assertions resilient' accurately describes the main change: refactoring HTML/text assertions in the test to be more resilient to formatting variations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pr9-test-resilience

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0efc31588

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/test_api.py Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the developer documentation tests by relaxing the HTML language attribute check and splitting a combined string assertion into individual checks for 'REST API', 'OpenAPI schema', and 'MCP endpoint'. Feedback indicates that while this improves resilience against punctuation changes, it reduces the test's specificity for metadata, as these terms may appear elsewhere in the page body rather than specifically in the document head.

Comment thread tests/test_api.py Outdated
@robertoecf
Copy link
Copy Markdown
Owner Author

Avaliei também o comentário do CodeRabbit: era informativo/rate-limit. Depois dos commits adicionais, o status do CodeRabbit ficou verde como Review completed, sem comentários acionáveis novos.

@robertoecf robertoecf merged commit b0b4d70 into main May 5, 2026
7 checks passed
@robertoecf robertoecf deleted the codex/pr9-test-resilience branch May 5, 2026 16:59
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.

1 participant