Skip to content

Commit e62e78a

Browse files
committed
Add test target for example.
Signed-off-by: Erik Sipsma <[email protected]>
1 parent 226d447 commit e62e78a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

examples/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111
# express or implied. See the License for the specific language governing
1212
# permissions and limitations under the License.
1313

14+
# Set this to pass additional commandline flags to the go compiler, e.g. "make test EXTRAGOARGS=-v"
15+
EXTRAGOARGS?=
16+
17+
SOURCES:=$(shell find . -name '*.go')
1418
GOMOD := $(shell go env GOMOD)
1519
GOSUM := $(GOMOD:.mod=.sum)
20+
DOCKER_IMAGE_TAG?=latest
1621

1722
all: examples
1823

@@ -21,6 +26,19 @@ examples: taskworkflow
2126
taskworkflow: taskworkflow.go $(GOMOD) $(GOSUM)
2227
go build -o taskworkflow taskworkflow.go
2328

29+
test-docker: $(SOURCES) $(GOMOD) $(GOSUM)
30+
docker run --rm \
31+
--privileged \
32+
--ipc=host \
33+
--volume /dev:/dev \
34+
--volume /sys:/sys \
35+
--volume /run/udev/control:/run/udev/control \
36+
--volume $(shell pwd)/logs:/var/log/firecracker-containerd-test \
37+
--workdir="/firecracker-containerd/examples" \
38+
--env EXTRAGOARGS="${EXTRAGOARGS}" \
39+
localhost/firecracker-containerd-e2etest-naive:${DOCKER_IMAGE_TAG} \
40+
"make examples && ./taskworkflow"
41+
2442
clean:
2543
- rm -f taskworkflow
2644

0 commit comments

Comments
 (0)