Skip to content

Commit

Permalink
test(firestore): Make test data independent (#10763)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhshkh authored Aug 28, 2024
1 parent b04d255 commit dfe3af4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions firestore/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,7 @@ func TestIntegration_AggregationQueries(t *testing.T) {

indexFields := [][]string{
{"weight", "model"},
{"weight", "height"},
{"weight", "volume"},
}
adminCtx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
defer cancel()
Expand All @@ -2530,14 +2530,14 @@ func TestIntegration_AggregationQueries(t *testing.T) {

h := testHelper{t}
docs := []map[string]interface{}{
{"weight": 1.5, "height": 99, "model": "A"},
{"weight": 2.6, "height": 98, "model": "A"},
{"weight": 3.7, "height": 97, "model": "B"},
{"weight": 4.8, "height": 96, "model": "B"},
{"weight": 5.9, "height": 95, "model": "C"},
{"weight": 6.0, "height": 94, "model": "B"},
{"weight": 7.1, "height": 93, "model": "C"},
{"weight": 8.2, "height": 93, "model": "A"},
{"weight": 1.5, "volume": 99, "model": "A"},
{"weight": 2.6, "volume": 98, "model": "A"},
{"weight": 3.7, "volume": 97, "model": "B"},
{"weight": 4.8, "volume": 96, "model": "B"},
{"weight": 5.9, "volume": 95, "model": "C"},
{"weight": 6.0, "volume": 94, "model": "B"},
{"weight": 7.1, "volume": 93, "model": "C"},
{"weight": 8.2, "volume": 93, "model": "A"},
}
docRefs := []*DocumentRef{}
for _, doc := range docs {
Expand Down Expand Up @@ -2572,7 +2572,7 @@ func TestIntegration_AggregationQueries(t *testing.T) {
}{
{
desc: "Multiple aggregations",
aggregationQuery: query.NewAggregationQuery().WithCount("count1").WithAvg("weight", "weight_avg1").WithAvg("height", "height_avg1").WithSum("weight", "weight_sum1").WithSum("height", "height_sum1"),
aggregationQuery: query.NewAggregationQuery().WithCount("count1").WithAvg("weight", "weight_avg1").WithAvg("volume", "height_avg1").WithSum("weight", "weight_sum1").WithSum("volume", "height_sum1"),
wantErr: false,
result: map[string]interface{}{
"count1": &pb.Value{ValueType: &pb.Value_IntegerValue{IntegerValue: int64(8)}},
Expand All @@ -2584,7 +2584,7 @@ func TestIntegration_AggregationQueries(t *testing.T) {
},
{
desc: "Aggregations in transaction",
aggregationQuery: query.NewAggregationQuery().WithCount("count1").WithAvg("weight", "weight_avg1").WithAvg("height", "height_avg1").WithSum("weight", "weight_sum1").WithSum("height", "height_sum1"),
aggregationQuery: query.NewAggregationQuery().WithCount("count1").WithAvg("weight", "weight_avg1").WithAvg("volume", "height_avg1").WithSum("weight", "weight_sum1").WithSum("volume", "height_sum1"),
wantErr: false,
runInTransaction: true,
result: map[string]interface{}{
Expand Down

0 comments on commit dfe3af4

Please sign in to comment.