Skip to content

test: gaming-leaderboard iteration-001-python#86

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/test-gaming-leaderboard-batch-80
Closed

test: gaming-leaderboard iteration-001-python#86
Copilot wants to merge 4 commits intomainfrom
copilot/test-gaming-leaderboard-batch-80

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Python FastAPI implementation of the gaming-leaderboard scenario with Cosmos DB best practices loaded.

Data Model

  • Single leaderboard container with /playerId partition key
  • Type discriminators (player, score) for polymorphic documents
  • Denormalized player stats (bestScore, averageScore, totalGames) updated on score submission

Key Design Decisions

  • Ranking: COUNT-based approach (Rule 9.2) — SELECT VALUE COUNT(1) ... WHERE c.bestScore > @score instead of full partition scans
  • Leaderboard tiebreaking: ORDER BY c.bestScore DESC, c.displayName ASC with matching composite indexes in both directions
  • TOP clause: Literal integer interpolation with int() cast per Rule 3.8
  • Player lookups: Point reads via read_item(item=player_id, partition_key=player_id)

Cosmos DB Configuration

  • Async SDK (azure.cosmos.aio) with aiohttp dependency (Rule 4.15)
  • Singleton client via FastAPI lifespan context manager (Rule 4.18)
  • Auto-detect emulator endpoint and disable SSL verification (Rule 4.6)
  • Composite indexes for (bestScore DESC, displayName ASC) with inverse pair (Rule 5.1); single-property ORDER BY (e.g. timestamp DESC) relies on the default range index

Endpoints

All 10 contract endpoints implemented: health, CRUD players, submit score, global/regional leaderboards, player rank with ±10 neighbors, score history.

Copilot AI changed the title [WIP] Implement gaming leaderboard batch test iteration 1 of 5 test: gaming-leaderboard iteration-001-python Mar 31, 2026
Copilot AI requested a review from TheovanKraay March 31, 2026 14:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

[Test] Test Results: gaming-leaderboard / iteration-001-python

Pass rate: 22.3% (21/94 tests passed)

Build & Startup Signals

  • Build: PASS (exit code: 0)
  • Startup: PASS
Status Count
[PASS] Passed 21
[FAIL] Failed 2
[ERR] Errors 70
[SKIP] Skipped 1

Results by Category

Category Passed Failed Skipped
API Contract 10 35 0
Build & Startup 2 0 0
Cosmos DB Infrastructure & SDK 3 9 1
Data Integrity 4 1 0
Robustness 4 27 0

Failures Requiring Evaluation

