From 54c0a520d435c86e53f0870f9eb71e0e46d05da0 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth Date: Sat, 29 Jun 2019 17:55:03 -0400 Subject: [PATCH 01/83] test using compose --- .circleci/config.yml | 58 ++++ .gitignore | 3 + .idea/misc.xml | 7 - .idea/modules.xml | 8 - .idea/sc4s.iml | 13 - .idea/vcs.xml | 9 - .idea/workspace.xml | 612 ------------------------------------------- docker-compose.yml | 10 + test-with-compose.sh | 26 ++ tests/Dockerfile | 6 +- 10 files changed, 101 insertions(+), 651 deletions(-) delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/sc4s.iml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml create mode 100755 test-with-compose.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index a616137..b182848 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,6 +60,60 @@ cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml - store_test_results: path: test-results + test: + docker: + - image: circleci/buildpack-deps:stretch + steps: + - setup_remote_docker: + docker_layer_caching: true + - checkout + - run: + name: Docker Login + command: docker login -u $DOCKER_USER -p $DOCKER_PASS + - run: + name: Docker pull + command: docker pull $IMAGE_NAME:$CIRCLE_SHA1 + - run: + name: Setup test volume + command: | + mkdir test-results + docker volume create sc4s-tests + docker volume create sc4s-results + + docker container create --name dummy \ + -v sc4s-tests:/work/tests \ + -v sc4s-results:/work/test-results \ + registry.access.redhat.com/ubi7/ubi + docker cp tests/ dummy:/work/tests/ + docker rm dummy + - run: + name: Docker Compose build + command: | + docker-compose build \ + --build-arg RH_ACTIVATION=$RH_ACTIVATION \ + --build-arg RH_ORG=$RH_ORG + - run: + name: Docker Compose up + command: docker-compose up --abort-on-container-exit + - run: + name: Collect test results from Docker Compose + command: | + docker container create --name dummy \ + -v sc4s-tests:/work/tests \ + -v sc4s-results:/work/test-results \ + registry.access.redhat.com/ubi7/ubi + + docker cp dummy:/work/test-results/functional test-results + docker rm dummy + - run: + name: Cleanup volumes + command: | + docker volume rm sc4s-tests + docker volume rm sc4s-results + - store_test_results: + path: test-results + + publish: environment: IMAGE_NAME: rfaircloth/scs @@ -91,9 +145,13 @@ - dgoss: requires: - build + - test: + - requires: + - build - publish: requires: - dgoss + - test filters: branches: only: diff --git a/.gitignore b/.gitignore index 527731f..d3efeb9 100644 --- a/.gitignore +++ b/.gitignore @@ -305,3 +305,6 @@ tags # Persistent undo [._]*.un~ +/.env +/test-results +/.idea \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3f7f406..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index aa62d56..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/sc4s.iml b/.idea/sc4s.iml deleted file mode 100644 index 251be75..0000000 --- a/.idea/sc4s.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 53b20c8..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 44b7535..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pip - yum - java - goss.y - goss - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -