Skip to content

Commit

Permalink
OCDEV e2e tests
Browse files Browse the repository at this point in the history
* Pushing this to get some initial feedback on the structure \
  of the test cases.

* The tests are writting using ginkgo so that it is easier to \
  manage the tests going forward

* We aren't adhering to the standard requirements of BDD, but \
  mapping usecases in ginkgo seems covenient

* For starters, we have picked up Usecase redhat-developer#5
  • Loading branch information
ashetty1 committed Mar 15, 2018
1 parent d54a264 commit 8045cd7
Show file tree
Hide file tree
Showing 215 changed files with 191,657 additions and 51 deletions.
111 changes: 61 additions & 50 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@ jobs:
- make validate
- make test-coverage
after_success:
# submit coverage.txt to codecov.io
# submit coverage.txt to codecov.io
- bash <(curl -s https://codecov.io/bash)


- <<: *base-test
stage: test
go: 1.9
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp ocdev /usr/bin
- make test-e2e

# test installation script on linux
- stage: test
services:
Expand All @@ -47,52 +57,53 @@ jobs:
script:
./scripts/install.sh

- stage: deploy
go_import_path: github.com/redhat-developer/ocdev
go: 1.9
install:
- make goget-tools
- gem install fpm
- sudo apt-get -qq update
- sudo apt-get install -y rpm
# Ideally following commands should be in before_deploy section
# but travis-ci runs before_deploy for every provider. We don't want that.
- make prepare-release
- ./scripts/generate-bintray-json.sh
- make packages
script: skip
deploy:
# upload binaries to bintray
- provider: bintray
repo: ocdev/ocdev
file: ./.bintray.json
user: $BINTRAY_USER
key: $BINTRAY_KEY
skip_cleanup: true
on:
on: master
# upload gziped binaries to github release page
- provider: releases
api_key:
secure: GGP7Kk+ZjhwwOTOgY4/TufeZ82Xh6SQDJkUlig6qzOCd01Rh80waWz5X0MzNgf2UotjeiVpgFbhZ3DOeUDwkRxa+/MmmiX+gxgeS+tb5YnhnFzH0Q/13DYFF+RQQrr8jmFs7d4dm56L3U3gW4qFwyHgn9Fy5Aqsd4R4RmObV4sVtxh1Z4g4px1hJNiaKFd7T9ChFPS/fuSz75ThrSQjG4rJFWW5Sb6BPmEOkwMCGAc+b24oEZngq8HMDknuKLU1UTSOef9T9yo65M4uVVMI1RkmbmazObkd6216L7XlIvZrLhINIy3Jl7RCtT2JLgKEmHQ9582WIenRIm4PerlMn6sDHmfb+oYW2JMXhgYEOBzXk0K/RmiRGc8tCpSfEpB5qe6z28+l8SvirX9plBqZytG0EwXUVEt7qwSOlLtfrT/4tJCVpmmXDoJR/TtDrHe2HqsBTBQJpYDrOemqmEAcDDMFVG+yZq4iO+Z1jTdEqUMXUE+0UYl22//Y3+xGzvS+JEIzwU/VI2Sg+zDlTvkogQBl7IQqNl/ttXgLcRl0V/E2PpJR/gJUlEyYImKI3Gh4pV5cY7IRuT17fytp249KyK/q3mkE85/yKWPZc/fGVgqbqL7pdHTuVg/woDv46kK1VFC2lDB9Ll5yWrMGI6U/kxO8bzPa88PE0Z4i4yMoRRLo=
draft: true
prerelease: true
file_glob: true
file: "./dist/release/*"
skip_cleanup: true
on:
tags: true
repo: redhat-developer/ocdev
# upload packages to bintray repositories
- provider: script
skip_cleanup: true
script:
- make upload-packages
on:
tags: true
- provider: script
skip_cleanup: true
script:
- make upload-packages
on:
branch: master

# - stage: deploy
# go_import_path: github.com/redhat-developer/ocdev
# go: 1.9
# install:
# - make goget-tools
# - gem install fpm
# - sudo apt-get -qq update
# - sudo apt-get install -y rpm
# # Ideally following commands should be in before_deploy section
# # but travis-ci runs before_deploy for every provider. We don't want that.
# - make prepare-release
# - ./scripts/generate-bintray-json.sh
# - make packages
# script: skip
# deploy:
# # upload binaries to bintray
# - provider: bintray
# repo: ocdev/ocdev
# file: ./.bintray.json
# user: $BINTRAY_USER
# key: $BINTRAY_KEY
# skip_cleanup: true
# on:
# on: master
# # upload gziped binaries to github release page
# - provider: releases
# api_key:
# secure: GGP7Kk+ZjhwwOTOgY4/TufeZ82Xh6SQDJkUlig6qzOCd01Rh80waWz5X0MzNgf2UotjeiVpgFbhZ3DOeUDwkRxa+/MmmiX+gxgeS+tb5YnhnFzH0Q/13DYFF+RQQrr8jmFs7d4dm56L3U3gW4qFwyHgn9Fy5Aqsd4R4RmObV4sVtxh1Z4g4px1hJNiaKFd7T9ChFPS/fuSz75ThrSQjG4rJFWW5Sb6BPmEOkwMCGAc+b24oEZngq8HMDknuKLU1UTSOef9T9yo65M4uVVMI1RkmbmazObkd6216L7XlIvZrLhINIy3Jl7RCtT2JLgKEmHQ9582WIenRIm4PerlMn6sDHmfb+oYW2JMXhgYEOBzXk0K/RmiRGc8tCpSfEpB5qe6z28+l8SvirX9plBqZytG0EwXUVEt7qwSOlLtfrT/4tJCVpmmXDoJR/TtDrHe2HqsBTBQJpYDrOemqmEAcDDMFVG+yZq4iO+Z1jTdEqUMXUE+0UYl22//Y3+xGzvS+JEIzwU/VI2Sg+zDlTvkogQBl7IQqNl/ttXgLcRl0V/E2PpJR/gJUlEyYImKI3Gh4pV5cY7IRuT17fytp249KyK/q3mkE85/yKWPZc/fGVgqbqL7pdHTuVg/woDv46kK1VFC2lDB9Ll5yWrMGI6U/kxO8bzPa88PE0Z4i4yMoRRLo=
# draft: true
# prerelease: true
# file_glob: true
# file: "./dist/release/*"
# skip_cleanup: true
# on:
# tags: true
# repo: redhat-developer/ocdev
# # upload packages to bintray repositories
# - provider: script
# skip_cleanup: true
# script:
# - make upload-packages
# on:
# tags: true
# - provider: script
# skip_cleanup: true
# script:
# - make upload-packages
# on:
# branch: master
80 changes: 79 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ prepare-release: cross
test:
go test -race $(PKGS)


.PHONY: test-e2e
test-e2e:
go test -v github.com/redhat-developer/ocdev/tests/e2e

# create deb and rpm packages using fpm in ./dist/pkgs/
# run make cross before this!
.PHONY: packages
Expand Down
18 changes: 18 additions & 0 deletions scripts/oc-cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Config
oc_bin_source='https://github.com/openshift/origin/releases/download/v3.7.1/openshift-origin-client-tools-v3.7.1-ab0f056-linux-64bit.tar.gz'

wget $oc_bin_source -O /tmp/oc.tar.gz 2> /dev/null > /dev/null
mkdir /tmp/ocdir && cd /tmp/ocdir && tar -xvvf /tmp/oc.tar.gz > /dev/null
sudo mv /tmp/ocdir/*/oc /usr/bin/
tmp=`mktemp`
echo 'DOCKER_OPTS="$DOCKER_OPTS --insecure-registry 172.30.0.0/16"' > ${tmp}
sudo mv ${tmp} /etc/default/docker

sudo mount --make-shared /

sudo service docker restart


oc cluster up
Loading

0 comments on commit 8045cd7

Please sign in to comment.