mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-14 16:46:43 +00:00
refactored tests and added docker build test, repaired state.network
This commit is contained in:
33
packages/docker/tests/container-build-test.ts
Normal file
33
packages/docker/tests/container-build-test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as fs from 'fs'
|
||||
import { containerBuild } from '../src/dockerCommands'
|
||||
import TestSetup from './test-setup'
|
||||
|
||||
let testSetup
|
||||
let runContainerStepDefinition
|
||||
const runContainerStepInputPath = `${__dirname}/../../../examples/run-container-step.json`
|
||||
|
||||
describe('container build', () => {
|
||||
beforeEach(() => {
|
||||
testSetup = new TestSetup()
|
||||
testSetup.initialize()
|
||||
|
||||
let runContainerStepJson = fs.readFileSync(
|
||||
runContainerStepInputPath,
|
||||
'utf8'
|
||||
)
|
||||
runContainerStepDefinition = JSON.parse(runContainerStepJson.toString())
|
||||
runContainerStepDefinition.image = ''
|
||||
const actionPath = testSetup.initializeDockerAction()
|
||||
runContainerStepDefinition.dockerfile = `${actionPath}/Dockerfile`
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
testSetup.teardown()
|
||||
})
|
||||
|
||||
it('should build container', async () => {
|
||||
await expect(
|
||||
containerBuild(runContainerStepDefinition, 'example-test-tag')
|
||||
).resolves.not.toThrow()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user