Skip to content

Commit f81fff4

Browse files
committed
set version
1 parent 63e2c78 commit f81fff4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

dbos/workflows_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,3 +2993,33 @@ func TestConcurrentWorkflows(t *testing.T) {
29932993
}
29942994
})
29952995
}
2996+
2997+
func TestWorkflowAtVersion(t *testing.T) {
2998+
dbosCtx := setupDBOS(t, true, true)
2999+
3000+
RegisterWorkflow(dbosCtx, simpleWorkflow)
3001+
3002+
version := "test-app-version-12345"
3003+
handle, err := RunAsWorkflow(dbosCtx, simpleWorkflow, "input", WithApplicationVersion(version))
3004+
if err != nil {
3005+
t.Fatalf("failed to start workflow: %v", err)
3006+
}
3007+
3008+
_, err = handle.GetResult()
3009+
if err != nil {
3010+
t.Fatalf("failed to get workflow result: %v", err)
3011+
}
3012+
3013+
retrieved, err := RetrieveWorkflow[string](dbosCtx, handle.GetWorkflowID())
3014+
if err != nil {
3015+
t.Fatalf("failed to retrieve workflow: %v", err)
3016+
}
3017+
3018+
status, err := retrieved.GetStatus()
3019+
if err != nil {
3020+
t.Fatalf("failed to get workflow status: %v", err)
3021+
}
3022+
if status.ApplicationVersion != version {
3023+
t.Fatalf("expected application version %q, got %q", version, status.ApplicationVersion)
3024+
}
3025+
}

0 commit comments

Comments
 (0)