These failures indicate areas where the generated code does not
conform to the API contract or Cosmos DB best practices.
Each failure should be analyzed to determine if:

  • A new rule/skill should be added to the agent kit

  • An existing rule needs to be updated or clarified

  • The generated code has a bug that the agent should fix

  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayer::test_get_existing_player

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayer::test_get_player_has_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayer::test_get_player_stats_updated_after_scores

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestSubmitScore::test_submit_score_returns_201

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestSubmitScore::test_submit_score_response_has_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestSubmitScore::test_submit_score_returns_correct_data

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_returns_200

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_returns_array

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_entries_have_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_sorted_descending

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_ranks_sequential

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_top_player_is_highest_scorer

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGlobalLeaderboard::test_global_leaderboard_respects_top_parameter

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestRegionalLeaderboard::test_regional_leaderboard_returns_200

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestRegionalLeaderboard::test_regional_leaderboard_only_contains_region_players

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestRegionalLeaderboard::test_regional_leaderboard_sorted_descending

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestRegionalLeaderboard::test_regional_leaderboard_entries_have_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestPlayerRank::test_player_rank_returns_200

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestPlayerRank::test_player_rank_has_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestPlayerRank::test_player_rank_correct_for_top_player

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestPlayerRank::test_player_rank_neighbors_is_array

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestPlayerRank::test_player_rank_neighbors_have_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_returns_200

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_returns_array

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_entries_have_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_contains_all_player_scores

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_ordered_by_most_recent_first

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_respects_limit

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestGetPlayerScores::test_score_history_only_shows_own_scores

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestUpdatePlayer::test_update_player_returns_200

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestUpdatePlayer::test_update_player_response_has_required_fields

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestUpdatePlayer::test_update_player_reflects_new_display_name

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestUpdatePlayer::test_update_player_preserves_stats

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestDeletePlayer::test_delete_player_returns_204

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_api_contract.TestDeletePlayer::test_deleted_player_returns_404_on_get

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestContainerDesign::test_has_multiple_containers_or_synthetic_keys

    Failed: Only one container with a simple partition key. Leaderboard systems need different access patterns: player lookup (by playerId) and ranking queries (by leaderboard scope). Use multiple containers or synthetic partition keys like 'global_weekly' or 'US_all-time'. (Rules: partition-synthetic-k

  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestContainerDesign::test_leaderboard_container_uses_synthetic_key

    Failed: Leaderboard container 'leaderboard' uses /playerId as partition key. This makes top-N ranking queries cross-partition (expensive). Use a synthetic key like /leaderboardKey = 'global_weekly' so all entries for one leaderboard are in one partition. (Rule: partition-synthetic-keys)

  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestPlayerScoreSerialization::test_scores_stored_as_numbers

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestPlayerScoreSerialization::test_etag_present_on_player_documents

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestDocumentStructure::test_documents_have_type_discriminator

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestDocumentStructure::test_documents_have_schema_version

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestCrossBoundaryConsistency::test_player_stats_stored_correctly

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestCrossBoundaryConsistency::test_leaderboard_entries_denormalized

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_cosmos_infrastructure.TestCrossBoundaryConsistency::test_synthetic_partition_key_value_format

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_data_integrity.TestDataPersistence::test_player_document_exists_in_cosmos

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestInvalidInput::test_submit_score_missing_player_id_returns_4xx

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestInvalidInput::test_submit_score_missing_score_returns_4xx

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestInvalidInput::test_submit_score_negative_value_returns_4xx

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestInvalidInput::test_submit_score_for_nonexistent_player_returns_4xx

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestComputedFieldAccuracy::test_average_score_mathematically_correct

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestComputedFieldAccuracy::test_total_games_count_correct

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestComputedFieldAccuracy::test_best_score_is_maximum

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestComputedFieldAccuracy::test_player_with_single_score_stats

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestComputedFieldAccuracy::test_new_score_updates_stats

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestDataTypeCorrectness::test_player_stats_types

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestDataTypeCorrectness::test_leaderboard_entry_types

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestDataTypeCorrectness::test_score_submission_returns_correct_types

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestWriteReadConsistency::test_score_reflected_in_leaderboard

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestWriteReadConsistency::test_regional_filter_matches_stored_region

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestWriteReadConsistency::test_player_rank_score_matches_leaderboard

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestEdgeCases::test_empty_region_leaderboard

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestEdgeCases::test_leaderboard_no_duplicate_players

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestEdgeCases::test_top_parameter_zero_returns_empty

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestEdgeCases::test_top_parameter_one

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestEdgeCases::test_zero_score_submission

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestRapidOperations::test_rapid_score_submissions_all_counted

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestRapidOperations::test_concurrent_score_submissions_all_counted

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestLeaderboardTiebreaking::test_tied_scores_sorted_by_display_name_ascending

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestLeaderboardTiebreaking::test_tied_scores_have_sequential_ranks

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestUpdateDeleteConsistency::test_updated_region_reflected_in_regional_leaderboard

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestUpdateDeleteConsistency::test_deleted_player_removed_from_leaderboard

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"
  • testing-v2.scenarios.gaming-leaderboard.tests.test_robustness.TestUpdateDeleteConsistency::test_deleted_player_scores_not_in_history

    failed on setup with "AssertionError: Failed to submit score for player-001: 500 Internal Server Error
    assert 500 == 201

  • where 500 = <Response [500]>.status_code"

@github-actions
Copy link
Copy Markdown
Contributor

❌ Application Startup Failed (python) — attempt 1/3

stderr (last lines):

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\azure\cosmos\aio\_cosmos_client_connection_async.py", line 826, in Create
    result, last_response_headers = await self.__Post(path, request_params, body, headers, **kwargs)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\azure\cosmos\aio\_cosmos_client_connection_async.py", line 1001, in __Post
    return await asynchronous_request.AsynchronousRequest(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\azure\cosmos\aio\_asynchronous_request.py", line 241, in AsynchronousRequest
    return await _retry_utility_async.ExecuteAsync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\azure\cosmos\aio\_retry_utility_async.py", line 139, in ExecuteAsync
    result = await ExecuteFunctionAsync(function, global_endpoint_manager, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\azure\cosmos\aio\_retry_utility_async.py", line 336, in ExecuteFunctionAsync
    return await function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\azure\cosmos\aio\_asynchronous_request.py", line 153, in _Request
    raise exceptions.CosmosHttpResponseError(message=data, response=response)
azure.cosmos.exceptions.CosmosHttpResponseError: (BadRequest) Message: {"Errors":["The composite index at 'indexingPolicy.additionalIndexes.composite['2']' must have at least 2 paths."]}

ActivityId: 9eec15e9-2ad3-457a-90df-06315f871981, Request URI: /apps/DocDbApp/services/DocDbMaster0/partitions/780e44f4-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.14.0
Code: BadRequest
Message: Message: {"Errors":["The composite index at 'indexingPolicy.additionalIndexes.composite['2']' must have at least 2 paths."]}

ActivityId: 9eec15e9-2ad3-457a-90df-06315f871981, Request URI: /apps/DocDbApp/services/DocDbMaster0/partitions/780e44f4-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.14.0

ERROR:    Application startup failed. Exiting.
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001E4DF8AE990>
Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x000001E4DFA083B0>, 493.687)])', 'deque([(<aiohttp.client_proto.ResponseHandler object at 0x000001E4DFA08A10>, 494.171)])']
connector: <aiohttp.connector.TCPConnector object at 0x000001E4DF9F2390>

