-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: some cleanup application manager
Signed-off-by: axel7083 <[email protected]>
- Loading branch information
Showing
7 changed files
with
139 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { expect, test } from 'vitest'; | ||
import type { Recipe } from '@shared/src/models/IRecipe'; | ||
import type { ContainerConfig } from '../models/AIConfig'; | ||
import { getImageTag } from './imagesUtils'; | ||
|
||
test('return recipe-container tag if container image prop is not defined', () => { | ||
const recipe = { | ||
id: 'recipe1', | ||
} as Recipe; | ||
const container = { | ||
name: 'name', | ||
} as ContainerConfig; | ||
const imageTag = getImageTag(recipe, container); | ||
expect(imageTag).equals('recipe1-name:latest'); | ||
}); | ||
test('return container image prop is defined', () => { | ||
const recipe = { | ||
id: 'recipe1', | ||
} as Recipe; | ||
const container = { | ||
name: 'name', | ||
image: 'quay.io/repo/image:v1', | ||
} as ContainerConfig; | ||
const imageTag = getImageTag(recipe, container); | ||
expect(imageTag).equals('quay.io/repo/image:v1'); | ||
}); | ||
test('append latest tag to container image prop if it has no tag', () => { | ||
const recipe = { | ||
id: 'recipe1', | ||
} as Recipe; | ||
const container = { | ||
name: 'name', | ||
image: 'quay.io/repo/image', | ||
} as ContainerConfig; | ||
const imageTag = getImageTag(recipe, container); | ||
expect(imageTag).equals('quay.io/repo/image:latest'); | ||
}); |
Oops, something went wrong.