Skip to content

Commit

Permalink
testing: cleanup and speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
martbhell committed Jan 5, 2017
1 parent 84bf90e commit c3d9f57
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 48 deletions.
44 changes: 0 additions & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,61 +34,17 @@ script:
- docker run --privileged -d -ti -e "container=docker" -v `pwd`:/$ROLETOTEST -v /sys/fs/cgroup:/sys/fs/cgroup ${REPO}:${IMAGE_BUILD_PLATFORM} /usr/sbin/init
- DOCKER_CONTAINER_ID=$(docker ps | grep ${IMAGE_BUILD_PLATFORM} | awk '{print $1}')
- docker logs $DOCKER_CONTAINER_ID
# Prepare test environment and print some more debug out
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'sudo yum -y install make && mkdir -p /opt/ansible/'
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'if ! [ -d /opt/ansible/ansible ] || ! bash -c "cd /opt/ansible/ansible && git branch"; then git clone http://github.com/ansible/ansible.git /opt/ansible/ansible ; fi'
- >
export ANSIBLE_VERSION=$(docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'cd /opt/ansible/ansible && \
ansible-playbook --version | perl -n -e '\''if ( m/^ansible-playbook\s+([0-9\.]{1,7})/ ) { print $1 }'\'' | tr -d "\n" \
')
- >
export GIT_COMMIT=$(docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'cd /opt/ansible/ansible && \
ansible-playbook --version | perl -n -e '\''if ( m/^ansible-playbook\s+[0-9\.]{1,7}\s+.*?([a-fA-F0-9]{7,40})/ ) { print $1 }'\'' | tr -d "\n" \
')
- >
export GIT_TAG=$(docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c "cd /opt/ansible/ansible && \
git tag | grep $ANSIBLE_VERSION | grep -v rc | tr -d '\n' \
")
- >
echo "Ansible Version: $ANSIBLE_VERSION"
- >
echo "git SHA: $GIT_COMMIT"
- >
echo "Tagged Release?: $GIT_TAG"
- >
echo "CHECKING OUT: ${GIT_COMMIT:-$GIT_TAG}"
- >
docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c "cd /opt/ansible/ansible &&
git checkout ${GIT_COMMIT:-$GIT_TAG} && git submodule update --init --recursive &&
git --no-pager log --decorate=short --pretty=oneline -n 1"
- >
docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'cd /opt/ansible/ansible &&
sudo pip install tox sphinx &&
sudo pip install paramiko PyYAML jinja2 httplib2 passlib nose mock '
# Testing of this ansible-role:
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c "/$ROLETOTEST/tests/test-in-docker-image.sh"
# - docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'cd /opt/ansible/ansible && make tests '
# - >
# docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'cd /opt/ansible/ansible/test/integration/ &&
# make -j 1 parsing test_var_precedence test_templating_settings includes test_hash test_handlers test_group_by '
- >
docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'echo -ne "------\nEND ANSIBLE TESTS\n------\nSystemD Units:\n------\n";
systemctl --no-pager --all --full status ;
echo -ne "------\nJournalD Logs:\n------\n" ;
sudo journalctl --catalog --all --full --no-pager'
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'sudo yum -y install tree'
- docker exec -ti $DOCKER_CONTAINER_ID /bin/sh -c 'tree /ansible*'
- docker ps -a
- docker stop $DOCKER_CONTAINER_ID
- docker rm -v $DOCKER_CONTAINER_ID
#after_success:
# - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
# - if [ "$TRAVIS_BRANCH" == "master" -a "$IMAGE_BUILD_PLATFORM" == "stable-centos7" ]; then docker tag ${REPO}:${IMAGE_BUILD_PLATFORM} $REPO:latest; fi
# - docker tag ${REPO}:${IMAGE_BUILD_PLATFORM} $REPO:travis-${TRAVIS_BUILD_NUMBER}
# - docker tag ${REPO}:${IMAGE_BUILD_PLATFORM} $REPO:${IMAGE_BUILD_PLATFORM}-${ANSIBLE_VERSION}
# - docker tag ${REPO}:${IMAGE_BUILD_PLATFORM} $REPO:${IMAGE_BUILD_PLATFORM}-${GIT_COMMIT:-$GIT_TAG}
# - docker push $REPO
# - "[ -e \"~/.docker/config.json\" ] && shred -n 30 -u -z ~/.docker/config.json"

notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion tests/devel-centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN yum clean all && \
yum -y remove $(rpm -qa "*-devel") && \
yum -y groupremove "Development tools" && \
yum -y autoremove && \
yum -y install bzip2 file findutils gem git gzip hg procps-ng svn sudo tar which unzip xz zip && \
yum -y install bzip2 crontabs file findutils gem git gzip hg procps-ng svn sudo tar tree which unzip xz zip && \
yum clean all && rm -rf /var/cache/yum

RUN mkdir /etc/ansible/
Expand Down
2 changes: 1 addition & 1 deletion tests/epel-centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yum clean all && \
yum -y remove $(rpm -qa "*-devel") && \
yum -y groupremove "Development tools" && \
yum -y autoremove && \
yum -y install bzip2 file findutils gem git gzip hg procps-ng svn sudo tar which unzip xz zip
yum -y install bzip2 crontabs file findutils gem git gzip hg procps-ng svn sudo tar tree which unzip xz zip

RUN mkdir /etc/ansible/
RUN echo -e '[local]\nlocalhost' > /etc/ansible/hosts
Expand Down
2 changes: 1 addition & 1 deletion tests/stable-centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yum clean all && \
yum -y remove $(rpm -qa "*-devel") && \
yum -y groupremove "Development tools" && \
yum -y autoremove && \
yum -y install bzip2 file findutils gem git gzip hg procps-ng svn sudo tar which unzip xz zip
yum -y install bzip2 crontabs file findutils gem git gzip hg procps-ng svn sudo tar tree which unzip xz zip

RUN mkdir /etc/ansible/
RUN echo -e '[local]\nlocalhost' > /etc/ansible/hosts
Expand Down
2 changes: 1 addition & 1 deletion tests/test-in-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function extra_tests(){

set -e
function main(){
install_os_deps
# install_os_deps
# install_ansible_devel
show_version
tree_list
Expand Down

0 comments on commit c3d9f57

Please sign in to comment.