stdout (last lines):

(empty)

Common causes (python):

  • Missing dependency in requirements.txt
  • Import error or syntax error in Python code
  • Cosmos DB connection failure (check SSL certs, endpoint URL, key)
  • Port already in use or wrong port configuration

🔧 Action Required

Copy the prompt below and post it as a new comment to trigger Copilot to fix this issue.
(Bot-posted @copilot mentions do not trigger the agent — it must come from a user.)

@copilot The application failed to start in CI (attempt 1/3). Fix the code and push to this branch.

**Instructions:**
1. Read the stderr output in the comment above — it contains the actual error
2. Read your generated code in `testing-v2/scenarios/gaming-leaderboard/iterations/iteration-001-python/`
3. Fix the root cause of the startup failure
4. Make sure the application can start and respond to HTTP requests
5. Commit and push the fix to this branch

@TheovanKraay
Copy link
Copy Markdown
Contributor

@copilot The application failed to start in CI (attempt 1/3). Fix the code and push to this branch.

Instructions:

  1. Read the stderr output in the comment above — it contains the actual error
  2. Read your generated code in testing-v2/scenarios/gaming-leaderboard/iterations/iteration-001-python/
  3. Fix the root cause of the startup failure
  4. Make sure the application can start and respond to HTTP requests
  5. Commit and push the fix to this branch

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot The application failed to start in CI (attempt 1/3). Fix the code and push to this branch.

Instructions:
...

