Skip to content

fix: guard all check_ functions on HAS_DBSYNC - #3603

Merged
mkoura merged 2 commits into
masterfrom
agent_docs_dbsync_markers
Aug 11, 2026
Merged

fix: guard all check_ functions on HAS_DBSYNC#3603
mkoura merged 2 commits into
masterfrom
agent_docs_dbsync_markers

Conversation

@mkoura

@mkoura mkoura commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

All check_... functions in dbsync_utils are the high-level interface to db-sync meant to be called directly from tests, but six of them (check_address_reward, check_pool_off_chain_data, check_pool_off_chain_fetch_error, check_plutus_cost, check_plutus_costs, check_column_condition) were missing the HAS_DBSYNC guard and would fail when db-sync is not available. All of them now return early, so tests no longer need to wrap the calls in if configuration.HAS_DBSYNC:. The now redundant wrappers were removed from test_pools.py, and is_smash_running returns early when smash is not configured.

Also add AI agent documentation for the above: agent_docs/dbsync.md describes the db-sync markers and the pattern of calling check_... functions unguarded, and agent_docs/new_e2e_tests.md newly documents the testnets, long and smoke markers. AGENTS.md instructs to keep README.md brief and let user-facing tooling handle incorrect usage.

mkoura added 2 commits August 11, 2026 14:19
Add agent_docs/dbsync.md describing the dbsync and needs_dbsync
markers and the pattern of using dbsync_utils.check_... functions
without HAS_DBSYNC guards in test bodies.

Document the testnets, long and smoke pytest markers in
agent_docs/new_e2e_tests.md.

Instruct in AGENTS.md to keep README.md brief and let user facing
tooling handle incorrect usage.
Add the configuration.HAS_DBSYNC guard to the check_ functions that
were missing it: check_address_reward, check_pool_off_chain_data,
check_pool_off_chain_fetch_error, check_plutus_cost,
check_plutus_costs and check_column_condition. The check_ functions
are the high-level interface to db-sync meant to be called directly
from tests, so all of them now return early when db-sync is not
available.

Remove the HAS_DBSYNC wrappers in test_pools.py that are now
redundant, and make is_smash_running return early when smash is not
configured.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes db-sync checks safe to call unconditionally from E2E tests by ensuring dbsync_utils.check_* entrypoints consistently short-circuit when db-sync isn’t configured, and updates tests/docs to match that intended usage pattern.

Changes:

  • Add missing configuration.HAS_DBSYNC guards to additional dbsync_utils.check_* functions (returning early / None as appropriate).
  • Remove redundant if configuration.HAS_DBSYNC: wrappers in test_pools.py and rely on guarded check_* calls.
  • Improve agent-facing documentation around db-sync markers and recommended patterns (agent_docs/dbsync.md), plus document common E2E markers (agent_docs/new_e2e_tests.md) and reinforce README brevity guidance (AGENTS.md).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cardano_node_tests/utils/smash_utils.py Adds a configuration-based early return so SMASH checks are safely skipped when not configured.
cardano_node_tests/utils/dbsync_utils.py Guards several check_* helpers on HAS_DBSYNC and adjusts return types/docstrings accordingly.
cardano_node_tests/tests/test_pools.py Removes redundant db-sync availability guards and calls check_* helpers directly.
AGENTS.md Adds explicit guidance to keep README brief and place detailed AI guidance in agent_docs/.
agent_docs/new_e2e_tests.md Documents db-sync check guidance and introduces marker guidance for testnets/long/smoke.
agent_docs/dbsync.md New doc describing db-sync markers and the “call check_* unguarded” pattern.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cardano_node_tests/utils/smash_utils.py
@mkoura
mkoura merged commit 542b79a into master Aug 11, 2026
4 checks passed
@mkoura
mkoura deleted the agent_docs_dbsync_markers branch August 11, 2026 12:33
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.

2 participants