feat(workers): worker operational state (#2427)

* feat(workers): worker operational state
This commit is contained in:
Irena Rindos authored and GitHub committed 2022-09-12 16:10:03 -04:00
1 parent f3f0c55d91
commit fc0ead73e6
17 files changed
+696 -166

No files matched your search

+14
View File
@@ -188,4 +188,18 @@ func Test_GetOpts(t *testing.T) {
opts = GetOpts(WithReleaseVersion("version"))
assert.Equal(t, "version", opts.withReleaseVersion)
})
t.Run("WithOperationalState", func(t *testing.T) {
opts := GetOpts(WithOperationalState("test state"))
testOpts := getDefaultOptions()
testOpts.withOperationalState = "test state"
opts.withNewIdFunc = nil
testOpts.withNewIdFunc = nil
assert.Equal(t, opts, testOpts)
})
t.Run("WithExcludeShutdown", func(t *testing.T) {
opts := getDefaultOptions()
assert.Empty(t, opts.withExcludeShutdownWorkers)
opts = GetOpts(WithExcludeShutdownWorkers(true))
assert.Equal(t, true, opts.withExcludeShutdownWorkers)
})
}