visibility_persistence_suite.go ×1

Frontier kind: Code frontier

unlabeled · c_855b36708dee

5 tests · 4448 LOC · 190 files · introduces 0 tests · 68 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
1 range68 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
830 ranges4448 lines · 190 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 68 introduced LOC across 1 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/tests/visibility_persistence_suite.go 68 introduced LOC · 1 range

Open complete file

387
388 // TestFilteringByStartTime test
389 > func (s *VisibilityPersistenceSuite) TestFilteringByStartTime() { visibility_persistence_suite.go
390 > testNamespaceUUID := namespace.ID(uuid.NewString())
391 > startTime := time.Now()
392 >
393 > // Create 2 open workflows, one started 2hrs ago, the other started just now.
394 > openRecord1 := s.createOpenWorkflowRecord(
395 > testNamespaceUUID,
396 > "visibility-filtering-test1",
397 > "visibility-workflow-1",
398 > startTime.Add(-2*time.Hour),
399 > startTime.Add(-2*time.Hour),
400 > "test-queue",
401 > )
402 > openRecord2 := s.createOpenWorkflowRecord(
403 > testNamespaceUUID,
404 > "visibility-filtering-test2",
405 > "visibility-workflow-2",
406 > startTime,
407 > startTime,
408 > "test-queue",
409 > )
410 >
411 > // List open workflows with start time filter
412 > resp, err := s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{
413 > NamespaceID: testNamespaceUUID,
414 > PageSize: 2,
415 > Query: fmt.Sprintf("%s >= '%s' AND %s <= '%s' AND %s = '%s'",
416 > sadefs.StartTime,
417 > time.Now().Add(-time.Hour).Format(time.RFC3339Nano),
418 > sadefs.StartTime,
419 > time.Now().Format(time.RFC3339Nano),
420 > sadefs.ExecutionStatus,
421 > enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
422 > ),
423 > })
424 > s.NoError(err)
425 > s.Len(resp.Executions, 1)
426 > s.assertOpenExecutionEquals(openRecord2, resp.Executions[0])
427 >
428 > // List with WorkflowType filter in query string
429 > queryStr := fmt.Sprintf(`StartTime BETWEEN "%v" AND "%v"`, time.Now().Add(-time.Hour).Format(time.RFC3339Nano), time.Now().Format(time.RFC3339Nano))
430 > resp, err = s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{
431 > NamespaceID: testNamespaceUUID,
432 > PageSize: 2,
433 > Query: queryStr,
434 > })
435 > s.NoError(err)
436 > s.Len(resp.Executions, 1)
437 > s.assertOpenExecutionEquals(openRecord2, resp.Executions[0])
438 >
439 > queryStr = fmt.Sprintf(`StartTime BETWEEN "%v" AND "%v"`, time.Now().Add(-3*time.Hour).Format(time.RFC3339Nano), time.Now().Format(time.RFC3339Nano))
440 > resp, err = s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{
441 > NamespaceID: testNamespaceUUID,
442 > PageSize: 2,
443 > Query: queryStr,
444 > })
445 > s.NoError(err)
446 > s.Len(resp.Executions, 2)
447 >
448 > resp, err = s.VisibilityMgr.ListWorkflowExecutions(s.ctx, &manager.ListWorkflowExecutionsRequestV2{
449 > NamespaceID: testNamespaceUUID,
450 > PageSize: 2,
451 > Query: queryStr + ` AND WorkflowType = "visibility-workflow-1"`,
452 > })
453 > s.NoError(err)
454 > s.Len(resp.Executions, 1)
455 > s.assertOpenExecutionEquals(openRecord1, resp.Executions[0])
456 > }
457
458 // TestFilteringByType test