Skip to content

Commit

Permalink
update local docker continuous test runner
Browse files Browse the repository at this point in the history
Signed-off-by: Leandro Dorileo <[email protected]>
  • Loading branch information
Leandro Dorileo authored and Leandro Dorileo committed Jan 6, 2020
1 parent d35d26b commit 5ee752d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 33 deletions.
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

FROM clearlinux:latest
ADD dockerrun.sh /dockerrun.sh
RUN swupd update && swupd bundle-add c-basic dev-utils-dev
RUN swupd bundle-add os-core-update-dev c-basic dev-utils-dev
RUN swupd update

CMD ["/dockerrun.sh"]
32 changes: 1 addition & 31 deletions docker/dockerrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,4 @@ fi
# Copy all the files across to prevent contaminating the bind mount
cp -Ra /source/. /build

die_fatal()
{
exit 1
}

die_log_fatal()
{
if [[ -e test-suite.log ]]; then
cat test-suite.log
else
echo "test-suite.log is missing." >&2
fi
exit 1
}

./autogen.sh --enable-coverage || die_fatal

# Build error
make || die_fatal

# Test suite failure, print the log
make check || die_log_fatal

# tarbal issue, just die
make distcheck || die_fatal

# Actually checkable on host, but dump log anyway
make check-valgrind || die_log_fatal

# At this point, we can emit our current coverage to the tty
make coverage
./scripts/run-test-suite.sh || exit 1
3 changes: 2 additions & 1 deletion scripts/continuous.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
DIRN="$(basename $(pwd))"
PROJ_NAME="clr-boot-manager"
PROJ_CI_NAME="docker-ci-${PROJ_NAME}"
FORCE_BUILD=${FORCE_BUILD:-"false"}

# Check docker is available
if ! type docker &>/dev/null; then
Expand All @@ -33,7 +34,7 @@ if [[ "${DIRN}" != "${PROJ_NAME}" ]]; then
fi

# Check that docker-ci image is installed
if ! docker inspect "${PROJ_CI_NAME}" &>/dev/null; then
if ! docker inspect "${PROJ_CI_NAME}" || "$FORCE_BUILD" = "true" &>/dev/null; then
echo "${PROJ_CI_NAME} not installed, building docker image.."
echo "....Please wait, this may take some time."
docker build -t "${PROJ_CI_NAME}" docker/ || exit 1
Expand Down

0 comments on commit 5ee752d

Please sign in to comment.