Skip to content

test(integration): repair pre-existing integration test failures (fully green CI)#727

Merged
hellodk merged 1 commit into
masterfrom
fix/integration-tests-green
Jun 22, 2026
Merged

test(integration): repair pre-existing integration test failures (fully green CI)#727
hellodk merged 1 commit into
masterfrom
fix/integration-tests-green

Conversation

@hellodk

@hellodk hellodk commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

Repairs the integration-test gate, which has been red on master independent of any single PR. None of these failures were caused by the agent epic or the dependency bump — they are accumulated test drift across several subsystems.

File Root cause Fix
test_process_stats_read_609 local viewer_token fixture used the old create_access_token({...}) dict signature; seeded nodes missing first_seen_at drop the shadowing fixture (use conftest's), set first_seen_at
test_node_action_execution_614 referenced a non-existent db fixture; nodes missing node_token_hash/first_seen_at; handlers now slowapi-decorated (need Request); approve now async (apply_asyncexecuting) add dbdb_session alias, set required cols, pass a Request, update to the async dispatch contract
test_process_stats_ingest registered_node_client fixture never defined add the fixture (Node + X-Node-Token client)
test_salt_keys_api tests mocked a removed filesystem _dirs helper rewrite to mock the salt-api wheel client (key.list_all/accept/reject/delete, degraded/502 paths)
test_test_email_api route reads SMTP settings via an un-overridden sync session → platform_settings missing in test DB mock send_test_email to exercise the 400 path

Test plan

  • All 36 tests across the 5 touched files pass locally against a disposable Postgres
  • ruff check / ruff format clean
  • CI integration gate green on PR

Made with Cursor

Brings the integration gate back to green (red on master independent of CI):
- test_process_stats_read_609: drop shadowing viewer_token fixture (old
  create_access_token dict signature) and set required first_seen_at on seeded nodes
- test_node_action_execution_614: add db->db_session alias fixture, set required
  node_token_hash/first_seen_at, pass a Request to slowapi-decorated handlers,
  and update the approve happy-path to the async apply_async/'executing' contract
- test_process_stats_ingest: add the missing registered_node_client fixture
- test_salt_keys_api: rewrite filesystem _dirs mocks for the salt-api wheel
  client route (key.list_all/accept/reject/delete; degraded/502 paths)
- test_test_email_api: mock send_test_email since the route reads SMTP settings
  via an un-overridden sync session

Verified locally against a disposable Postgres: 36/36 in the touched files pass.
@github-actions github-actions Bot added test Test coverage improvement frontend Frontend / React changes labels Jun 22, 2026
@github-actions

Copy link
Copy Markdown

Coverage Report

85.1% on fleet_platform/services/ (gate: 80%)

Gate passed

@hellodk
hellodk merged commit b65be18 into master Jun 22, 2026
13 checks passed
@hellodk
hellodk deleted the fix/integration-tests-green branch June 22, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Frontend / React changes test Test coverage improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant