Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium molecule tests #52

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
skip_list:
- formatting
- command-shell
- idiom
- metadata
29 changes: 17 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
---
language: python
services: docker

env:
- distro: centos7
- distro: centos6
- distro: ubuntu1604
- distro: debian8
- distro: ubuntu1404
- distro: ubuntu1204
global:
- ROLE_NAME: selenium
matrix:
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: ubuntu1804

script:
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
- chmod +x ${PWD}/tests/test.sh
install:
# Install test dependencies.
- pip install molecule docker

before_script:
# Use actual Ansible Galaxy role name for the project directory.
- cd ../
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
- cd geerlingguy.$ROLE_NAME

script:
# Run tests.
- ${PWD}/tests/test.sh
- molecule test

notifications:
email: false
webhooks: https://galaxy.ansible.com/api/v1/notifications/
22 changes: 11 additions & 11 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ galaxy_info:
license: Apache V2
min_ansible_version: 2.0
platforms:
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
- name: EL
versions:
- 6
- 7
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
categories:
- web
- web
dependencies: []
29 changes: 29 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
options:
config-file: molecule/default/yaml-lint.yml
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
21 changes: 21 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Converge
hosts: all
become: true

pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=3600
when: ansible_os_family == 'Debian'

- name: Don't install Chrome on old OSes.
set_fact:
selenium_install_firefox: yes
selenium_install_chrome: no
when: >
(ansible_distribution == 'Ubuntu' and ansible_distribution_version == '12.04')
or (ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0] == '6')

roles:
- geerlingguy.java
- geerlingguy.selenium
2 changes: 2 additions & 0 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
- geerlingguy.java
8 changes: 8 additions & 0 deletions molecule/default/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default
rules:
line-length:
max: 180
level: warning
truthy:
allowed-values: ["yes", "no", 'true', 'false']
11 changes: 0 additions & 11 deletions tests/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions tests/requirements.yml

This file was deleted.

20 changes: 0 additions & 20 deletions tests/test.yml

This file was deleted.