Skip to content

Commit

Permalink
tests cleanup (#1231)
Browse files Browse the repository at this point in the history
* cleanup tests
  • Loading branch information
Schnitzel authored Sep 8, 2019
1 parent 1d0b539 commit 61904b3
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 30 deletions.
17 changes: 17 additions & 0 deletions tests/tests/bitbucket/skip-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,20 @@
expected_branch: "{{ branch }}"
project: "{{ project }}"
url: "{{ check_url }}"

- name: "{{ testname }} - webhook bitbucket delete push"
hosts: localhost
serial: 1
vars:
git_repo_ssh_url: "{{ lookup('env','WEBHOOK_REPO_PREFIX') }}{{ git_repo_name }}"
tasks:
- include: ../../tasks/webhook-bitbucket/push-delete.yaml

- name: "{{ testname }} - check if site for project does not exist anymore"
hosts: localhost
serial: 1
vars:
url: "http://{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_returncode: 503
tasks:
- include: ../../checks/check-url-returncode.yaml
78 changes: 48 additions & 30 deletions tests/tests/drupal/drush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,51 @@
tasks:
- include: ../../tasks/ssh/ssh-command.yaml

- name: "{{ testname }} - check if {{ project }} is deployed with searching for the hash, nginx route"
hosts: localhost
serial: 1
vars:
url: "http://nginx.{{ project | regex_replace('_', '-') }}.drush-first.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_content: "CHANGED-{{ random_number }}"
tasks:
- include: ../../checks/check-url-content.yaml

- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources"
hosts: localhost
serial: 1
vars:
project: "{{ project }}"
branch: "drush-first"
tasks:
- include: ../../tasks/api/remove.yaml

- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources"
hosts: localhost
serial: 1
vars:
project: "{{ project }}"
branch: "drush-second"
tasks:
- include: ../../tasks/api/remove.yaml

- name: "{{ testname }} - check if site for {{ project }} does not exist anymore"
hosts: localhost
serial: 1
vars:
url: "http://nginx.{{ project | regex_replace('_', '-') }}.drush-first.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_returncode: 503
tasks:
- include: ../../checks/check-url-returncode.yaml

- name: "{{ testname }} - check if site for {{ project }} does not exist anymore"
hosts: localhost
serial: 1
vars:
url: "http://nginx.{{ project | regex_replace('_', '-') }}.drush-second.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_returncode: 503
tasks:
- include: ../../checks/check-url-returncode.yaml

- name: "{{ testname }} third - init git, add files, commit, git push"
hosts: localhost
serial: 1
Expand Down Expand Up @@ -186,47 +231,20 @@
tasks:
- include: ../../tasks/ssh/ssh-command.yaml

- name: "{{ testname }} - check if {{ project }} is deployed with searching for the hash, nginx route"
hosts: localhost
serial: 1
vars:
url: "http://nginx.{{ project | regex_replace('_', '-') }}.drush-first.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_content: "CHANGED-{{ random_number }}"
tasks:
- include: ../../checks/check-url-content.yaml

- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources"
hosts: localhost
serial: 1
vars:
project: "{{ project }}"
branch: "drush-first"
tasks:
- include: ../../tasks/api/remove.yaml

- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources"
hosts: localhost
serial: 1
vars:
project: "{{ project }}"
branch: "drush-second"
branch: "foo/bar"
tasks:
- include: ../../tasks/api/remove.yaml

- name: "{{ testname }} - check if site for {{ project }} does not exist anymore"
hosts: localhost
serial: 1
vars:
url: "http://nginx.{{ project | regex_replace('_', '-') }}.drush-first.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
url: "http://nginx.{{ project | regex_replace('_', '-') }}.foo-bar.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_returncode: 503
tasks:
- include: ../../checks/check-url-returncode.yaml

- name: "{{ testname }} - check if site for {{ project }} does not exist anymore"
hosts: localhost
serial: 1
vars:
url: "http://nginx.{{ project | regex_replace('_', '-') }}.drush-second.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_returncode: 503
tasks:
- include: ../../checks/check-url-returncode.yaml
- include: ../../checks/check-url-returncode.yaml
17 changes: 17 additions & 0 deletions tests/tests/github/skip-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,20 @@
expected_branch: "{{ branch }}"
project: "{{ project }}"
url: "{{ check_url }}"

- name: "{{ testname }} - webhook github delete push"
hosts: localhost
serial: 1
vars:
git_repo_ssh_url: "{{ lookup('env','WEBHOOK_REPO_PREFIX') }}{{ git_repo_name }}"
tasks:
- include: ../../tasks/webhook-github/push-delete.yaml

- name: "{{ testname }} - check if site for project does not exist anymore"
hosts: localhost
serial: 1
vars:
url: "http://{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ lookup('env','OPENSHIFT_ROUTE_SUFFIX') }}"
expected_returncode: 503
tasks:
- include: ../../checks/check-url-returncode.yaml

0 comments on commit 61904b3

Please sign in to comment.