Files
temporal/chasm/test_var_test.go
Alan Wu 4bc671865a Add singleton registrable task option (#10832)
## What changed?
Add singleton registrable task option

## Why?
Add task registration option to specify as singleton. For singleton
tasks, there are two conflict resolution options if task already exists:
Replace or Ignore. Replace is used for cases where the task info has
updated fields such as something like scheduled_time, or for use cases
like visibility, where only the last task is required, since all
information for execution is in the visibility component. This can
replace any validation logic that checks the "stamp" of the task to
check if it's stale.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [X] covered by existing tests
- [X] added new unit test(s)
- [ ] added new functional test(s)
2026-07-07 15:49:16 -04:00

52 lines
2.7 KiB
Go

package chasm
const (
testLibraryName = "TestLibrary"
testComponentName = "test_component"
testSubComponent1Name = "test_sub_component_1"
testSubComponent11Name = "test_sub_component_11"
testSubComponent2Name = "test_sub_component_2"
testSideEffectTaskName = "test_side_effect_task"
testDiscardableSideEffectTaskName = "test_discardable_side_effect_task"
testOutboundSideEffectTaskName = "test_outbound_side_effect_task"
testPureTaskName = "test_pure_task"
testSingletonReplaceSideEffectTaskName = "test_singleton_replace_side_effect_task"
testSingletonIgnoreSideEffectTaskName = "test_singleton_ignore_side_effect_task"
testSingletonReplacePureTaskName = "test_singleton_replace_pure_task"
testSingletonIgnorePureTaskName = "test_singleton_ignore_pure_task"
)
var (
testComponentFQN = FullyQualifiedName(testLibraryName, testComponentName)
testSubComponent1FQN = FullyQualifiedName(testLibraryName, testSubComponent1Name)
testSubComponent11FQN = FullyQualifiedName(testLibraryName, testSubComponent11Name)
testSubComponent2FQN = FullyQualifiedName(testLibraryName, testSubComponent2Name)
testSideEffectTaskFQN = FullyQualifiedName(testLibraryName, testSideEffectTaskName)
testDiscardableSideEffectTaskFQN = FullyQualifiedName(testLibraryName, testDiscardableSideEffectTaskName)
testOutboundSideEffectTaskFQN = FullyQualifiedName(testLibraryName, testOutboundSideEffectTaskName)
testPureTaskFQN = FullyQualifiedName(testLibraryName, testPureTaskName)
testSingletonReplaceSideEffectTaskFQN = FullyQualifiedName(testLibraryName, testSingletonReplaceSideEffectTaskName)
testSingletonIgnoreSideEffectTaskFQN = FullyQualifiedName(testLibraryName, testSingletonIgnoreSideEffectTaskName)
testSingletonReplacePureTaskFQN = FullyQualifiedName(testLibraryName, testSingletonReplacePureTaskName)
testSingletonIgnorePureTaskFQN = FullyQualifiedName(testLibraryName, testSingletonIgnorePureTaskName)
)
var (
testComponentTypeID = GenerateTypeID(testComponentFQN)
testSubComponent1TypeID = GenerateTypeID(testSubComponent1FQN)
testSubComponent11TypeID = GenerateTypeID(testSubComponent11FQN)
testSubComponent2TypeID = GenerateTypeID(testSubComponent2FQN)
testSideEffectTaskTypeID = GenerateTypeID(testSideEffectTaskFQN)
testDiscardableSideEffectTaskTypeID = GenerateTypeID(testDiscardableSideEffectTaskFQN)
testOutboundSideEffectTaskTypeID = GenerateTypeID(testOutboundSideEffectTaskFQN)
testPureTaskTypeID = GenerateTypeID(testPureTaskFQN)
testSingletonReplaceSideEffectTaskTypeID = GenerateTypeID(testSingletonReplaceSideEffectTaskFQN)
testSingletonReplacePureTaskTypeID = GenerateTypeID(testSingletonReplacePureTaskFQN)
)