mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-15 09:16:44 +00:00
Adding more tests and minor changes in code (#21)
* added cleanup job checks, started testing constants file * added getVolumeClaimName test * added write entrypoint tests * added tests around k8s utils * fixed new regexp * added tests around runner instance label * 100% test coverage of constants
This commit is contained in:
@@ -39,8 +39,8 @@ export function getSecretName(): string {
|
||||
)}-secret-${uuidv4().substring(0, STEP_POD_NAME_SUFFIX_LENGTH)}`
|
||||
}
|
||||
|
||||
const MAX_POD_NAME_LENGTH = 63
|
||||
const STEP_POD_NAME_SUFFIX_LENGTH = 8
|
||||
export const MAX_POD_NAME_LENGTH = 63
|
||||
export const STEP_POD_NAME_SUFFIX_LENGTH = 8
|
||||
export const JOB_CONTAINER_NAME = 'job'
|
||||
|
||||
export class RunnerInstanceLabel {
|
||||
|
||||
@@ -20,18 +20,18 @@ export function containerVolumes(
|
||||
}
|
||||
]
|
||||
|
||||
const workspacePath = process.env.GITHUB_WORKSPACE as string
|
||||
if (containerAction) {
|
||||
const workspace = process.env.GITHUB_WORKSPACE as string
|
||||
mounts.push(
|
||||
{
|
||||
name: POD_VOLUME_NAME,
|
||||
mountPath: '/github/workspace',
|
||||
subPath: workspace.substring(workspace.indexOf('work/') + 1)
|
||||
subPath: workspacePath.substring(workspacePath.indexOf('work/') + 1)
|
||||
},
|
||||
{
|
||||
name: POD_VOLUME_NAME,
|
||||
mountPath: '/github/file_commands',
|
||||
subPath: workspace.substring(workspace.indexOf('work/') + 1)
|
||||
subPath: workspacePath.substring(workspacePath.indexOf('work/') + 1)
|
||||
}
|
||||
)
|
||||
return mounts
|
||||
@@ -63,7 +63,6 @@ export function containerVolumes(
|
||||
return mounts
|
||||
}
|
||||
|
||||
const workspacePath = process.env.GITHUB_WORKSPACE as string
|
||||
for (const userVolume of userMountVolumes) {
|
||||
let sourceVolumePath = ''
|
||||
if (path.isAbsolute(userVolume.sourceVolumePath)) {
|
||||
|
||||
Reference in New Issue
Block a user