2023-04-14 12:40:34 +00:00
|
|
|
package progress
|
2023-03-29 12:58:09 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/databricks/databricks-sdk-go/service/jobs"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestJobProgressEventString(t *testing.T) {
|
|
|
|
event := &JobProgressEvent{
|
|
|
|
Timestamp: time.Date(0, 0, 0, 0, 0, 0, 0, &time.Location{}),
|
|
|
|
JobId: 123,
|
|
|
|
RunId: 456,
|
|
|
|
RunName: "run_name",
|
|
|
|
State: jobs.RunState{
|
|
|
|
LifeCycleState: jobs.RunLifeCycleStateTerminated,
|
|
|
|
ResultState: jobs.RunResultStateSuccess,
|
|
|
|
StateMessage: "state_message",
|
|
|
|
},
|
|
|
|
}
|
2023-04-18 12:40:45 +00:00
|
|
|
assert.Equal(t, "-0001-11-30 00:00:00 \"run_name\" TERMINATED SUCCESS state_message", event.String())
|
2023-03-29 12:58:09 +00:00
|
|
|
}
|