Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from ssbarnea/master
Browse files Browse the repository at this point in the history
Migrated from Travis CI to Zuul CI

Reviewed-by: https://github.com/apps/ansible-zuul
  • Loading branch information
ansible-zuul[bot] authored Mar 16, 2020
2 parents 393d36a + f68d99e commit c395601
Show file tree
Hide file tree
Showing 23 changed files with 154 additions and 161 deletions.
70 changes: 50 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
---
default_language_version:
python: python3
minimum_pre_commit_version: "1.14.0"
repos:
- repo: https://github.com/PyCQA/doc8.git
rev: 0.8.1rc1
hooks:
- id: doc8
- repo: https://github.com/python/black.git
rev: 19.3b0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v2.2.3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -19,21 +13,28 @@ repos:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
exclude: "cookiecutter.*"
# https://github.com/pre-commit/pre-commit-hooks/issues/273
args: ["--unsafe"]
- repo: https://github.com/PyCQA/doc8.git
rev: 0.8.1rc3
hooks:
- id: doc8
- repo: https://github.com/python/black.git
rev: 19.10b0
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.7.8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies:
- flake8-black
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.16.0
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/codespell-project/codespell.git
rev: v1.15.0
rev: v1.16.0
hooks:
- id: codespell
name: codespell
Expand All @@ -44,3 +45,32 @@ repos:
args: []
require_serial: false
additional_dependencies: []
- repo: https://github.com/PyCQA/flake8.git
rev: 3.7.9
hooks:
- id: flake8
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.20.0
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict -f parsable
- repo: https://github.com/openstack-dev/bashate.git
rev: 1.0.0
hooks:
- id: bashate
entry: bashate --error . --ignore=E006,E040
# Run bashate check for all bash scripts
# Ignores the following rules:
# E006: Line longer than 79 columns (as many scripts use jinja
# templating, this is very difficult)
# E040: Syntax error determined using `bash -n` (as many scripts
# use jinja templating, this will often fail and the syntax
# error will be discovered in execution anyway)
- repo: https://github.com/ansible/ansible-lint.git
rev: v4.2.0
hooks:
- id: ansible-lint
always_run: true
pass_filenames: false
73 changes: 0 additions & 73 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ Molecule Azure Plugin
:target: https://badge.fury.io/py/molecule-azure
:alt: PyPI Package

.. image:: https://img.shields.io/travis/com/pycontribs/molecule-azure/master.svg?label=Linux%20builds%20%40%20Travis%20CI
:target: https://travis-ci.com/pycontribs/molecule-azure
.. image:: https://zuul-ci.org/gated.svg
:target: https://dashboard.zuul.ansible.com/t/ansible/builds?project=ansible-community/molecule-azure

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/python/black
:alt: Python Black Code Style

.. image:: https://img.shields.io/badge/Code%20of%20Conduct-Ansible-silver.svg
.. image:: https://img.shields.io/badge/Code%20of%20Conduct-silver.svg
:target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
:alt: Ansible Code of Conduct

.. image:: https://img.shields.io/badge/Mailing%20lists-Ansible-orange.svg
.. image:: https://img.shields.io/badge/Mailing%20lists-silver.svg
:target: https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
:alt: Ansible mailing lists

Expand Down Expand Up @@ -65,7 +65,7 @@ License

The `MIT`_ License.

.. _`MIT`: https://github.com/ansible/molecule/blob/master/LICENSE
.. _`MIT`: https://github.com/ansible-community/molecule/blob/master/LICENSE

The logo is licensed under the `Creative Commons NoDerivatives 4.0 License`_.

Expand Down
14 changes: 14 additions & 0 deletions bindep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is a cross-platform list tracking distribution packages needed by tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.

build-dep [platform:dpkg]
gcc-c++ [test platform:rpm]
gcc [test platform:rpm]
libselinux-python [platform:centos-7]
make [platform:centos-7]
pkg-config [platform:dpkg]
python36 [test !platform:centos-7 !platform:fedora-28]
python3-devel [test !platform:centos-7 platform:rpm]
python3-libselinux [platform:fedora]
python3-netifaces [test !platform:centos-7 platform:rpm]
python3 [test !platform:centos-7 platform:rpm]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Converge
hosts: all
tasks:

- name: Include tested role
include_role:
name: "{{ cookiecutter.role_name }}"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
vars:
resource_group_name: molecule
location: "{{ lookup('env', 'AZURE_REGION') or 'westus' }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,31 @@
until: azure_jobs.finished
retries: 300
with_items: "{{ server.results }}"
# avoid failure when resource_group is already missing, as we remove it later anyway
failed_when: false

- name: Destroy subnet
azure_rm_subnet:
resource_group: "{{ resource_group_name }}"
name: "{{ subnet_name }}"
virtual_network_name: "{{ virtual_network_name }}"
state: absent
# avoid failure when resource_group is already missing, as we remove it later anyway
failed_when: false

- name: Destroy virtual network
azure_rm_virtualnetwork:
resource_group: "{{ resource_group_name }}"
name: "{{ virtual_network_name }}"
state: absent
# avoid failure when resource_group is already missing, as we remove it later anyway
failed_when: false

- name: Destroy resource group
azure_rm_resourcegroup:
name: "{{ resource_group_name }}"
state: absent
force_delete_nonempty: true

# Mandatory configuration for Molecule to function.

Expand Down
4 changes: 1 addition & 3 deletions molecule_azure/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,4 @@ def template_dir(self):
""" Return path to its own cookiecutterm templates. It is used by init
command in order to figure out where to load the templates from.
"""
return os.path.join(
os.path.dirname(__file__), "cookiecutter/scenario/driver/azure"
)
return os.path.join(os.path.dirname(__file__), "cookiecutter")
9 changes: 0 additions & 9 deletions molecule_azure/test/functional/.ansible-lint

This file was deleted.

10 changes: 3 additions & 7 deletions molecule_azure/test/functional/test_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,26 @@

from molecule import logger
from molecule.test.conftest import run_command, change_dir_to
from molecule.test.functional.conftest import metadata_lint_update

# import change_dir_to, temp_dir

LOG = logger.get_logger(__name__)


@pytest.mark.xfail(reason="need to fix template path")
def test_command_init_scenario(temp_dir):
role_directory = os.path.join(temp_dir.strpath, "test-init")
options = {"role_name": "test-init"}
cmd = sh.molecule.bake("init", "role", **options)
options = {}
cmd = sh.molecule.bake("init", "role", "test-init", **options)
run_command(cmd)
metadata_lint_update(role_directory)

with change_dir_to(role_directory):
molecule_directory = pytest.helpers.molecule_directory()
scenario_directory = os.path.join(molecule_directory, "test-scenario")
options = {
"scenario_name": "test-scenario",
"role_name": "test-init",
"driver-name": "azure",
}
cmd = sh.molecule.bake("init", "scenario", **options)
cmd = sh.molecule.bake("init", "scenario", "test-scenario", **options)
run_command(cmd)

assert os.path.isdir(scenario_directory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ dependency:
name: galaxy
driver:
name: azure
lint:
name: yamllint
options:
config-file: ../../../resources/.yamllint
platforms:
- name: instance
provisioner:
Expand All @@ -19,11 +15,5 @@ provisioner:
destroy: ../../../../../resources/playbooks/azure/destroy.yml
env:
ANSIBLE_ROLES_PATH: ../../../../../resources/roles/
lint:
name: ansible-lint
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ dependency:
name: galaxy
driver:
name: azure
lint:
name: yamllint
options:
config-file: ../../../resources/.yamllint
platforms:
- name: instance-1
groups:
Expand All @@ -28,19 +24,13 @@ provisioner:
group_vars:
all:
resource_group_name: molecule
location: westus
location: "{{ lookup('env', 'AZURE_REGION') or 'westus' }}"
ssh_user: molecule
ssh_port: 22
virtual_network_name: molecule_vnet
subnet_name: molecule_subnet
keypair_path: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/ssh_key"
env:
ANSIBLE_ROLES_PATH: ../../../../../resources/roles/
lint:
name: ansible-lint
scenario:
name: multi-node
verifier:
name: testinfra
lint:
name: flake8
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
addopts = -v -rxXs --doctest-modules --durations 10 --cov=molecule_azure --cov-report term-missing:skip-covered --cov-report xml
addopts = -v -rxXs --doctest-modules --durations 10 --cov=molecule_azure --cov-report term-missing:skip-covered --no-cov-on-fail
doctest_optionflags = ALLOW_UNICODE ELLIPSIS
junit_suite_name = molecule_test_suite
norecursedirs = dist doc build .tox .eggs test/scenarios test/resources
Loading

0 comments on commit c395601

Please sign in to comment.