Skip to content

Commit

Permalink
unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
shellshock1953 committed Dec 17, 2023
1 parent f2e544a commit c1aa8c2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Molecule
on:
push:
paths:
- 'defaults/**'
- 'tasks/**'
- 'molecule/**'
- 'templates/**'
pull_request:
branches: [master]
paths:
- 'defaults/**'
- 'tasks/**'
- 'molecule/**'
- 'templates/**'
jobs:
tests:
runs-on: ubuntu-latest
name: component:brew
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ github.repository }}
- name: Molecule
uses: gofrolist/molecule-action@v2
with:
molecule_command: test
molecule_args: -d docker
molecule_working_dir: dnullproject/components
env:
ANSIBLE_FORCE_COLOR: '1'
28 changes: 26 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,33 @@
remote_user: root
tasks:
# TODO: resolve deps
- name: Testing -- COMPONENT_NAME
- name: Testing -- unittests
include_role:
name: components
vars:
role_component:
components: [COMPONENT_NAME]
components: [unittests]
unittests:
name: unittests
install:
pre:
- name: "[unittests] running pre"
file:
path: ~/.unittests
state: directory
packages: [git]
post:
- name: "[unittests] running post"
copy:
content: ""
dest: ~/.unittests/file
force: false
configs:
templates:
# TODO: modes
unittestsconfig:
template: unittests/unitconfig
dest: ~/.unittests/config
variables:
unitkey: "SUCCESS"
# TODO: add run section
1 change: 1 addition & 0 deletions templates/unittests/unitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unitkey="{{ var.unitkey }}"

0 comments on commit c1aa8c2

Please sign in to comment.