Skip to content

Commit ac639bd

Browse files
author
Zoran Cvetkov
committed
more test fixes
1 parent ff72928 commit ac639bd

File tree

2 files changed

+32
-35
lines changed

2 files changed

+32
-35
lines changed

store/test-store/tests/graph/entity_cache.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,8 @@ fn sort_by_entity_key(mut mods: Vec<EntityModification>) -> Vec<EntityModificati
193193
fn filter_vid(arr: Vec<Entity>) -> Vec<Entity> {
194194
arr.into_iter()
195195
.map(|mut e| {
196-
// println!("E1: {:?}", e);
197196
e.remove("vid");
198-
// println!("E2: {:?}", e);
199197
e.remove_null_fields();
200-
// println!("E3: {:?}", e);
201198
e
202199
})
203200
.collect()

store/test-store/tests/graphql/query.rs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -468,25 +468,25 @@ async fn insert_test_entities(
468468
(
469469
"Musician",
470470
vec![
471-
entity! { is => id: "m1", name: "John", mainBand: "b1", bands: vec!["b1", "b2"], favoriteCount: 10, birthDate: timestamp.clone() },
472-
entity! { is => id: "m2", name: "Lisa", mainBand: "b1", bands: vec!["b1"], favoriteCount: 100, birthDate: timestamp.clone() },
471+
entity! { is => id: "m1", name: "John", mainBand: "b1", bands: vec!["b1", "b2"], favoriteCount: 10, birthDate: timestamp.clone(), vid: 0i64 },
472+
entity! { is => id: "m2", name: "Lisa", mainBand: "b1", bands: vec!["b1"], favoriteCount: 100, birthDate: timestamp.clone(), vid: 1i64 },
473473
],
474474
),
475475
("Publisher", vec![entity! { is => id: pub1 }]),
476476
(
477477
"Band",
478478
vec![
479-
entity! { is => id: "b1", name: "The Musicians", originalSongs: vec![s[1], s[2]] },
480-
entity! { is => id: "b2", name: "The Amateurs", originalSongs: vec![s[1], s[3], s[4]] },
479+
entity! { is => id: "b1", name: "The Musicians", originalSongs: vec![s[1], s[2]], vid: 0i64 },
480+
entity! { is => id: "b2", name: "The Amateurs", originalSongs: vec![s[1], s[3], s[4]], vid: 1i64 },
481481
],
482482
),
483483
(
484484
"Song",
485485
vec![
486-
entity! { is => id: s[1], sid: "s1", title: "Cheesy Tune", publisher: pub1, writtenBy: "m1", media: vec![md[1], md[2]] },
487-
entity! { is => id: s[2], sid: "s2", title: "Rock Tune", publisher: pub1, writtenBy: "m2", media: vec![md[3], md[4]] },
488-
entity! { is => id: s[3], sid: "s3", title: "Pop Tune", publisher: pub1, writtenBy: "m1", media: vec![md[5]] },
489-
entity! { is => id: s[4], sid: "s4", title: "Folk Tune", publisher: pub1, writtenBy: "m3", media: vec![md[6]] },
486+
entity! { is => id: s[1], sid: "s1", title: "Cheesy Tune", publisher: pub1, writtenBy: "m1", media: vec![md[1], md[2]], vid: 0i64 },
487+
entity! { is => id: s[2], sid: "s2", title: "Rock Tune", publisher: pub1, writtenBy: "m2", media: vec![md[3], md[4]], vid: 1i64 },
488+
entity! { is => id: s[3], sid: "s3", title: "Pop Tune", publisher: pub1, writtenBy: "m1", media: vec![md[5]], vid: 2i64 },
489+
entity! { is => id: s[4], sid: "s4", title: "Folk Tune", publisher: pub1, writtenBy: "m3", media: vec![md[6]], vid: 3i64 },
490490
],
491491
),
492492
(
@@ -498,31 +498,31 @@ async fn insert_test_entities(
498498
(
499499
"SongStat",
500500
vec![
501-
entity! { is => id: s[1], played: 10 },
502-
entity! { is => id: s[2], played: 15 },
501+
entity! { is => id: s[1], played: 10, vid: 0i64 },
502+
entity! { is => id: s[2], played: 15, vid: 1i64 },
503503
],
504504
),
505505
(
506506
"BandReview",
507507
vec![
508-
entity! { is => id: "r1", body: "Bad musicians", band: "b1", author: "u1" },
509-
entity! { is => id: "r2", body: "Good amateurs", band: "b2", author: "u2" },
510-
entity! { is => id: "r5", body: "Very Bad musicians", band: "b1", author: "u3" },
508+
entity! { is => id: "r1", body: "Bad musicians", band: "b1", author: "u1", vid: 0i64 },
509+
entity! { is => id: "r2", body: "Good amateurs", band: "b2", author: "u2", vid: 1i64 },
510+
entity! { is => id: "r5", body: "Very Bad musicians", band: "b1", author: "u3", vid: 2i64 },
511511
],
512512
),
513513
(
514514
"SongReview",
515515
vec![
516-
entity! { is => id: "r3", body: "Bad", song: s[2], author: "u1" },
517-
entity! { is => id: "r4", body: "Good", song: s[3], author: "u2" },
518-
entity! { is => id: "r6", body: "Very Bad", song: s[2], author: "u3" },
516+
entity! { is => id: "r3", body: "Bad", song: s[2], author: "u1", vid: 0i64 },
517+
entity! { is => id: "r4", body: "Good", song: s[3], author: "u2", vid: 1i64 },
518+
entity! { is => id: "r6", body: "Very Bad", song: s[2], author: "u3", vid: 2i64 },
519519
],
520520
),
521521
(
522522
"User",
523523
vec![
524-
entity! { is => id: "u1", name: "Baden", latestSongReview: "r3", latestBandReview: "r1", latestReview: "r1" },
525-
entity! { is => id: "u2", name: "Goodwill", latestSongReview: "r4", latestBandReview: "r2", latestReview: "r2" },
524+
entity! { is => id: "u1", name: "Baden", latestSongReview: "r3", latestBandReview: "r1", latestReview: "r1", vid: 0i64 },
525+
entity! { is => id: "u2", name: "Goodwill", latestSongReview: "r4", latestBandReview: "r2", latestReview: "r2", vid: 1i64 },
526526
],
527527
),
528528
(
@@ -534,17 +534,17 @@ async fn insert_test_entities(
534534
(
535535
"Photo",
536536
vec![
537-
entity! { is => id: md[1], title: "Cheesy Tune Single Cover", author: "u1" },
538-
entity! { is => id: md[3], title: "Rock Tune Single Cover", author: "u1" },
539-
entity! { is => id: md[5], title: "Pop Tune Single Cover", author: "u1" },
537+
entity! { is => id: md[1], title: "Cheesy Tune Single Cover", author: "u1", vid: 0i64 },
538+
entity! { is => id: md[3], title: "Rock Tune Single Cover", author: "u1", vid: 1i64 },
539+
entity! { is => id: md[5], title: "Pop Tune Single Cover", author: "u1", vid: 2i64 },
540540
],
541541
),
542542
(
543543
"Video",
544544
vec![
545-
entity! { is => id: md[2], title: "Cheesy Tune Music Video", author: "u2" },
546-
entity! { is => id: md[4], title: "Rock Tune Music Video", author: "u2" },
547-
entity! { is => id: md[6], title: "Folk Tune Music Video", author: "u2" },
545+
entity! { is => id: md[2], title: "Cheesy Tune Music Video", author: "u2", vid: 0i64 },
546+
entity! { is => id: md[4], title: "Rock Tune Music Video", author: "u2", vid: 1i64 },
547+
entity! { is => id: md[6], title: "Folk Tune Music Video", author: "u2", vid: 2i64 },
548548
],
549549
),
550550
(
@@ -554,19 +554,19 @@ async fn insert_test_entities(
554554
(
555555
"Single",
556556
vec![
557-
entity! { is => id: "rl2", title: "Rock", songs: vec![s[2]] },
558-
entity! { is => id: "rl3", title: "Cheesy", songs: vec![s[1]] },
559-
entity! { is => id: "rl4", title: "Silence", songs: Vec::<graph::prelude::Value>::new() },
557+
entity! { is => id: "rl2", title: "Rock", songs: vec![s[2]], vid: 0i64 },
558+
entity! { is => id: "rl3", title: "Cheesy", songs: vec![s[1]], vid: 1i64 },
559+
entity! { is => id: "rl4", title: "Silence", songs: Vec::<graph::prelude::Value>::new(), vid: 2i64 },
560560
],
561561
),
562562
(
563563
"Plays",
564564
vec![
565-
entity! { is => id: 1i64, timestamp: ts0, song: s[1], user: "u1"},
566-
entity! { is => id: 2i64, timestamp: ts0, song: s[1], user: "u2"},
567-
entity! { is => id: 3i64, timestamp: ts0, song: s[2], user: "u1"},
568-
entity! { is => id: 4i64, timestamp: ts0, song: s[1], user: "u1"},
569-
entity! { is => id: 5i64, timestamp: ts0, song: s[1], user: "u1"},
565+
entity! { is => id: 1i64, timestamp: ts0, song: s[1], user: "u1", vid: 0i64 },
566+
entity! { is => id: 2i64, timestamp: ts0, song: s[1], user: "u2", vid: 1i64 },
567+
entity! { is => id: 3i64, timestamp: ts0, song: s[2], user: "u1", vid: 2i64 },
568+
entity! { is => id: 4i64, timestamp: ts0, song: s[1], user: "u1", vid: 3i64 },
569+
entity! { is => id: 5i64, timestamp: ts0, song: s[1], user: "u1", vid: 4i64 },
570570
],
571571
),
572572
];

0 commit comments

Comments
 (0)