Skip to content

test: exercise SDK APIs in macOS compliance coverage - #805

Draft
dustinbyrne wants to merge 1 commit into
mainfrom
ci/sdk-harness-coverage-2026-09-07
Draft

test: exercise SDK APIs in macOS compliance coverage#805
dustinbyrne wants to merge 1 commit into
mainfrom
ci/sdk-harness-coverage-2026-09-07

Conversation

@dustinbyrne

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Make compliance results exercise the SDK rather than adapter-written flags HTTP, retries, parsing, and called-events.

  • Forward capture timestamps through the existing public Date argument and observe SDK-generated UUIDs.
  • Use public identity/group setters, reload callbacks, and cached getters; retain native retries and side effects.
  • Replace idle-network flush completion with conservative acknowledgment observation. Unresolved captures time out rather than claiming delivery or retry exhaustion.
  • Run harness 1.0.0 without filters; verify the expected 47-case inventory and label reports as macOS shared-core coverage.

Adapter/CI changes only: no shipped SDK source, public API, defaults, or release changes.

💚 How did you test it?

  • Adapter make test: 6 Swift and 5 Python tests passed.
  • Public-entry make smoke: timestamp/UUID/503 flush, invalid timestamps, and native flags 502/504 retry/result/group/called-event scenarios passed.
  • Scoped formatting/lint, shell syntax, and YAML checks passed.
  • Pinned harness 1.0.0 source on macOS arm64: 47 selected, 32 passed, 15 failed — capture 29/30, flags 3/17. All expected test IDs executed; this is not an all-green compliance verdict.

The capture failure is the adapter's explicit timeout when retry exhaustion cannot be observed through a public drain callback. Flags failures expose extra identity/group-triggered requests, native field/lifecycle differences, and one-shot fixtures consumed before the explicit reload. The initial expectation was 34 passes; returned-value and called-event-value fixtures exposed two additional failures. Endpoint-specific smoke fixtures verify those SDK paths separately without replacing harness results.

Local Docker was unavailable; the hybrid Docker/Colima CI run remains to be checked. No iOS simulator/device validation is claimed. See sdk_compliance_adapter/README.md for profile limitations.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi worker using file and shell tools, followed by a fresh read-only agent review. The profile preserves SDK ownership of transport and side effects; known contract mismatches remain visible rather than filtered. Human review is required. The local agent session is not publicly accessible.

@dustinbyrne dustinbyrne self-assigned this Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Profile: macOS shared core (not iOS-device validation), gzip /batch, preload/autocapture disabled, public identity/group + reload + cached getter. SDK-triggered reloads are retained; unresolved queue acknowledgments time out. See sdk_compliance_adapter/README.md for contract limitations.

posthog-ios Compliance Report

Date: 2026-09-07T22:01:44.763566+00:00
Duration: 153261ms

⚠️ Some Tests Failed

32/47 tests passed, 15 failed


Capture Tests

⚠️ 29/30 tests passed, 1 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 370ms
Format Validation.Event Has Uuid 408ms
Format Validation.Event Has Lib Properties 406ms
Format Validation.Distinct Id Is String 323ms
Format Validation.Token Is Present 352ms
Format Validation.Custom Properties Preserved 606ms
Format Validation.Event Has Timestamp 500ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc 461ms
Retry Behavior.Retries On 503 9439ms
Retry Behavior.Does Not Retry On 400 2228ms
Retry Behavior.Does Not Retry On 401 2260ms
Retry Behavior.Respects Retry After Header 8784ms
Retry Behavior.Implements Backoff 22749ms
Retry Behavior.Retries On 500 6857ms
Retry Behavior.Retries On 502 6832ms
Retry Behavior.Retries On 504 6806ms
Retry Behavior.Max Retries Respected 25367ms
Deduplication.Generates Unique Uuids 638ms
Deduplication.Preserves Uuid On Retry 6793ms
Deduplication.Preserves Uuid And Timestamp On Retry 14208ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 10342ms
Deduplication.No Duplicate Events In Batch 770ms
Deduplication.Different Events Have Different Uuids 644ms
Compression.Sends Gzip When Enabled 754ms
Batch Format.Uses Proper Batch Structure 459ms
Batch Format.Flush With No Events Sends Nothing 321ms
Batch Format.Multiple Events Batched Together 683ms
Error Handling.Does Not Retry On 403 2573ms
Error Handling.Does Not Retry On 413 2477ms
Error Handling.Retries On 408 6728ms

Failures

retry_behavior.max_retries_respected

504, message='Gateway Timeout', url='http://host.docker.internal:8080/flush'

Feature_Flags Tests

⚠️ 3/17 tests passed, 14 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 403ms
Request Payload.Flags Request Uses V2 Query Param 409ms
Request Payload.Flags Request Hits Flags Path Not Decide 510ms
Request Payload.Flags Request Omits Authorization Header 406ms
Request Payload.Token In Flags Body Matches Init 489ms
Request Payload.Groups Round Trip 450ms
Request Payload.Groups Default To Empty Object 656ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 605ms
Request Payload.Disable Geoip Omitted Defaults To False 652ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 566ms
Request Lifecycle.No Flags Request On Init Alone 130ms
Request Lifecycle.No Flags Request On Normal Capture 399ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 730ms
Request Lifecycle.Mock Response Value Is Returned To Caller 424ms
Retry Behavior.Retries Flags On 502 977ms
Retry Behavior.Retries Flags On 504 961ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 547ms

Failures

request_payload.request_with_person_properties_device_id

Expected 1 /flags requests, got 2

request_payload.flags_request_uses_v2_query_param

Expected 1 /flags requests, got 2

request_payload.flags_request_hits_flags_path_not_decide

Expected 1 /flags requests, got 2

request_payload.flags_request_omits_authorization_header

Expected 1 /flags requests, got 2

request_payload.groups_round_trip

Field 'company' not found in /flags request body at path 'groups.company'. Available keys: []

request_payload.groups_default_to_empty_object

Field 'group_properties' not found in /flags request body at path 'group_properties'. Available keys: ['api_key', '$device_id', 'timezone', '$anon_distinct_id', 'distinct_id', 'person_properties', 'groups']

request_payload.disable_geoip_false_propagates_as_geoip_disable_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['$anon_distinct_id', 'groups', 'person_properties', 'distinct_id', '$device_id', 'api_key', 'timezone']

request_payload.disable_geoip_omitted_defaults_to_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['groups', 'api_key', 'person_properties', '$anon_distinct_id', '$device_id', 'timezone', 'distinct_id']

request_payload.flag_keys_to_evaluate_contains_only_requested_key

Field 'flag_keys_to_evaluate' not found in /flags request body at path 'flag_keys_to_evaluate'. Available keys: ['groups', '$anon_distinct_id', 'person_properties', 'distinct_id', '$device_id', 'api_key', 'timezone']

request_lifecycle.two_flag_calls_produce_two_remote_requests

Expected 2 /flags requests, got 3

request_lifecycle.mock_response_value_is_returned_to_caller

Expected last action result 'variant-a', got None

retry_behavior.retries_flags_on_502

Expected 2 /flags requests, got 3

retry_behavior.retries_flags_on_504

Expected 2 /flags requests, got 3

side_effect_events.get_feature_flag_captures_feature_flag_called_event

Event '$feature_flag_called' property '$feature_flag_response': expected True, got None

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