Merge pull request #34 from vrothberg/farts
Add BATS_OPTS and fix test flakes
This commit is contained in:
commit
f6d650996c
3 changed files with 10 additions and 6 deletions
6
Makefile
6
Makefile
|
@ -1,6 +1,7 @@
|
||||||
SRC := ./BuildSourceImage.sh
|
SRC := ./BuildSourceImage.sh
|
||||||
CTR_IMAGE := localhost/containers/buildsourceimage
|
CTR_IMAGE := localhost/containers/buildsourceimage
|
||||||
CTR_ENGINE ?= podman
|
CTR_ENGINE ?= podman
|
||||||
|
BATS_OPTS ?=
|
||||||
cleanfiles =
|
cleanfiles =
|
||||||
# these are packages whose src.rpms are very small
|
# these are packages whose src.rpms are very small
|
||||||
srpm_urls = \
|
srpm_urls = \
|
||||||
|
@ -9,6 +10,9 @@ srpm_urls = \
|
||||||
https://archive.kernel.org/centos-vault/7.0.1406/os/Source/SPackages/centos-bookmarks-7-1.el7.src.rpm
|
https://archive.kernel.org/centos-vault/7.0.1406/os/Source/SPackages/centos-bookmarks-7-1.el7.src.rpm
|
||||||
srpms = $(addprefix ./.testprep/srpms/,$(notdir $(rpms)))
|
srpms = $(addprefix ./.testprep/srpms/,$(notdir $(rpms)))
|
||||||
|
|
||||||
|
export CTR_IMAGE
|
||||||
|
export CTR_ENGINE
|
||||||
|
|
||||||
all: validate
|
all: validate
|
||||||
|
|
||||||
validate: .validate
|
validate: .validate
|
||||||
|
@ -35,7 +39,7 @@ cleanfiles += .testprep $(srpms)
|
||||||
test-integration: .build-container .testprep
|
test-integration: .build-container .testprep
|
||||||
@echo
|
@echo
|
||||||
@echo "==> Running integration tests"
|
@echo "==> Running integration tests"
|
||||||
CTR_IMAGE=$(CTR_IMAGE) CTR_ENGINE=$(CTR_ENGINE) TMPDIR=$(shell realpath .testprep/tmp) bats test/
|
TMPDIR=$(shell realpath .testprep/tmp) bats $(BATS_OPTS) test/
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -7,7 +7,7 @@ load helpers
|
||||||
d=$(mktemp -d)
|
d=$(mktemp -d)
|
||||||
echo "temporary directory: ${d}"
|
echo "temporary directory: ${d}"
|
||||||
|
|
||||||
run_ctr -v $(pwd)/.testprep/srpms/:/src:ro -v ${d}:/output/ $CTR_IMAGE -s /src
|
run_ctr -v $(pwd)/.testprep/srpms/:/src:ro --mount type=bind,source=${d},destination=/output $CTR_IMAGE -s /src
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ ${lines[0]} =~ "[SrcImg][INFO] calling source collection drivers" ]]
|
[[ ${lines[0]} =~ "[SrcImg][INFO] calling source collection drivers" ]]
|
||||||
# get the number of the last line
|
# get the number of the last line
|
||||||
|
@ -32,7 +32,7 @@ load helpers
|
||||||
d=$(mktemp -d)
|
d=$(mktemp -d)
|
||||||
echo "temporary directory: ${d}"
|
echo "temporary directory: ${d}"
|
||||||
|
|
||||||
run_ctr -v $(pwd)/.testprep/srpms/:/src:ro -v ${d}:/output/ $CTR_IMAGE -s /src -p oci:/output/pushed-image:latest-source
|
run_ctr -v $(pwd)/.testprep/srpms/:/src:ro --mount type=bind,source=${d},destination=/output $CTR_IMAGE -s /src -p oci:/output/pushed-image:latest-source
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
run ls ${d}/pushed-image
|
run ls ${d}/pushed-image
|
||||||
|
|
|
@ -8,7 +8,7 @@ load helpers
|
||||||
echo "temporary directory: ${d}"
|
echo "temporary directory: ${d}"
|
||||||
|
|
||||||
ref="registry.fedoraproject.org/fedora-minimal"
|
ref="registry.fedoraproject.org/fedora-minimal"
|
||||||
run_ctr -v ${d}:/output/ $CTR_IMAGE -i "${ref}"
|
run_ctr --mount type=bind,source=${d},destination=/output $CTR_IMAGE -i "${ref}"
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
#echo ${lines[@]}
|
#echo ${lines[@]}
|
||||||
[[ ${lines[0]} =~ "Getting image source signatures" ]]
|
[[ ${lines[0]} =~ "Getting image source signatures" ]]
|
||||||
|
|
Loading…
Reference in a new issue