Sync branch magefile with main #104308
@ -116,7 +116,8 @@ def _store_available_job_types(available_job_types: _AvailableJobTypes) -> None:
|
|||||||
else:
|
else:
|
||||||
# Convert from API response type to list suitable for an EnumProperty.
|
# Convert from API response type to list suitable for an EnumProperty.
|
||||||
_job_type_enum_items = [
|
_job_type_enum_items = [
|
||||||
(job_type.name, job_type.label, "") for job_type in job_types
|
(job_type.name, job_type.label, getattr(job_type, "description", ""))
|
||||||
|
for job_type in job_types
|
||||||
]
|
]
|
||||||
_job_type_enum_items.insert(0, _JOB_TYPE_NOT_SELECTED_ENUM_ITEM)
|
_job_type_enum_items.insert(0, _JOB_TYPE_NOT_SELECTED_ENUM_ITEM)
|
||||||
|
|
||||||
|
@ -442,6 +442,32 @@ func TestGetJobTypeHappy(t *testing.T) {
|
|||||||
assertResponseJSON(t, echoCtx, http.StatusOK, jt)
|
assertResponseJSON(t, echoCtx, http.StatusOK, jt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetJobTypeWithDescriptionHappy(t *testing.T) {
|
||||||
|
mockCtrl := gomock.NewController(t)
|
||||||
|
defer mockCtrl.Finish()
|
||||||
|
mf := newMockedFlamenco(mockCtrl)
|
||||||
|
|
||||||
|
// Get an existing job type with a description.
|
||||||
|
description := "This is a test job type"
|
||||||
|
jt := api.AvailableJobType{
|
||||||
|
Description: &description,
|
||||||
|
Etag: "some etag",
|
||||||
|
Name: "test-job-type",
|
||||||
|
Label: "Test Job Type",
|
||||||
|
Settings: []api.AvailableJobSetting{
|
||||||
|
{Key: "setting", Type: api.AvailableJobSettingTypeString},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
mf.jobCompiler.EXPECT().GetJobType("test-job-type").
|
||||||
|
Return(jt, nil)
|
||||||
|
|
||||||
|
echoCtx := mf.prepareMockedRequest(nil)
|
||||||
|
err := mf.flamenco.GetJobType(echoCtx, "test-job-type")
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
assertResponseJSON(t, echoCtx, http.StatusOK, jt)
|
||||||
|
}
|
||||||
|
|
||||||
func TestGetJobTypeUnknown(t *testing.T) {
|
func TestGetJobTypeUnknown(t *testing.T) {
|
||||||
mockCtrl := gomock.NewController(t)
|
mockCtrl := gomock.NewController(t)
|
||||||
defer mockCtrl.Finish()
|
defer mockCtrl.Finish()
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const JOB_TYPE = {
|
const JOB_TYPE = {
|
||||||
label: "Simple Blender Render",
|
label: "Simple Blender Render",
|
||||||
|
description: "Render a sequence of frames, and create a preview video file",
|
||||||
settings: [
|
settings: [
|
||||||
// Settings for artists to determine:
|
// Settings for artists to determine:
|
||||||
{ key: "frames", type: "string", required: true, eval: "f'{C.scene.frame_start}-{C.scene.frame_end}'",
|
{ key: "frames", type: "string", required: true, eval: "f'{C.scene.frame_start}-{C.scene.frame_end}'",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const JOB_TYPE = {
|
const JOB_TYPE = {
|
||||||
label: "Simple Blender Render",
|
label: "Simple Blender Render",
|
||||||
|
description: "Render a sequence of frames, and create a preview video file",
|
||||||
settings: [
|
settings: [
|
||||||
// Settings for artists to determine:
|
// Settings for artists to determine:
|
||||||
{ key: "frames", type: "string", required: true,
|
{ key: "frames", type: "string", required: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user