Fixed in 7ecd5a3. The composite indexes at positions 2 and 3 had only single paths (/timestamp), but Cosmos DB requires composite indexes to have at least 2 paths. Removed them — single-property ORDER BY (e.g., ORDER BY c.timestamp DESC) is already served by the default range index (/*).

@github-actions
Copy link
Copy Markdown
Contributor

📋 Deep Evaluation Ready — 21/94 tests passed (22.3%)

CI has finished testing. A deep evaluation is needed to analyze the generated code and produce a thorough ITERATION.md.


🔧 Action Required

Copy the prompt below and post it as a new comment to trigger Copilot to perform the deep evaluation.
(Bot-posted @copilot mentions do not trigger the agent — it must come from a user.)

@copilot **Deep evaluation needed.** Test results: 21/94 tests passed (22.3%).

Skills were loaded for this iteration. Perform a thorough code review and update the ITERATION.md that CI created. Follow these steps:

1. Read the generated code (unzip `testing-v2/scenarios/gaming-leaderboard/iterations/iteration-001-python/source-code.zip` if archived, or read files in `testing-v2/scenarios/gaming-leaderboard/iterations/iteration-001-python/`)
2. Read all rules in `skills/cosmosdb-best-practices/AGENTS.md`
3. Read `testing-v2/scenarios/gaming-leaderboard/api-contract.yaml`
4. Read the template at `testing-v2/scenarios/_iteration-template.md` for the expected format
5. Read the test results comment above
6. **Rewrite** `testing-v2/scenarios/gaming-leaderboard/iterations/iteration-001-python/ITERATION.md` with a thorough evaluation:
   - **Data Model** section: analyze container design, embedding vs referencing, document structure, and which model-* rules were applied or missed
   - **Container Configuration**: partition key choices, indexing policies, composite indexes, and which partition-*/index-* rules were applied
   - **Repository Layer**: query patterns, point reads, parameterization, and which query-* rules were applied
   - **SDK Usage**: singleton client, connection mode, ETag handling, diagnostics, and which sdk-* rules were applied
   - **Build Status**: any build issues and fixes
   - **Gaps Identified**: critical, best practice, and knowledge gaps
   - **Recommendations**: high/medium/low priority skill improvements
   - **Score Summary**: per-category scores (Data Model, Partition Key, Indexing, SDK Usage, Query Patterns, Overall) each X/10
7. If any tests failed: classify each failure per `testing-v2/EVALUATE.md`, create new rules if needed (rules must be GENERIC — not scenario-specific; any app hitting the same Cosmos DB pattern should benefit), update `testing-v2/IMPROVEMENTS-LOG.md`, run `npm run build`
8. Commit all changes to this PR branch

@github-actions
Copy link
Copy Markdown
Contributor

❌ Test Failures — 72 of 94 tests failed.

See the test results comment above for detailed failure output.


🔧 Action Required

Copy the prompt below and post it as a new comment to trigger Copilot to fix the failures.
(Bot-posted @copilot mentions do not trigger the agent — it must come from a user.)

@copilot **72 of 94 tests failed.** Evaluate the test failures and fix the code. Follow the instructions in testing-v2/EVALUATE.md.

**Instructions:**
1. Read the test results comment above for specific failures
2. Read the API contract at `testing-v2/scenarios/gaming-leaderboard/api-contract.yaml`
3. Read the existing rules in `skills/cosmosdb-best-practices/rules/`
4. Classify each failure (contract violation, missing rule, unclear rule, SDK quirk)
5. Fix contract violations directly in the generated code
6. Create new rules if needed, update `testing-v2/IMPROVEMENTS-LOG.md`
7. Run `npm run build` to regenerate AGENTS.md
8. Commit all changes to this PR branch

@github-actions
Copy link
Copy Markdown
Contributor

Closed as part of batch aggregation. Results aggregated in batch #80.

@github-actions github-actions Bot closed this Mar 31, 2026
@github-actions github-actions Bot deleted the copilot/test-gaming-leaderboard-batch-80 branch March 31, 2026 15:05
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