diff --git a/src/e2e/app/cli/common/src/kamu_api_server_client_ext.rs b/src/e2e/app/cli/common/src/kamu_api_server_client_ext.rs index ef4fc862e..e9033fbe3 100644 --- a/src/e2e/app/cli/common/src/kamu_api_server_client_ext.rs +++ b/src/e2e/app/cli/common/src/kamu_api_server_client_ext.rs @@ -104,33 +104,27 @@ lazy_static! { }; } -/// NOTE: 1 millisecond for stable order within tests -/// /// pub const DATASET_ROOT_PLAYER_SCORES_INGEST_DATA_NDJSON_CHUNK_1: &str = indoc::indoc!( r#" {"match_time": "2000-01-01", "match_id": 1, "player_id": "Alice", "score": 100} - {"match_time": "2000-01-01 00:00:00.001", "match_id": 1, "player_id": "Bob", "score": 80} + {"match_time": "2000-01-01", "match_id": 1, "player_id": "Bob", "score": 80} "# ); -/// NOTE: 1 millisecond for stable order within tests -/// /// pub const DATASET_ROOT_PLAYER_SCORES_INGEST_DATA_NDJSON_CHUNK_2: &str = indoc::indoc!( r#" {"match_time": "2000-01-02", "match_id": 2, "player_id": "Alice", "score": 70} - {"match_time": "2000-01-02 00:00:00.001", "match_id": 2, "player_id": "Charlie", "score": 90} + {"match_time": "2000-01-02", "match_id": 2, "player_id": "Charlie", "score": 90} "# ); -/// NOTE: 1 millisecond for stable order within tests -/// /// pub const DATASET_ROOT_PLAYER_SCORES_INGEST_DATA_NDJSON_CHUNK_3: &str = indoc::indoc!( r#" {"match_time": "2000-01-03", "match_id": 3, "player_id": "Bob", "score": 60} - {"match_time": "2000-01-03 00:00:00.001", "match_id": 3, "player_id": "Charlie", "score": 110} + {"match_time": "2000-01-03", "match_id": 3, "player_id": "Charlie", "score": 110} "# ); diff --git a/src/e2e/app/cli/repo-tests/src/commands/test_ingest_command.rs b/src/e2e/app/cli/repo-tests/src/commands/test_ingest_command.rs index 04224bcaa..124a735c7 100644 --- a/src/e2e/app/cli/repo-tests/src/commands/test_ingest_command.rs +++ b/src/e2e/app/cli/repo-tests/src/commands/test_ingest_command.rs @@ -198,8 +198,8 @@ pub async fn test_ingest_from_stdin(kamu: KamuCliPuppet) { ┌────┬──────────────────────┬──────────────────────┬──────────┬───────────┬───────┐ │ op │ system_time │ match_time │ match_id │ player_id │ score │ ├────┼──────────────────────┼──────────────────────┼──────────┼───────────┼───────┤ - │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Bob │ 80 │ + │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ └────┴──────────────────────┴──────────────────────┴──────────┴───────────┴───────┘ "# ), @@ -215,8 +215,8 @@ pub async fn test_ingest_from_stdin(kamu: KamuCliPuppet) { ┌────┬──────────────────────┬──────────────────────┬──────────┬───────────┬───────┐ │ op │ system_time │ match_time │ match_id │ player_id │ score │ ├────┼──────────────────────┼──────────────────────┼──────────┼───────────┼───────┤ - │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Bob │ 80 │ + │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Alice │ 70 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Charlie │ 90 │ └────┴──────────────────────┴──────────────────────┴──────────┴───────────┴───────┘ @@ -234,8 +234,8 @@ pub async fn test_ingest_from_stdin(kamu: KamuCliPuppet) { ┌────┬──────────────────────┬──────────────────────┬──────────┬───────────┬───────┐ │ op │ system_time │ match_time │ match_id │ player_id │ score │ ├────┼──────────────────────┼──────────────────────┼──────────┼───────────┼───────┤ - │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Bob │ 80 │ + │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Alice │ 70 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Charlie │ 90 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-03T00:00:00Z │ 3 │ Bob │ 60 │ @@ -326,8 +326,8 @@ pub async fn test_ingest_with_source_name(kamu: KamuCliPuppet) { ┌────┬──────────────────────┬──────────────────────┬──────────┬───────────┬───────┐ │ op │ system_time │ match_time │ match_id │ player_id │ score │ ├────┼──────────────────────┼──────────────────────┼──────────┼───────────┼───────┤ - │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Bob │ 80 │ + │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ └────┴──────────────────────┴──────────────────────┴──────────┴───────────┴───────┘ "# ), @@ -349,8 +349,8 @@ pub async fn test_ingest_with_source_name(kamu: KamuCliPuppet) { ┌────┬──────────────────────┬──────────────────────┬──────────┬───────────┬───────┐ │ op │ system_time │ match_time │ match_id │ player_id │ score │ ├────┼──────────────────────┼──────────────────────┼──────────┼───────────┼───────┤ - │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Bob │ 80 │ + │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Alice │ 70 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Charlie │ 90 │ └────┴──────────────────────┴──────────────────────┴──────────┴───────────┴───────┘ @@ -374,8 +374,8 @@ pub async fn test_ingest_with_source_name(kamu: KamuCliPuppet) { ┌────┬──────────────────────┬──────────────────────┬──────────┬───────────┬───────┐ │ op │ system_time │ match_time │ match_id │ player_id │ score │ ├────┼──────────────────────┼──────────────────────┼──────────┼───────────┼───────┤ - │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Bob │ 80 │ + │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-01T00:00:00Z │ 1 │ Alice │ 100 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Alice │ 70 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-02T00:00:00Z │ 2 │ Charlie │ 90 │ │ 0 │ 2050-01-02T03:04:05Z │ 2000-01-03T00:00:00Z │ 3 │ Bob │ 60 │ @@ -449,12 +449,12 @@ async fn assert_ingest_data_to_player_scores_from_stdio( r#" SELECT op, system_time, - DATE_TRUNC('second', match_time) as match_time, + match_time, match_id, player_id, score FROM "player-scores" - ORDER BY match_time; + ORDER BY match_id, score, player_id; "# ), "--output-format",