|
1 | 1 | (ns cmr.system-int-test.search.granule.granule-periodic-temporal-search-test |
2 | 2 | "Integration test for CMR granule periodic temporal search" |
3 | 3 | (:require |
4 | | - [clojure.test :refer :all] |
5 | | - [cmr.common.util :refer [are2]] |
6 | | - [cmr.system-int-test.data2.core :as d] |
7 | | - [cmr.system-int-test.data2.granule :as dg] |
8 | | - [cmr.system-int-test.data2.umm-spec-collection :as data-umm-c] |
9 | | - [cmr.system-int-test.data2.umm-spec-common :as data-umm-cmn] |
10 | | - [cmr.system-int-test.utils.index-util :as index] |
11 | | - [cmr.system-int-test.utils.ingest-util :as ingest] |
12 | | - [cmr.system-int-test.utils.search-util :as search])) |
| 4 | + [clojure.test :refer :all] |
| 5 | + [cmr.common.util :refer [are3]] |
| 6 | + [cmr.system-int-test.data2.core :as d] |
| 7 | + [cmr.system-int-test.data2.granule :as dg] |
| 8 | + [cmr.system-int-test.data2.umm-spec-collection :as data-umm-c] |
| 9 | + [cmr.system-int-test.data2.umm-spec-common :as data-umm-cmn] |
| 10 | + [cmr.system-int-test.utils.index-util :as index] |
| 11 | + [cmr.system-int-test.utils.ingest-util :as ingest] |
| 12 | + [cmr.system-int-test.utils.search-util :as search])) |
13 | 13 |
|
14 | 14 | (use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1"})) |
15 | 15 |
|
|
75 | 75 | (index/wait-until-indexed) |
76 | 76 |
|
77 | 77 | (testing "Search granules with periodic temporal parameter" |
78 | | - (are2 [grans temporal-params] |
| 78 | + (are3 [grans temporal-params] |
79 | 79 | (d/refs-match? grans (search/find-refs :granule {"temporal[]" temporal-params |
80 | 80 | :page_size 100})) |
81 | 81 |
|
|
140 | 140 | [(data-umm-cmn/temporal-extent |
141 | 141 | {:beginning-date-time "1970-01-01T00:00:00Z"})]})) |
142 | 142 | gran1 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule1" |
143 | | - :beginning-date-time "2012-01-01T00:00:00Z" |
144 | | - :ending-date-time "2012-01-02T00:00:00Z"})) |
| 143 | + :beginning-date-time "2012-01-01T00:00:00Z" |
| 144 | + :ending-date-time "2012-01-02T00:00:00Z"})) |
145 | 145 | gran2 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule2" |
146 | | - :beginning-date-time "2012-02-14T00:00:00Z" |
147 | | - :ending-date-time "2012-02-18T00:00:00Z"})) |
| 146 | + :beginning-date-time "2012-02-14T00:00:00Z" |
| 147 | + :ending-date-time "2012-02-18T00:00:00Z"})) |
148 | 148 | gran3 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule3" |
149 | | - :beginning-date-time "2012-04-08T00:00:00Z" |
150 | | - :ending-date-time "2012-04-09T00:00:00Z"})) |
| 149 | + :beginning-date-time "2012-04-08T00:00:00Z" |
| 150 | + :ending-date-time "2012-04-09T00:00:00Z"})) |
151 | 151 | gran4 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule4" |
152 | | - :beginning-date-time "2012-04-21T00:00:00Z" |
153 | | - :ending-date-time "2012-04-22T00:00:00Z"})) |
154 | | - gran5 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5" |
155 | | - :beginning-date-time "2012-06-01T00:00:00Z" |
156 | | - :ending-date-time "2012-06-02T00:00:00Z"})) |
| 152 | + :beginning-date-time "2012-04-21T00:00:00Z" |
| 153 | + :ending-date-time "2012-04-22T00:00:00Z"})) |
| 154 | + gran5-1-1 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-1-1" |
| 155 | + :beginning-date-time "2012-05-31T00:00:00Z" |
| 156 | + :ending-date-time "2012-06-01T00:00:00Z"})) |
| 157 | + gran5-1-2 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-1-2" |
| 158 | + :beginning-date-time "2012-06-01T00:00:00Z" |
| 159 | + :ending-date-time "2012-06-02T00:00:00Z"})) |
| 160 | + gran5-2-1 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-2-1" |
| 161 | + :beginning-date-time "2013-05-31T00:00:00Z" |
| 162 | + :ending-date-time "2013-06-01T00:00:00Z"})) |
| 163 | + gran5-2-2 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-2-2" |
| 164 | + :beginning-date-time "2016-06-01T00:00:00Z" |
| 165 | + :ending-date-time "2016-06-02T00:00:00Z"})) |
| 166 | + gran5-3-1 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-3-1" |
| 167 | + :beginning-date-time "2016-05-31T00:00:00Z" |
| 168 | + :ending-date-time "2016-06-01T00:00:00Z"})) |
| 169 | + gran5-3-2 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-3-2" |
| 170 | + :beginning-date-time "2016-06-01T00:00:00Z" |
| 171 | + :ending-date-time "2016-06-02T00:00:00Z"})) |
| 172 | + gran5-4-1 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-4-1" |
| 173 | + :beginning-date-time "2016-02-29T00:00:00Z" |
| 174 | + :ending-date-time "2016-03-01T00:00:00Z"})) |
| 175 | + gran5-4-2 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-4-2" |
| 176 | + :beginning-date-time "2016-03-01T00:00:00Z" |
| 177 | + :ending-date-time "2016-03-02T00:00:00Z"})) |
| 178 | + gran5-4-3 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-4-3" |
| 179 | + :beginning-date-time "2015-02-28T00:00:00Z" |
| 180 | + :ending-date-time "2015-03-01T00:00:00Z"})) |
| 181 | + gran5-4-4 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-4-4" |
| 182 | + :beginning-date-time "2015-03-01T00:00:00Z" |
| 183 | + :ending-date-time "2015-03-02T00:00:00Z"})) |
| 184 | + gran5-4-5 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-4-5" |
| 185 | + :beginning-date-time "2024-02-29T00:00:00Z" |
| 186 | + :ending-date-time "2024-03-01T00:00:00Z"})) |
| 187 | + gran5-4-6 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule5-4-6" |
| 188 | + :beginning-date-time "2024-03-01T00:00:00Z" |
| 189 | + :ending-date-time "2024-03-02T00:00:00Z"})) |
157 | 190 | gran6 (d/ingest "PROV1" (dg/granule-with-umm-spec-collection coll1 (:concept-id coll1) {:granule-ur "Granule6" |
158 | | - :beginning-date-time "2012-12-21T00:00:00Z" |
159 | | - :ending-date-time "2012-12-22T00:00:00Z"}))] |
| 191 | + :beginning-date-time "2012-12-21T00:00:00Z" |
| 192 | + :ending-date-time "2012-12-22T00:00:00Z"}))] |
160 | 193 | (index/wait-until-indexed) |
161 | 194 |
|
162 | 195 | (testing "periodic temporal on the start-year" |
163 | 196 | (testing "start-day before end-day" |
164 | | - (are2 [grans temporal-params] |
| 197 | + (are3 [grans temporal-params] |
165 | 198 | (d/refs-match? grans (search/find-refs :granule {"temporal[]" temporal-params |
166 | 199 | :page_size 100})) |
167 | 200 |
|
|
178 | 211 | "2012-06-15T00:00:00Z, 2015-02-01T00:00:00Z, 90, 120")) |
179 | 212 |
|
180 | 213 | (testing "start-day after end-day" |
181 | | - (are2 [grans temporal-params] |
| 214 | + (are3 [grans temporal-params] |
182 | 215 | (d/refs-match? grans (search/find-refs :granule {"temporal[]" temporal-params |
183 | 216 | :page_size 100})) |
184 | 217 |
|
185 | 218 | "start-date before end-day" |
186 | | - [gran5 gran6] |
| 219 | + [gran5-1-1 gran5-1-2 gran5-2-1 gran6] |
187 | 220 | "2012-02-01T00:00:00Z, 2015-02-01T00:00:00Z, 120, 90" |
188 | 221 |
|
189 | 222 | "start-date between start-day and end-day" |
190 | | - [gran5 gran6] |
| 223 | + [gran5-1-1 gran5-1-2 gran5-2-1 gran6] |
191 | 224 | "2012-04-15T00:00:00Z, 2015-02-01T00:00:00Z, 120, 90" |
192 | 225 |
|
193 | 226 | "start-date after start-day" |
194 | | - [gran6] |
| 227 | + [gran6 gran5-2-1] |
195 | 228 | "2012-06-15T00:00:00Z, 2015-02-01T00:00:00Z, 120, 90"))) |
196 | 229 |
|
197 | 230 | (testing "periodic temporal on the end-year" |
198 | 231 | (testing "start-day before end-day" |
199 | | - (are2 [grans temporal-params] |
| 232 | + (are3 [grans temporal-params] |
200 | 233 | (d/refs-match? grans (search/find-refs :granule {"temporal[]" temporal-params |
201 | 234 | :page_size 100})) |
202 | 235 |
|
|
213 | 246 | "2000-02-01T00:00:00Z, 2012-06-15T00:00:00Z, 90, 120")) |
214 | 247 |
|
215 | 248 | (testing "start-day after end-day" |
216 | | - (are2 [grans temporal-params] |
| 249 | + (are3 [grans temporal-params] |
217 | 250 | (d/refs-match? grans (search/find-refs :granule {"temporal[]" temporal-params |
218 | 251 | :page_size 100})) |
219 | 252 |
|
|
226 | 259 | "2000-02-01T00:00:00Z, 2012-04-15T00:00:00Z, 120, 90" |
227 | 260 |
|
228 | 261 | "end-date after start-day" |
229 | | - [gran1 gran2 gran5] |
| 262 | + [gran1 gran2 gran5-1-1 gran5-1-2] |
230 | 263 | "2000-02-01T00:00:00Z, 2012-06-15T00:00:00Z, 120, 90"))) |
231 | 264 |
|
232 | 265 | (testing "perodic temporal search on a single day" |
233 | | - (are2 [grans temporal-params] |
| 266 | + (are3 [grans temporal-params] |
234 | 267 | (d/refs-match? grans (search/find-refs :granule {"temporal[]" temporal-params |
235 | 268 | :page_size 100})) |
236 | 269 |
|
|
246 | 279 | [gran2] |
247 | 280 | "2000-02-01T00:00:00Z, 2012-04-15T00:00:00Z, 49, 49" |
248 | 281 |
|
| 282 | + "match granule on day on leap year" |
| 283 | + [gran5-1-2 gran5-2-2 gran5-3-2] |
| 284 | + "2012-06-01T00:01:00Z, 2024-06-01T00:02:00Z, 152, 152" |
| 285 | + |
| 286 | + "match granule on day on leap year on Mar 1st" |
| 287 | + [gran5-4-2 gran5-4-4 gran5-4-6] |
| 288 | + "2012-03-01T00:01:00Z, 2024-03-01T00:02:00Z, 60, 60" |
| 289 | + |
249 | 290 | "search by rolling temporal with end-date not intersect the day interval. |
250 | 291 | This is a limitation of rolling temporal parameter search where searching on the end year |
251 | 292 | where end-date not intersect start-day and end-day will not find anything in that year." |
|
0 commit comments