Skip to content

Commit df1afc1

Browse files
authored
fix(firestore): Fix broken tests in nightly env (#7964)
#no-changelog
1 parent ef3c3f7 commit df1afc1

1 file changed

Lines changed: 48 additions & 7 deletions

File tree

  • firebase-firestore/src/androidTest/java/com/google/firebase/firestore

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/PipelineTest.java

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,11 +1772,30 @@ public void testNestedFields() {
17721772
.select("title", "awards.hugo")
17731773
.sort(field("title").descending())
17741774
.execute();
1775+
1776+
Map<String, Object> hitchhikerResult;
1777+
Map<String, Object> duneResult;
1778+
1779+
switch (IntegrationTestUtil.getTargetBackend()) {
1780+
case NIGHTLY:
1781+
hitchhikerResult =
1782+
mapOfEntries(
1783+
entry("title", "The Hitchhiker's Guide to the Galaxy"),
1784+
entry("awards", ImmutableMap.of("hugo", true)));
1785+
duneResult =
1786+
mapOfEntries(entry("title", "Dune"), entry("awards", ImmutableMap.of("hugo", true)));
1787+
break;
1788+
default:
1789+
hitchhikerResult =
1790+
mapOfEntries(
1791+
entry("title", "The Hitchhiker's Guide to the Galaxy"), entry("awards.hugo", true));
1792+
duneResult = mapOfEntries(entry("title", "Dune"), entry("awards.hugo", true));
1793+
break;
1794+
}
1795+
17751796
assertThat(waitFor(execute).getResults())
17761797
.comparingElementsUsing(DATA_CORRESPONDENCE)
1777-
.containsExactly(
1778-
ImmutableMap.of("title", "The Hitchhiker's Guide to the Galaxy", "awards.hugo", true),
1779-
ImmutableMap.of("title", "Dune", "awards.hugo", true));
1798+
.containsExactly(hitchhikerResult, duneResult);
17801799
}
17811800

17821801
@Test
@@ -1792,12 +1811,34 @@ public void testMapGetWithFieldNameIncludingNotation() {
17921811
field("nestedField.level.1"),
17931812
mapGet("nestedField", "level.1").mapGet("level.2").alias("nested"))
17941813
.execute();
1814+
1815+
Map<String, Object> hitchhikerResult;
1816+
Map<String, Object> duneResult;
1817+
1818+
switch (IntegrationTestUtil.getTargetBackend()) {
1819+
case NIGHTLY:
1820+
hitchhikerResult =
1821+
mapOfEntries(
1822+
entry("title", "The Hitchhiker's Guide to the Galaxy"),
1823+
entry("nestedField", ImmutableMap.of("level", ImmutableMap.of())),
1824+
entry("nested", true));
1825+
duneResult =
1826+
mapOfEntries(
1827+
entry("title", "Dune"),
1828+
entry("nestedField", ImmutableMap.of("level", ImmutableMap.of())),
1829+
entry("nested", null));
1830+
break;
1831+
default:
1832+
hitchhikerResult =
1833+
mapOfEntries(
1834+
entry("title", "The Hitchhiker's Guide to the Galaxy"), entry("nested", true));
1835+
duneResult = mapOfEntries(entry("title", "Dune"));
1836+
break;
1837+
}
1838+
17951839
assertThat(waitFor(execute).getResults())
17961840
.comparingElementsUsing(DATA_CORRESPONDENCE)
1797-
.containsExactly(
1798-
mapOfEntries(
1799-
entry("title", "The Hitchhiker's Guide to the Galaxy"), entry("nested", true)),
1800-
mapOfEntries(entry("title", "Dune")));
1841+
.containsExactly(hitchhikerResult, duneResult);
18011842
}
18021843

18031844
@Test

0 commit comments

Comments
 (0)