-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
311 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
profile: production | ||
|
||
exclude_paths: | ||
- .github | ||
- .manala |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up system | ||
uses: ./.manala/github/system/setup | ||
|
||
- name: Lint | ||
run: | | ||
make lint VERBOSE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up system | ||
uses: ./.manala/github/system/setup | ||
|
||
- name: Sanity | ||
run: | | ||
make test.sanity VERBOSE=1 | ||
- name: Units | ||
run: | | ||
make test.units VERBOSE=1 COVERAGE=1 | ||
- name: Integration | ||
run: | | ||
make test.integration VERBOSE=1 COVERAGE=1 | ||
- name: Coverage | ||
run: | | ||
make test.coverage VERBOSE=1 | ||
- name: Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
|
||
### Added | ||
|
||
- Initial release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__pycache__ | ||
/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
inventory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
--- | ||
|
||
########### | ||
# Present # | ||
########### | ||
|
||
- name: Present | ||
tags: present | ||
vars: | ||
path: /tmp/integration/path/present | ||
block: | ||
- name: Present | Setup path | ||
ansible.builtin.file: # noqa: risky-file-permissions | ||
path: "{{ path }}" | ||
state: "{{ item }}" | ||
loop: [absent, directory] | ||
- name: Present | Converge | ||
manala.path.path: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
state: present | ||
loop: | ||
- path: foo | ||
- name: Present | Stats | ||
ansible.builtin.stat: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
register: stats | ||
loop: | ||
- path: foo | ||
- name: Present | Verify | ||
ansible.builtin.assert: | ||
that: | ||
- stats.results[0].stat.exists is true | ||
- stats.results[0].stat.isdir is true | ||
|
||
########## | ||
# Absent # | ||
########## | ||
|
||
- name: Absent | ||
tags: absent | ||
vars: | ||
path: /tmp/integration/path/absent | ||
block: | ||
- name: Absent | Setup path | ||
ansible.builtin.file: # noqa: risky-file-permissions | ||
path: "{{ path }}" | ||
state: "{{ item }}" | ||
loop: [absent, directory] | ||
- name: Absent | Prepare files | ||
ansible.builtin.file: # noqa: risky-file-permissions | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
state: touch | ||
loop: | ||
- path: foo | ||
- name: Absent | Converge | ||
manala.path.path: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
state: absent | ||
loop: | ||
- path: foo | ||
- name: Absent | Stats | ||
ansible.builtin.stat: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
register: stats | ||
loop: | ||
- path: foo | ||
- name: Absent | Verify | ||
ansible.builtin.assert: | ||
that: | ||
- stats.results[0].stat.exists is false | ||
|
||
########### | ||
# Content # | ||
########### | ||
|
||
- name: Content | ||
tags: content | ||
vars: | ||
path: /tmp/integration/path/content | ||
block: | ||
- name: Content | Setup path | ||
ansible.builtin.file: # noqa: risky-file-permissions | ||
path: "{{ path }}" | ||
state: "{{ item }}" | ||
loop: [absent, directory] | ||
- name: Content | Converge | ||
manala.path.path: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
content: "{{ item.content }}" | ||
loop: | ||
- path: foo | ||
content: foo | ||
- name: Content | Stats | ||
ansible.builtin.stat: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
register: stats | ||
loop: | ||
- path: foo | ||
- name: Content | Contents | ||
ansible.builtin.slurp: | ||
src: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
register: contents | ||
loop: | ||
- path: foo | ||
- name: Content | Verify | ||
ansible.builtin.assert: | ||
that: | ||
- stats.results[0].stat.exists is true | ||
- contents.results[0].content | b64decode == 'foo' | ||
|
||
############ | ||
# Template # | ||
############ | ||
|
||
- name: Template | ||
tags: template | ||
vars: | ||
path: /tmp/integration/path/template | ||
block: | ||
- name: Template | Setup path | ||
ansible.builtin.file: # noqa: risky-file-permissions | ||
path: "{{ path }}" | ||
state: "{{ item }}" | ||
loop: [absent, directory] | ||
- name: Template | Converge | ||
manala.path.path: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
template: "{{ item.template }}" | ||
loop: | ||
- path: foo | ||
template: foo.j2 | ||
- name: Template | Stats | ||
ansible.builtin.stat: | ||
path: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
register: stats | ||
loop: | ||
- path: foo | ||
- name: Template | Contents | ||
ansible.builtin.slurp: | ||
src: "{{ [path, item.path] | ansible.builtin.path_join }}" | ||
register: contents | ||
loop: | ||
- path: foo | ||
- name: Template | Verify | ||
ansible.builtin.assert: | ||
that: | ||
- stats.results[0].stat.exists is true | ||
- contents.results[0].content | b64decode == 'foo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import unittest | ||
|
||
|
||
class Test(unittest.TestCase): | ||
|
||
def test_nothing(self): | ||
self.nothing = None | ||
self.assertIsNone(self.nothing) | ||
# To continue |