Add Description to Job Types #104268

Manually merged
Sybren A. Stüvel merged 10 commits from Taylor-Wiebe/flamenco:job-description into main 2024-04-04 11:16:11 +02:00
Showing only changes of commit c4b0d4a35f - Show all commits

View File

@ -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()